]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390: Fix s390_irgen_SRNMB
authorFlorian Krohm <flo2030@eich-krohm.de>
Wed, 4 Feb 2026 20:36:09 +0000 (20:36 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Wed, 4 Feb 2026 20:36:09 +0000 (20:36 +0000)
When B2 is 0 the least significant 8 bits in D2 must designate a valid
rounding mode. Bits D2[0:55] are ignored. Mask D2 accordingly.

Found by disasm-test.

VEX/priv/guest_s390_toIR.c
none/tests/s390x/disasm-test/disasm-test.vgtest

index d9d31084c9f0414841570ea4b8c51e5e05b08d70..d9309e522cd6d57cc22693671381ef6346a1bdf4 100644 (file)
@@ -9337,6 +9337,7 @@ s390_irgen_SRNMB(UChar b2, UShort d2)
 {
    /* Can only check at IR generation time when b2 == 0 */
    if (b2 == 0) {
+      d2 &= 0xff;     // d2[0:55] is ignored
       s390_insn_assert(d2 <= 3 || d2 == 7);  // valid rounding mode
    }
    IRTemp op2addr = newTemp(Ity_I64);
index b440fadc2c7e9e7b288d609cb453b8ff6982d1c5..a5d9d844c3de89255de8d98f2ab57adf51fda869 100644 (file)
@@ -3,17 +3,15 @@
 # Therefore the real test here is run in the "post" command.
 #
 # Excluded opcodes:
-# exrl - Offset is expected to denote a decodable insn; no such scaffolding
-# kma  - cannot express constraint that r3 must be different from r1 and r2
+# exrl  - Offset is expected to denote a decodable insn; no such scaffolding
+# kma   - Cannot express constraint that r3 must be different from r1 and r2
+# srnmb - The compile-time checkable constraint cannot be expressed in opcode.c
 # The following need to be fixed
 # vgef - runs into an assert instead of spec. exc.
 # vgeg - runs into an assert instead of spec. exc.
 # vscef - runs into an assert instead of spec. exc.
 # vsceg - runs into an assert instead of spec. exc.
 # vstef - runs into an assert instead of spec. exc.
-# srnmb - The compile-time checkable constraint cannot be expressed in opcode.c
-#         But the s390_insn_assert is wrong nevertheless because bits [0:55] are ignored.
-#         Need to mask d2 before checking  (d2 & 0xff)
 
 prereq: ./disasm-test --check-march=arch14
 prog: /bin/true