Skip to contentSkip to conversation

target/s390x: Check reserved bits of VFMIN/VFMAX's M5

PATCH In review Ilya Leoshkevich 2 participants 2 messages Aug 4, 2023 – Aug 5, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/s390x: Check reserved bits of VFMIN/VFMAX's M5

VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set.

Fixes da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)")
---
 target/s390x/tcg/translate_vx.c.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/translate_vx.c.inc +1 -1
index f8df121d3d3..b5d07d5ec53 100644
@@ -3047,7 +3047,7 @@ static DisasJumpType op_vfmax(DisasContext *s, DisasOps *o)
     const uint8_t m5 = get_field(s, m5);
     gen_helper_gvec_3_ptr *fn;
 
-    if (m6 == 5 || m6 == 6 || m6 == 7 || m6 >= 13) {
+    if (m6 == 5 || m6 == 6 || m6 == 7 || m6 >= 13 || (m5 & 7)) {
         gen_program_exception(s, PGM_SPECIFICATION);
         return DISAS_NORETURN;
     }
Signature · 1 line
2.41.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Ilya Leoshkevich

VFMIN and VFMAX should raise a specification exceptions when bits 1-3 of M5 are set.

Fixes da4807527f3b ("s390x/tcg: Implement VECTOR FP (MAXIMUM|MINIMUM)")
---
  target/s390x/tcg/translate_vx.c.inc | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
target/s390x/tcg/translate_vx.c.inc +0 -0
index f8df121d3d3..b5d07d5ec53 100644

target/s390x/tcg/translate_vx.c.inc static DisasJumpType op_vfmax(DisasContext *s, DisasOps *o) · line 3053

Quoted 8 lines
target/s390x/tcg/translate_vx.c.inc +1 -1
@@ -3047,7 +3047,7 @@ static DisasJumpType op_vfmax(DisasContext *s, DisasOps *o)
      const uint8_t m5 = get_field(s, m5);
      gen_helper_gvec_3_ptr *fn;
 
-    if (m6 == 5 || m6 == 6 || m6 == 7 || m6 >= 13) {
+    if (m6 == 5 || m6 == 6 || m6 == 7 || m6 >= 13 || (m5 & 7)) {
          gen_program_exception(s, PGM_SPECIFICATION);
          return DISAS_NORETURN;
      }
Signature · 3 lines
Cheers,

David / dhildenb