Skip to contentSkip to conversation

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

PATCH In review Peter Maydell 2 participants 2 messages Nov 9, 2020 – Nov 10, 2020

lore
Share & tools
lore
#0 lore raw

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

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.

---
Based-on: [email protected] ("target/arm: Fix neon VTBL/VTBX for len > 1")

---
 target/arm/translate-neon.c.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
target/arm/translate-neon.c.inc +4 -4
index 0ae95cb8df8..2403825d15f 100644
@@ -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) {
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Peter Maydell

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.

---
Based-on: [email protected] ("target/arm: Fix neon VTBL/VTBX for len > 1")

---
 target/arm/translate-neon.c.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

r~