This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[s390] patch: merge and/ior/xor exander patterns


Hi,

this patch merges the and/ior/xor expander patterns using a mode macro that
already exists.

Bootstrapped and regtested on mainline with s390 and s390x. Ok to apply?


2005-05-09  Adrian Straetling  <straetling@de.ibm.com>

	* config/s390/s390.md: ("anddi3","andsi3","andhi3","andqi3"): Merge.
	("iordi3", "iorsi3", "iorhi3", "iorqi3"): Merge.
	("xordi3", "xorsi3", "xorhi3", "xorqi3"): Merge.


Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md.orig	2005-05-06 10:30:26.000000000 +0200
--- gcc/config/s390/s390.md	2005-05-06 11:15:11.221486453 +0200
***************
*** 4572,4577 ****
--- 4572,4585 ----
  ;;- And instructions.
  ;;
  
+ (define_expand "and<mode>3"
+   [(set (match_operand:INT 0 "nonimmediate_operand" "")
+         (and:INT (match_operand:INT 1 "nonimmediate_operand" "")
+                  (match_operand:INT 2 "general_operand" "")))
+    (clobber (reg:CC CC_REGNUM))]
+   ""
+   "s390_expand_logical_operator (AND, <MODE>mode, operands); DONE;")
+ 
  ;
  ; anddi3 instruction pattern(s).
  ;
***************
*** 4634,4646 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
  
