|
From: Andreas A. <ar...@so...> - 2020-03-13 19:36:18
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b4ce6da03a8c886e1fab14eaa1f9b4f091308c3d commit b4ce6da03a8c886e1fab14eaa1f9b4f091308c3d Author: Andreas Arnez <ar...@li...> Date: Fri Mar 13 17:18:55 2020 +0100 s390x: Mark VRs as clobbered by helper calls According to the s390x ABI, all vector registers are call-clobbered (except for their portions that overlap with the call-saved FPRs). But the s390x backend doesn't mark them as such when determining the register usage of helper call insns. Fix this in s390_insn_get_reg_usage when handling S390_INSN_HELPER_CALL. Diff: --- VEX/priv/host_s390_defs.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 43b89c9253..de267078e1 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -770,6 +770,11 @@ s390_insn_get_reg_usage(HRegUsage *u, const s390_insn *insn) addHRegUse(u, HRmWrite, s390_hreg_fpr(i)); } + /* Ditto for all allocatable vector registers. */ + for (i = 16; i <= 31; ++i) { + addHRegUse(u, HRmWrite, s390_hreg_vr(i)); + } + /* The registers that are used for passing arguments will be read. Not all of them may, but in general we need to assume that. */ for (i = 0; i < insn->variant.helper_call.details->num_args; ++i) { |