]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390: Fix s390_irgen_VGE[FG] and s390_irgen_VSCE[FG]
authorFlorian Krohm <flo2030@eich-krohm.de>
Wed, 4 Feb 2026 22:34:30 +0000 (22:34 +0000)
committerFlorian Krohm <flo2030@eich-krohm.de>
Wed, 4 Feb 2026 22:34:30 +0000 (22:34 +0000)
Instead of creating a specification exception these run into an assertion:

VEX: s390_vr_offset_by_index: invalid index for given type

There are proper s390_insn_assert in s390_irgen_VGEF etc. However, the
vassert happens in s390_format_VRV --> get_vr --> s390_vr_offset_by_index
prior to s390_irgen_... being called.
Fixed by adding s390_insn_assert to s390_format_VRV.

Found by disasm-test.

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

index 939d9b0cca11b19f3516ab061729afda20cf3c0f..219388eb6bf34c41f63655c2510c1c9d046a8a32 100644 (file)
@@ -3289,8 +3289,10 @@ s390_format_VRV(void (*irgen)(UChar v1, IRTemp op2addr, UChar m3),
    vassert(type == Ity_I32 || type == Ity_I64);
    IRExpr *x2;
    if(type == Ity_I32) {
+      s390_insn_assert(m3 < 4);
       x2 = unop(Iop_32Uto64, get_vr(v2, type, m3));
    } else {
+      s390_insn_assert(m3 < 2);
       x2 = get_vr(v2, type, m3);
    }
 
index 8742a9b74ca34106e630818089c602fbd927c7e6..fdfd38890cffe19a84ec2b34815a01366be612fb 100644 (file)
@@ -1,6 +1,6 @@
 Looking for missed specification exceptions
-Total:  42771 tests generated
-Total:  42771 specification exceptions
+Total:  43187 tests generated
+Total:  43187 specification exceptions
 Looking for unexpected specification exceptions
-Total: 153781 tests generated
+Total: 153877 tests generated
 Total:      0 specification exceptions
index ba921175a0951a3395e271abd8359e83ed1a0fd3..79c993c3d2966638678c4cdebb44639a7b0fe50a 100644 (file)
@@ -6,15 +6,10 @@
 # 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.
-
+#
 prereq: ./disasm-test --check-march=arch14
 prog: /bin/true
-post: ./disasm-test --gcc-flags=-march=arch14 --all --exclude exrl kma vgef vgeg vscef vsceg srnmb --summary
+post: ./disasm-test --gcc-flags=-march=arch14 --all --exclude exrl kma srnmb --summary
 vgopts: -q
 stderr_filter:
 stderrB_filter: