From 981db2c7289d4318a6c5a83eedf3607b27377d05 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Thu, 14 Aug 2025 15:35:21 +0000 Subject: [PATCH] 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. --- VEX/priv/host_s390_defs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- 2.47.2