- (define_expand "anddi3"
-   [(set (match_operand:DI 0 "nonimmediate_operand" "")
-         (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
-                 (match_operand:DI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   "TARGET_64BIT"
-   "s390_expand_logical_operator (AND, DImode, operands); DONE;")
  
  ;
  ; andsi3 instruction pattern(s).
--- 4642,4647 ----
***************
*** 4718,4731 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
  
- (define_expand "andsi3"
-   [(set (match_operand:SI 0 "nonimmediate_operand" "")
-         (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
-                 (match_operand:SI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (AND, SImode, operands); DONE;")
- 
  ;
  ; andhi3 instruction pattern(s).
  ;
--- 4719,4724 ----
***************
*** 4765,4778 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (AND, &operands[0], &operands[1]);")
  
- (define_expand "andhi3"
-   [(set (match_operand:HI 0 "nonimmediate_operand" "")
-         (and:HI (match_operand:HI 1 "nonimmediate_operand" "")
-                 (match_operand:HI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (AND, HImode, operands); DONE;")
- 
  ;
  ; andqi3 instruction pattern(s).
  ;
--- 4758,4763 ----
***************
*** 4803,4816 ****
     #"
    [(set_attr "op_type"  "RR,SI,SS")])
  
- (define_expand "andqi3"
-   [(set (match_operand:QI 0 "nonimmediate_operand" "")
-         (and:QI (match_operand:QI 1 "nonimmediate_operand" "")
-                 (match_operand:QI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (AND, QImode, operands); DONE;")
- 
  ;
  ; Block and (NC) patterns.
  ;
--- 4788,4793 ----
***************
*** 4872,4877 ****
--- 4849,4862 ----
  ;;- Bit set (inclusive or) instructions.
  ;;
  
+ (define_expand "ior<mode>3"
+   [(set (match_operand:INT 0 "nonimmediate_operand" "")
+         (ior:INT (match_operand:INT 1 "nonimmediate_operand" "")
+                  (match_operand:INT 2 "general_operand" "")))
+    (clobber (reg:CC CC_REGNUM))]
+   ""
+   "s390_expand_logical_operator (IOR, <MODE>mode, operands); DONE;")
+ 
  ;
  ; iordi3 instruction pattern(s).
  ;
***************
*** 4929,4942 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
  
- (define_expand "iordi3"
-   [(set (match_operand:DI 0 "nonimmediate_operand" "")
-         (ior:DI (match_operand:DI 1 "nonimmediate_operand" "")
-                 (match_operand:DI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   "TARGET_64BIT"
-   "s390_expand_logical_operator (IOR, DImode, operands); DONE;")
- 
  ;
  ; iorsi3 instruction pattern(s).
  ;
--- 4914,4919 ----
***************
*** 5007,5020 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
  
- (define_expand "iorsi3"
-   [(set (match_operand:SI 0 "nonimmediate_operand" "")
-         (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
-                 (match_operand:SI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (IOR, SImode, operands); DONE;")
- 
  ;
  ; iorhi3 instruction pattern(s).
  ;
--- 4984,4989 ----
***************
*** 5054,5067 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (IOR, &operands[0], &operands[1]);")
  
- (define_expand "iorhi3"
-   [(set (match_operand:HI 0 "nonimmediate_operand" "")
-         (ior:HI (match_operand:HI 1 "nonimmediate_operand" "")
-                 (match_operand:HI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (IOR, HImode, operands); DONE;")
- 
  ;
  ; iorqi3 instruction pattern(s).
  ;
--- 5023,5028 ----
***************
*** 5092,5105 ****
     #"
    [(set_attr "op_type"  "RR,SI,SS")])
  
- (define_expand "iorqi3"
-   [(set (match_operand:QI 0 "nonimmediate_operand" "")
-         (ior:QI (match_operand:QI 1 "nonimmediate_operand" "")
-                 (match_operand:QI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (IOR, QImode, operands); DONE;")
- 
  ;
  ; Block inclusive or (OC) patterns.
  ;
--- 5053,5058 ----
***************
*** 5161,5166 ****
--- 5114,5127 ----
  ;;- Xor instructions.
  ;;
  
+ (define_expand "xor<mode>3"
+   [(set (match_operand:INT 0 "nonimmediate_operand" "")
+         (xor:INT (match_operand:INT 1 "nonimmediate_operand" "")
+                  (match_operand:INT 2 "general_operand" "")))
+    (clobber (reg:CC CC_REGNUM))]
+   ""
+   "s390_expand_logical_operator (XOR, <MODE>mode, operands); DONE;")
+ 
  ;
  ; xordi3 instruction pattern(s).
  ;
***************
*** 5213,5226 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
  
- (define_expand "xordi3"
-   [(set (match_operand:DI 0 "nonimmediate_operand" "")
-         (xor:DI (match_operand:DI 1 "nonimmediate_operand" "")
-                 (match_operand:DI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   "TARGET_64BIT"
-   "s390_expand_logical_operator (XOR, DImode, operands); DONE;")
- 
  ;
  ; xorsi3 instruction pattern(s).
  ;
--- 5174,5179 ----
***************
*** 5276,5289 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
  
- (define_expand "xorsi3"
-   [(set (match_operand:SI 0 "nonimmediate_operand" "")
-         (xor:SI (match_operand:SI 1 "nonimmediate_operand" "")
-                 (match_operand:SI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (XOR, SImode, operands); DONE;")
- 
  ;
  ; xorhi3 instruction pattern(s).
  ;
--- 5229,5234 ----
***************
*** 5310,5323 ****
       (clobber (reg:CC CC_REGNUM))])]
    "s390_narrow_logical_operator (XOR, &operands[0], &operands[1]);")
  
- (define_expand "xorhi3"
-   [(set (match_operand:HI 0 "nonimmediate_operand" "")
-         (xor:HI (match_operand:HI 1 "nonimmediate_operand" "")
-                 (match_operand:HI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (XOR, HImode, operands); DONE;")
- 
  ;
  ; xorqi3 instruction pattern(s).
  ;
--- 5255,5260 ----
***************
*** 5335,5348 ****
     #"
    [(set_attr "op_type"  "RR,SI,SIY,SS")])
  
- (define_expand "xorqi3"
-   [(set (match_operand:QI 0 "nonimmediate_operand" "")
-         (xor:QI (match_operand:QI 1 "nonimmediate_operand" "")
-                 (match_operand:QI 2 "general_operand" "")))
-    (clobber (reg:CC CC_REGNUM))]
-   ""
-   "s390_expand_logical_operator (XOR, QImode, operands); DONE;")
- 
  ;
  ; Block exclusive or (XC) patterns.
  ;
--- 5272,5277 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]