]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
s390x: Mark VRs as clobbered by helper calls
authorAndreas Arnez <arnez@linux.ibm.com>
Fri, 13 Mar 2020 16:18:55 +0000 (17:18 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Fri, 13 Mar 2020 18:04:06 +0000 (19:04 +0100)
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.

VEX/priv/host_s390_defs.c

index 43b89c9253414f52d9cc326652ac322a662136b2..de267078e17e6ad0201f52b0a45ff1344f82e42e 100644 (file)
@@ -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) {