summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-09 17:11:23 +0000
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>2005-05-09 17:11:23 +0000
commita2cef37b6a2f9addf695279a36b49f30469ebf5c (patch)
tree6895ff910c476e4f5b92b7098c8c7f4d51ca1a12
parent61da801cdd977315e5589e35cbc6adf1a7097af1 (diff)
downloadgcc-a2cef37b6a2f9addf695279a36b49f30469ebf5c.tar.gz
2005-05-09 Adrian Straetling <straetling@de.ibm.com>
* config/s390/s390.md: ("COMPARE"): New mode macro. ("beq", "bne", "bgt", "bgtu", "blt", "bltu", "bge", "bgeu", "ble", "bleu", "bunordered", "bordered", "buneq", "bunlt", "bungt", "bunle", "bunge", "bltgt"): Merge. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99452 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/s390/s390.md116
2 files changed, 18 insertions, 105 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index abc2104ba28..00a9f522485 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2005-05-09 Adrian Straetling <straetling@de.ibm.com>
+ * config/s390/s390.md: ("COMPARE"): New mode macro.
+ ("beq", "bne", "bgt", "bgtu", "blt", "bltu", "bge", "bgeu",
+ "ble", "bleu", "bunordered", "bordered", "buneq", "bunlt",
+ "bungt", "bunle", "bunge", "bltgt"): Merge.
+
+2005-05-09 Adrian Straetling <straetling@de.ibm.com>
+
* config/s390/s390.md: ("INT"): New mode macro.
("one_cmpldi2", "one_cmplsi2", "one_cmplhi2", "one_cmplqi2"):
Merge.
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 5a258e499ff..f5029902346 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -251,6 +251,10 @@
;; same template.
(define_mode_macro INT [(DI "TARGET_64BIT") SI HI QI])
+;; This macro allows to unify all 'bCOND' expander patterns.
+(define_code_macro COMPARE [eq ne gt gtu lt ltu ge geu le leu unordered
+ ordered uneq unlt ungt unle unge ltgt])
+
;; ICM mask required to load MODE value into the highest subreg
;; of a SImode register.
@@ -6846,113 +6850,15 @@
;; Branch instruction patterns.
;;
-(define_expand "beq"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (EQ, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bne"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (NE, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bgt"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (GT, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bgtu"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (GTU, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "blt"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (LT, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bltu"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (LTU, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bge"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (GE, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bgeu"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (GEU, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "ble"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (LE, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bleu"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (LEU, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bunordered"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (UNORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bordered"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (ORDERED, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "buneq"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (UNEQ, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bunlt"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (UNLT, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bungt"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (UNGT, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bunle"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (UNLE, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bunge"
- [(match_operand 0 "" "")]
- ""
- "s390_emit_jump (operands[0],
- s390_emit_compare (UNGE, s390_compare_op0, s390_compare_op1)); DONE;")
-
-(define_expand "bltgt"
- [(match_operand 0 "" "")]
+(define_expand "b<code>"
+ [(set (pc)
+ (if_then_else (COMPARE (match_operand 0 "" "")
+ (const_int 0))
+ (match_dup 0)
+ (pc)))]
""
"s390_emit_jump (operands[0],
- s390_emit_compare (LTGT, s390_compare_op0, s390_compare_op1)); DONE;")
+ s390_emit_compare (<CODE>, s390_compare_op0, s390_compare_op1)); DONE;")
;;