valgrind/0001-Bug-400491-s390x-Sign-extend-immediate-operand-of-LO.patch
Dirk Mueller 865e063b74 - build against Toolchain module for SLE12
- add 0001-Bug-397187-s390x-Add-vector-register-support-for-vgd.patch
  0001-Bug-400490-s390x-Fix-register-allocation-for-VRs-vs-.patch,
  0001-Bug-400491-s390x-Sign-extend-immediate-operand-of-LO.patch,
  Implement-emulated-system-registers.-Fixes-392146.patch (FATE#326355)

OBS-URL: https://build.opensuse.org/package/show/devel:tools/valgrind?expand=0&rev=174
2018-11-22 09:38:33 +00:00

46 lines
1.6 KiB
Diff

From 9545e9f96beda6e9f2205bdb3c3e96edaf8d9e2b Mon Sep 17 00:00:00 2001
From: Andreas Arnez <arnez@linux.ibm.com>
Date: Tue, 30 Oct 2018 17:06:38 +0100
Subject: [PATCH] Bug 400491 s390x: Sign-extend immediate operand of LOCHI and
friends
The VEX implementation of each of the z/Architecture instructions LOCHI,
LOCHHI, and LOCGHI treats the immediate 16-bit operand as an unsigned
integer instead of a signed integer. This is fixed.
---
NEWS | 1 +
VEX/priv/guest_s390_toIR.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
Index: valgrind-3.14.0/VEX/priv/guest_s390_toIR.c
===================================================================
--- valgrind-3.14.0.orig/VEX/priv/guest_s390_toIR.c
+++ valgrind-3.14.0/VEX/priv/guest_s390_toIR.c
@@ -16307,7 +16307,7 @@ static const HChar *
s390_irgen_LOCHHI(UChar r1, UChar m3, UShort i2, UChar unused)
{
next_insn_if(binop(Iop_CmpEQ32, s390_call_calculate_cond(m3), mkU32(0)));
- put_gpr_w0(r1, mkU32(i2));
+ put_gpr_w0(r1, mkU32((UInt)(Int)(Short)i2));
return "lochhi";
}
@@ -16316,7 +16316,7 @@ static const HChar *
s390_irgen_LOCHI(UChar r1, UChar m3, UShort i2, UChar unused)
{
next_insn_if(binop(Iop_CmpEQ32, s390_call_calculate_cond(m3), mkU32(0)));
- put_gpr_w1(r1, mkU32(i2));
+ put_gpr_w1(r1, mkU32((UInt)(Int)(Short)i2));
return "lochi";
}
@@ -16325,7 +16325,7 @@ static const HChar *
s390_irgen_LOCGHI(UChar r1, UChar m3, UShort i2, UChar unused)
{
next_insn_if(binop(Iop_CmpEQ32, s390_call_calculate_cond(m3), mkU32(0)));
- put_gpr_dw0(r1, mkU64(i2));
+ put_gpr_dw0(r1, mkU64((UInt)(Int)(Short)i2));
return "locghi";
}