[PATCH] target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check

Peter Maydell posted 1 patch 3 years, 5 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201109145324.2859-1-peter.maydell@linaro.org
Maintainers: Peter Maydell <peter.maydell@linaro.org>
target/arm/translate-neon.c.inc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
[PATCH] target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check
Posted by Peter Maydell 3 years, 5 months ago
Checks for UNDEF cases should go before the "is VFP enabled?" access
check, except in special cases. Move a stray UNDEF check in the VTBL
trans function up above the access check.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Based-on: 20201105171126.88014-1-richard.henderson@linaro.org
("target/arm: Fix neon VTBL/VTBX for len > 1")
---
 target/arm/translate-neon.c.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc
index 0ae95cb8df8..2403825d15f 100644
--- a/target/arm/translate-neon.c.inc
+++ b/target/arm/translate-neon.c.inc
@@ -2874,10 +2874,6 @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
         return false;
     }
 
-    if (!vfp_access_check(s)) {
-        return true;
-    }
-
     if ((a->vn + a->len + 1) > 32) {
         /*
          * This is UNPREDICTABLE; we choose to UNDEF to avoid the
@@ -2886,6 +2882,10 @@ static bool trans_VTBL(DisasContext *s, arg_VTBL *a)
         return false;
     }
 
+    if (!vfp_access_check(s)) {
+        return true;
+    }
+
     desc = tcg_const_i32((a->vn << 2) | a->len);
     def = tcg_temp_new_i64();
     if (a->op) {
-- 
2.20.1


Re: [PATCH] target/arm/translate-neon.c: Handle VTBL UNDEF case before VFP access check
Posted by Richard Henderson 3 years, 5 months ago
On 11/9/20 6:53 AM, Peter Maydell wrote:
> Checks for UNDEF cases should go before the "is VFP enabled?" access
> check, except in special cases. Move a stray UNDEF check in the VTBL
> trans function up above the access check.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Based-on: 20201105171126.88014-1-richard.henderson@linaro.org
> ("target/arm: Fix neon VTBL/VTBX for len > 1")
> ---
>  target/arm/translate-neon.c.inc | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~