From: Florian Krohm Date: Wed, 4 Feb 2026 19:08:20 +0000 (+0000) Subject: s390: Fix s390_irgen_POPCNT X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4768afe69f4f38265e041c4ab9c2b08f6fdb16fa;p=thirdparty%2Fvalgrind.git s390: Fix s390_irgen_POPCNT The POPCNT insn does not cause a specification exception when reserved bits in m3 are not zero. Found by disasm-test. --- diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index ef955d9f2..e44faea9b 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -13019,8 +13019,6 @@ s390_irgen_FLOGR(UChar r1, UChar r2) static void s390_irgen_POPCNT(UChar m3, UChar r1, UChar r2) { - s390_insn_assert((m3 & 7) == 0); - static const ULong masks[] = { 0x5555555555555555, 0x3333333333333333, 0x0F0F0F0F0F0F0F0F, 0x00FF00FF00FF00FF, 0x0000FFFF0000FFFF, 0x00000000FFFFFFFF, diff --git a/none/tests/s390x/disasm-test/disasm-test.post.exp b/none/tests/s390x/disasm-test/disasm-test.post.exp index 68c0b9adb..51ae053ed 100644 --- a/none/tests/s390x/disasm-test/disasm-test.post.exp +++ b/none/tests/s390x/disasm-test/disasm-test.post.exp @@ -2,5 +2,5 @@ Looking for missed specification exceptions Total: 42131 tests generated Total: 42131 specification exceptions Looking for unexpected specification exceptions -Total: 153637 tests generated +Total: 153653 tests generated Total: 0 specification exceptions diff --git a/none/tests/s390x/disasm-test/disasm-test.vgtest b/none/tests/s390x/disasm-test/disasm-test.vgtest index 807250ba1..5fdf13266 100644 --- a/none/tests/s390x/disasm-test/disasm-test.vgtest +++ b/none/tests/s390x/disasm-test/disasm-test.vgtest @@ -12,7 +12,6 @@ # 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. -# popcnt - s390_insn_assert is wrong; just "may not operate correctly" # 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) @@ -20,7 +19,7 @@ prereq: ./disasm-test --check-march=arch14 prog: /bin/true -post: ./disasm-test --gcc-flags=-march=arch14 --all --exclude exrl kma vmsl vgef vgeg vscef vsceg vstef popcnt srnmb vster --summary +post: ./disasm-test --gcc-flags=-march=arch14 --all --exclude exrl kma vmsl vgef vgeg vscef vsceg vstef srnmb vster --summary vgopts: -q stderr_filter: stderrB_filter: