]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target-arm: Fix aarch64 vec_reg_offset
authorRichard Henderson <rth@twiddle.net>
Tue, 27 Dec 2016 14:59:24 +0000 (14:59 +0000)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 21 Mar 2017 19:50:26 +0000 (14:50 -0500)
Since CPUARMState.vfp.regs is not 16 byte aligned, the ^ 8 fixup used
for a big-endian host doesn't do what's intended.  Fix this by adding
in the vfp.regs offset after computing the inter-register offset.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Message-id: 1481085020-2614-2-git-send-email-rth@twiddle.net
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
(cherry picked from commit 416d72b97b01d6cb769ad0fd0e10614583354a45)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
target-arm/translate-a64.c

index 434dae165ed9895510fcc595aee1ca455019d74f..f673d939e1adec9d14f2dc6b5e38f8be5018e630 100644 (file)
@@ -527,7 +527,7 @@ static inline void assert_fp_access_checked(DisasContext *s)
 static inline int vec_reg_offset(DisasContext *s, int regno,
                                  int element, TCGMemOp size)
 {
-    int offs = offsetof(CPUARMState, vfp.regs[regno * 2]);
+    int offs = 0;
 #ifdef HOST_WORDS_BIGENDIAN
     /* This is complicated slightly because vfp.regs[2n] is
      * still the low half and  vfp.regs[2n+1] the high half
@@ -540,6 +540,7 @@ static inline int vec_reg_offset(DisasContext *s, int regno,
 #else
     offs += element * (1 << size);
 #endif
+    offs += offsetof(CPUARMState, vfp.regs[regno * 2]);
     assert_fp_access_checked(s);
     return offs;
 }