From: Florian Krohm Date: Thu, 14 Aug 2025 15:35:21 +0000 (+0000) Subject: s390: Fix code generation for Iop_16Uto32(0x...:I16) X-Git-Tag: VALGRIND_3_26_0~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=981db2c7289d4318a6c5a83eedf3607b27377d05;p=thirdparty%2Fvalgrind.git s390: Fix code generation for Iop_16Uto32(0x...:I16) Using LHI is wrong as it sign-extends. Use IILF instead. This has been wrong since day #1. Found by iropt-test. --- diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 1ee1696b3..c79aa11c0 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -9258,7 +9258,10 @@ s390_widen_emit(UChar *buf, const s390_insn *insn, UInt from_size, case 2: if (insn->size == 4) { /* 16 --> 32 */ - return s390_emit_LHI(buf, r1, value); + if (sign_extend) + return s390_emit_LHI(buf, r1, value); + else + return s390_emit_IILF(buf, r1, value); } if (insn->size == 8) { /* 16 --> 64 */ if (sign_extend)