From: Florian Krohm Date: Sat, 22 Mar 2025 18:56:09 +0000 (+0000) Subject: s390x: Fix BZ 498629 X-Git-Tag: VALGRIND_3_25_0~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=165681b33af3a97338781f57da531c2d22885c02;p=thirdparty%2Fvalgrind.git s390x: Fix BZ 498629 IR generation for S[L]HHHR and S[L]HHLR was broken. Now fixed as obvious. Fixes https://bugs.kde.org/show_bug.cgi?id=498629 --- diff --git a/NEWS b/NEWS index 4ae8bde25..d42a5f479 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. even though it's generated by --gen-suppressions=yes 498422 s390x: Fix VLRL and VSTRL insns 498492 none/tests/amd64/lzcnt64 crashes on FreeBSD compiled with clang +498629 s390x: Fix S[L]HHHR and S[L]HHLR insns 498632 s390x: Fix LNGFR insn 498942 s390x: Rework s390_disasm interface 499183 FreeBSD: differences in avx-vmovq output diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 3bebca53a..835d81dd7 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -10664,14 +10664,14 @@ s390_irgen_SHY(UChar r1, IRTemp op2addr) } static const HChar * -s390_irgen_SHHHR(UChar r3 __attribute__((unused)), UChar r1, UChar r2) +s390_irgen_SHHHR(UChar r3, UChar r1, UChar r2) { IRTemp op2 = newTemp(Ity_I32); IRTemp op3 = newTemp(Ity_I32); IRTemp result = newTemp(Ity_I32); - assign(op2, get_gpr_w0(r1)); - assign(op3, get_gpr_w0(r2)); + assign(op2, get_gpr_w0(r2)); + assign(op3, get_gpr_w0(r3)); assign(result, binop(Iop_Sub32, mkexpr(op2), mkexpr(op3))); s390_cc_thunk_putSS(S390_CC_OP_SIGNED_SUB_32, op2, op3); put_gpr_w0(r1, mkexpr(result)); @@ -10680,14 +10680,14 @@ s390_irgen_SHHHR(UChar r3 __attribute__((unused)), UChar r1, UChar r2) } static const HChar * -s390_irgen_SHHLR(UChar r3 __attribute__((unused)), UChar r1, UChar r2) +s390_irgen_SHHLR(UChar r3, UChar r1, UChar r2) { IRTemp op2 = newTemp(Ity_I32); IRTemp op3 = newTemp(Ity_I32); IRTemp result = newTemp(Ity_I32); - assign(op2, get_gpr_w0(r1)); - assign(op3, get_gpr_w1(r2)); + assign(op2, get_gpr_w0(r2)); + assign(op3, get_gpr_w1(r3)); assign(result, binop(Iop_Sub32, mkexpr(op2), mkexpr(op3))); s390_cc_thunk_putSS(S390_CC_OP_SIGNED_SUB_32, op2, op3); put_gpr_w0(r1, mkexpr(result)); @@ -10874,14 +10874,14 @@ s390_irgen_SLGFI(UChar r1, UInt i2) } static const HChar * -s390_irgen_SLHHHR(UChar r3 __attribute__((unused)), UChar r1, UChar r2) +s390_irgen_SLHHHR(UChar r3, UChar r1, UChar r2) { IRTemp op2 = newTemp(Ity_I32); IRTemp op3 = newTemp(Ity_I32); IRTemp result = newTemp(Ity_I32); - assign(op2, get_gpr_w0(r1)); - assign(op3, get_gpr_w0(r2)); + assign(op2, get_gpr_w0(r2)); + assign(op3, get_gpr_w0(r3)); assign(result, binop(Iop_Sub32, mkexpr(op2), mkexpr(op3))); s390_cc_thunk_putZZ(S390_CC_OP_UNSIGNED_SUB_32, op2, op3); put_gpr_w0(r1, mkexpr(result)); @@ -10890,14 +10890,14 @@ s390_irgen_SLHHHR(UChar r3 __attribute__((unused)), UChar r1, UChar r2) } static const HChar * -s390_irgen_SLHHLR(UChar r3 __attribute__((unused)), UChar r1, UChar r2) +s390_irgen_SLHHLR(UChar r3, UChar r1, UChar r2) { IRTemp op2 = newTemp(Ity_I32); IRTemp op3 = newTemp(Ity_I32); IRTemp result = newTemp(Ity_I32); - assign(op2, get_gpr_w0(r1)); - assign(op3, get_gpr_w1(r2)); + assign(op2, get_gpr_w0(r2)); + assign(op3, get_gpr_w1(r3)); assign(result, binop(Iop_Sub32, mkexpr(op2), mkexpr(op3))); s390_cc_thunk_putZZ(S390_CC_OP_UNSIGNED_SUB_32, op2, op3); put_gpr_w0(r1, mkexpr(result));