From: Andreas Arnez Date: Mon, 3 Jan 2022 17:15:05 +0000 (+0100) Subject: s390: Fix VFLRX and WFLRX instructions X-Git-Tag: VALGRIND_3_19_0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8229569cb8b1d564a97392237ebffa1d467b03ce;p=thirdparty%2Fvalgrind.git s390: Fix VFLRX and WFLRX instructions Due to a typo in s390_irgen_VFLR, the VFLR instruction behaves incorrectly when its m3 field contains 4, meaning extended format. In that case VFLR is also written as VFLRX (or WFLRX) and supposed to round down from the extended 128-bit format to the long 64-bit format. However, the typo checks for m3 == 2 instead, so the value of 4 is unhandled, causing Valgrind to throw a specification exception. This fixes the typo. --- diff --git a/NEWS b/NEWS index ff8af76566..718b8aef0a 100644 --- a/NEWS +++ b/NEWS @@ -60,6 +60,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 446281 Add a DRD suppression for fwrite 446103 Memcheck: `--track-origins=yes` causes extreme slowdowns for large mmap/munmap 446823 FreeBSD - missing syscalls when using libzm4 +447991 s390x: Valgrind indicates illegal instruction on wflrx 447995 Valgrind segfault on power10 due to hwcap checking code 449483 Powerpc: vcmpgtsq., vcmpgtuq,, vcmpequq. instructions not setting the condition code correctly. diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index fffc563d46..3ef104fcd9 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -19008,7 +19008,7 @@ s390_irgen_VFLL(UChar v1, UChar v2, UChar m3, UChar m4, UChar m5) static const HChar * s390_irgen_VFLR(UChar v1, UChar v2, UChar m3, UChar m4, UChar m5) { - s390_insn_assert("vflr", m3 == 3 || (s390_host_has_vxe && m3 == 2)); + s390_insn_assert("vflr", m3 == 3 || (s390_host_has_vxe && m3 == 4)); if (m3 == 3) s390_vector_fp_convert(Iop_F64toF32, Ity_F64, Ity_F32, True,