target/arm: Fix sve2 ldnt1 and stnt1
authorRichard Henderson <richard.henderson@linaro.org>
Tue, 8 Mar 2022 03:16:55 +0000 (17:16 -1000)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 18 Mar 2022 10:55:15 +0000 (10:55 +0000)
commitb17ab4705c78484d1bdd86cd9c1f7d42338cc1f1
tree9f1d45ce0530f2c9176f72f213c122d18e65fc15
parent1d60bb4b14601e38ed17384277aa4c30c57925d3
target/arm: Fix sve2 ldnt1 and stnt1

For both ldnt1 and stnt1, the meaning of the Rn and Rm are different
from ld1 and st1: the vector and integer registers are reversed, and
the integer register 31 refers to XZR instead of SP.

Secondly, the 64-bit version of ldnt1 was being interpreted as
32-bit unpacked unscaled offset instead of 64-bit unscaled offset,
which discarded the upper 32 bits of the address coming from
the vector argument.

Thirdly, validate that the memory element size is in range for the
vector element size for ldnt1.  For ld1, we do this via independent
decode patterns, but for ldnt1 we need to do it manually.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/826
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220308031655.240710-1-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/sve.decode
target/arm/translate-sve.c
tests/tcg/aarch64/Makefile.target
tests/tcg/aarch64/test-826.c [new file with mode: 0644]
tests/tcg/configure.sh