aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-07-24 14:44:03 -0700
committerJim Wilson <wilson@gcc.gnu.org>1996-07-24 14:44:03 -0700
commit7c225e88059d5c628b0f5449fd400f57223d9d37 (patch)
tree7dc238689a4a540de6b9feb8b4e1cd2734078e7c
parentfe25fea3f817e507caec0b3b9f41b318aae2a1ee (diff)
downloadgcc-7c225e88059d5c628b0f5449fd400f57223d9d37.zip
gcc-7c225e88059d5c628b0f5449fd400f57223d9d37.tar.gz
gcc-7c225e88059d5c628b0f5449fd400f57223d9d37.tar.bz2
(branch_true, branch_false, inverse_branch_true,
inverse_branch_false, beq, bne, bgt, blt, ble, bge, bgtu, bltu, bgeu, bleu, casesi): Express tests of the T bit as comparisons against zero, rather thann one. From-SVN: r12561
-rw-r--r--gcc/config/sh/sh.md36
1 files changed, 16 insertions, 20 deletions
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index a5ec8b7..91fa458 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -1483,12 +1483,8 @@
;; Define the real conditional branch instructions.
;; ------------------------------------------------------------------------
-;; ??? Branches should compare T-bit against zero not one, so that they will
-;; be in canonical form. get_condition in loop.c for instance will fail
-;; with these patterns.
-
(define_insn "branch_true"
- [(set (pc) (if_then_else (eq (reg:SI 18) (const_int 1))
+ [(set (pc) (if_then_else (ne (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1496,7 +1492,7 @@
[(set_attr "type" "cbranch")])
(define_insn "branch_false"
- [(set (pc) (if_then_else (ne (reg:SI 18) (const_int 1))
+ [(set (pc) (if_then_else (eq (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1504,7 +1500,7 @@
[(set_attr "type" "cbranch")])
(define_insn "inverse_branch_true"
- [(set (pc) (if_then_else (eq (reg:SI 18) (const_int 1))
+ [(set (pc) (if_then_else (ne (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1512,7 +1508,7 @@
[(set_attr "type" "cbranch")])
(define_insn "inverse_branch_false"
- [(set (pc) (if_then_else (ne (reg:SI 18) (const_int 1))
+ [(set (pc) (if_then_else (eq (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1524,7 +1520,7 @@
(define_expand "beq"
[(set (reg:SI 18) (eq:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1535,7 +1531,7 @@
(define_expand "bne"
[(set (reg:SI 18) (eq:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1544,7 +1540,7 @@
(define_expand "bgt"
[(set (reg:SI 18) (gt:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1553,7 +1549,7 @@
(define_expand "blt"
[(set (reg:SI 18) (ge:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1573,7 +1569,7 @@
(define_expand "ble"
[(set (reg:SI 18) (gt:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1582,7 +1578,7 @@
(define_expand "bge"
[(set (reg:SI 18) (ge:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1602,7 +1598,7 @@
(define_expand "bgtu"
[(set (reg:SI 18) (gtu:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1611,7 +1607,7 @@
(define_expand "bltu"
[(set (reg:SI 18) (geu:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1620,7 +1616,7 @@
(define_expand "bgeu"
[(set (reg:SI 18) (geu:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
""
@@ -1629,7 +1625,7 @@
(define_expand "bleu"
[(set (reg:SI 18) (gtu:SI (match_dup 1) (match_dup 2)))
(set (pc)
- (if_then_else (eq (reg:SI 18) (const_int 1))
+ (if_then_else (ne (reg:SI 18) (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
""
@@ -1776,8 +1772,8 @@
(gtu:SI (match_dup 5)
(match_operand:SI 2 "arith_reg_operand" "")))
(set (pc)
- (if_then_else (eq (reg:SI 18)
- (const_int 1))
+ (if_then_else (ne (reg:SI 18)
+ (const_int 0))
(label_ref (match_operand 4 "" ""))
(pc)))
(set (match_dup 6) (match_dup 5))