s390x: XC instruction: clear in 8-byte increments if possible
commit96a830df537e2ebd02f0b96603c986351ac5d6f8
authorAndreas Arnez <arnez@linux.ibm.com>
Thu, 26 Jan 2023 16:41:18 +0000 (26 17:41 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Thu, 11 May 2023 14:27:36 +0000 (11 16:27 +0200)
tree0099f78d13f01b200ade64e5bf52e18beb517104
parent97d335621a60a3c29ded56ea4a29ae1968ed7c8a
s390x: XC instruction: clear in 8-byte increments if possible

The XC instruction is frequently executed in many programs, mainly for
clearing memory.  It can target from 1 to 256 bytes.  If the size is
constant and XC is actually used for clearing memory, Valgrind implements
it as a byte-wise loop and rolls out the loop for <= 8 bytes.

Instead of clearing byte-wise, it is more efficient to clear in 64-bit
increments, so do this for sizes >= 8 bytes.  Roll out the loop for up to
32 bytes.  Overall, this reduces the number of insns by a few percent and
provides a slight performance improvement for some programs.
VEX/priv/guest_s390_toIR.c