summaryrefslogtreecommitdiff
path: root/gcc/config/s390
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-23 09:01:42 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-23 09:01:42 +0000
commitbe0be2de8d0abcddb994a1acbbfadc284dda413d (patch)
treef500d077aa5fb6b297c28e717a86ed721f7cfbc5 /gcc/config/s390
parent7feac654b4470ce1cc708e187dcec132410c0fc2 (diff)
downloadgcc-be0be2de8d0abcddb994a1acbbfadc284dda413d.tar.gz
S/390: Add splitter for "and" with complement.
Split ~b & a to (b & a) ^ a. This is benefitial on z Systems since we otherwise need a big -1 constant to be loaded for the ~b. gcc/ChangeLog: 2016-08-23 Dominik Vogt <vogt@linux.vnet.ibm.com> * config/s390/s390.md ("*andc_split"): New splitter for and with complement. gcc/testsuite/ChangeLog: 2016-08-23 Dominik Vogt <vogt@linux.vnet.ibm.com> * gcc.target/s390/md/andc-splitter-1.c: New test case. * gcc.target/s390/md/andc-splitter-2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239685 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/s390')
-rw-r--r--gcc/config/s390/s390.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index a63cee9ebe0..30ddc14a46f 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -7267,6 +7267,33 @@
(set_attr "z10prop" "z10_super_E1,z10_super,*")])
;
+; And with complement
+;
+; c = ~b & a = (b & a) ^ a
+
+(define_insn_and_split "*andc_split_<mode>"
+ [(set (match_operand:GPR 0 "nonimmediate_operand" "")
+ (and:GPR (not:GPR (match_operand:GPR 1 "nonimmediate_operand" ""))
+ (match_operand:GPR 2 "general_operand" "")))
+ (clobber (reg:CC CC_REGNUM))]
+ "! reload_completed && s390_logical_operator_ok_p (operands)"
+ "#"
+ "&& 1"
+ [
+ (parallel
+ [(set (match_dup 3) (and:GPR (match_dup 1) (match_dup 2)))
+ (clobber (reg:CC CC_REGNUM))])
+ (parallel
+ [(set (match_dup 0) (xor:GPR (match_dup 3) (match_dup 2)))
+ (clobber (reg:CC CC_REGNUM))])]
+{
+ if (reg_overlap_mentioned_p (operands[0], operands[2]))
+ operands[3] = gen_reg_rtx (<MODE>mode);
+ else
+ operands[3] = operands[0];
+})
+
+;
; Block and (NC) patterns.
;