]> git.ipfire.org Git - thirdparty/valgrind.git/commit
s390x: Exploit LOCGHI for converting from CC to Int1
authorAndreas Arnez <arnez@linux.ibm.com>
Wed, 5 Feb 2020 18:28:53 +0000 (19:28 +0100)
committerAndreas Arnez <arnez@linux.ibm.com>
Tue, 25 Feb 2020 15:45:34 +0000 (16:45 +0100)
commit75878add525a00d14be360c3bb1bc9e27596d43a
treeb762bd6325a16a21ad1f2ec6c430367ec66a8af6
parentbb594e098b75ae6309c8f2ee2a7ddc5c6dc2361f
s390x: Exploit LOCGHI for converting from CC to Int1

Whenever converting a condition code to a Boolean value, the current
implementation in s390_insn_cc2bool_emit() generates six instructions
including "insert program mask" (IPM).  On systems with the
load/store-on-condition facility 2, this can be done in two instructions
instead, using "load halfword immediate on condition" (LOCGHI).

Add the new hardware capability VEX_HWCAPS_S390X_LSC2 and the respective
macro s390_host_has_lsc2.  In s390_insn_cc2bool_emit(), check for the
facility and exploit it if available.

A conditional move from an immediate value can be slightly improved with
LOCGHI as well, so do that in s390_insn_cond_move_emit() if possible.
VEX/priv/host_s390_defs.c
VEX/priv/host_s390_defs.h
VEX/priv/main_main.c
VEX/pub/libvex.h
coregrind/m_machine.c