aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2017-04-25 07:33:05 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2017-04-25 07:33:05 +0000
commit97160c9b3b6e524efd7ee4e12dfcd82519d27246 (patch)
tree8e8e359bdf96da3b59cf6daf054e70c0ab155c6f
parent3ea685e75abb8e48098ba4b51e3fa6b5e120111f (diff)
downloadgcc-97160c9b3b6e524efd7ee4e12dfcd82519d27246.zip
gcc-97160c9b3b6e524efd7ee4e12dfcd82519d27246.tar.gz
gcc-97160c9b3b6e524efd7ee4e12dfcd82519d27246.tar.bz2
S/390: Load and test peephole.
gcc/ChangeLog: 2017-04-25 Dominik Vogt <vogt@linux.vnet.ibm.com> * config/s390/s390.md (define_peephole2): New peephole to help combining the load-and-test pattern with volatile memory. From-SVN: r247131
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/s390/s390.md15
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 2f2365b..7106442a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2017-04-25 Dominik Vogt <vogt@linux.vnet.ibm.com>
+ * config/s390/s390.md (define_peephole2): New peephole to help
+ combining the load-and-test pattern with volatile memory.
+
+2017-04-25 Dominik Vogt <vogt@linux.vnet.ibm.com>
+
* config/s390/s390.md ("cstorecc4"): Use load-on-condition and deal
with CCZmode for TARGET_Z196.
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 6a1cab6..9baafcc 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -907,6 +907,21 @@
[(set_attr "op_type" "RR<E>,RXY")
(set_attr "z10prop" "z10_fr_E1,z10_fwd_A3") ])
+; Peephole to combine a load-and-test from volatile memory which combine does
+; not do.
+(define_peephole2
+ [(set (match_operand:GPR 0 "register_operand")
+ (match_operand:GPR 2 "memory_operand"))
+ (set (reg CC_REGNUM)
+ (compare (match_dup 0) (match_operand:GPR 1 "const0_operand")))]
+ "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM
+ && GENERAL_REG_P (operands[0])
+ && satisfies_constraint_T (operands[2])"
+ [(parallel
+ [(set (reg:CCS CC_REGNUM)
+ (compare:CCS (match_dup 2) (match_dup 1)))
+ (set (match_dup 0) (match_dup 2))])])
+
; ltr, lt, ltgr, ltg
(define_insn "*tst<mode>_cconly_extimm"
[(set (reg CC_REGNUM)