Add valgrind-3.14.0-s390x-sign-extend-lochi.patch.

This commit is contained in:
Mark Wielaard 2018-11-20 17:25:26 +01:00
parent 8e0b80c103
commit 5330dfb59d
2 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,41 @@
commit 9545e9f96beda6e9f2205bdb3c3e96edaf8d9e2b
Author: Andreas Arnez <arnez@linux.ibm.com>
Date: Tue Oct 30 17:06:38 2018 +0100
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.
diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c
index 60b6081..9c4d79b 100644
--- a/VEX/priv/guest_s390_toIR.c
+++ b/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";
}

View File

@ -114,6 +114,9 @@ Patch3: valgrind-3.9.0-ldso-supp.patch
# KDE#400490 s390x: Fix register allocation for VRs vs FPRs # KDE#400490 s390x: Fix register allocation for VRs vs FPRs
Patch4: valgrind-3.14.0-s390x-fix-reg-alloc-vr-vs-fpr.patch Patch4: valgrind-3.14.0-s390x-fix-reg-alloc-vr-vs-fpr.patch
# KDE#400491 s390x: Sign-extend immediate operand of LOCHI and friends
Patch5: valgrind-3.14.0-s390x-sign-extend-lochi.patch
%if %{build_multilib} %if %{build_multilib}
# Ensure glibc{,-devel} is installed for both multilib arches # Ensure glibc{,-devel} is installed for both multilib arches
BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so BuildRequires: /lib/libc.so.6 /usr/lib/libc.so /lib64/libc.so.6 /usr/lib64/libc.so
@ -250,6 +253,7 @@ Valgrind User Manual for details.
%patch2 -p1 %patch2 -p1
%patch3 -p1 %patch3 -p1
%patch4 -p1 %patch4 -p1
%patch5 -p1
%build %build
CC=gcc CC=gcc
@ -486,6 +490,7 @@ fi
%changelog %changelog
* Tue Nov 20 2018 Mark Wielaard <mjw@fedoraproject.org> * Tue Nov 20 2018 Mark Wielaard <mjw@fedoraproject.org>
- Add valgrind-3.14.0-s390x-fix-reg-alloc-vr-vs-fpr.patch. - Add valgrind-3.14.0-s390x-fix-reg-alloc-vr-vs-fpr.patch.
- Add valgrind-3.14.0-s390x-sign-extend-lochi.patch.
* Tue Oct 9 2018 Mark Wielaard <mjw@fedoraproject.org> - 3.14.0-1 * Tue Oct 9 2018 Mark Wielaard <mjw@fedoraproject.org> - 3.14.0-1
- valgrind 3.14.0 final. - valgrind 3.14.0 final.