Commit 7c225e88 by Jim Wilson

(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
parent fe25fea3
...@@ -1483,12 +1483,8 @@ ...@@ -1483,12 +1483,8 @@
;; Define the real conditional branch instructions. ;; 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" (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1496,7 +1492,7 @@ ...@@ -1496,7 +1492,7 @@
[(set_attr "type" "cbranch")]) [(set_attr "type" "cbranch")])
(define_insn "branch_false" (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1504,7 +1500,7 @@ ...@@ -1504,7 +1500,7 @@
[(set_attr "type" "cbranch")]) [(set_attr "type" "cbranch")])
(define_insn "inverse_branch_true" (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) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1512,7 +1508,7 @@ ...@@ -1512,7 +1508,7 @@
[(set_attr "type" "cbranch")]) [(set_attr "type" "cbranch")])
(define_insn "inverse_branch_false" (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) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1524,7 +1520,7 @@ ...@@ -1524,7 +1520,7 @@
(define_expand "beq" (define_expand "beq"
[(set (reg:SI 18) (eq:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (eq:SI (match_dup 1) (match_dup 2)))
(set (pc) (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1535,7 +1531,7 @@ ...@@ -1535,7 +1531,7 @@
(define_expand "bne" (define_expand "bne"
[(set (reg:SI 18) (eq:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (eq:SI (match_dup 1) (match_dup 2)))
(set (pc) (set (pc)
(if_then_else (eq (reg:SI 18) (const_int 1)) (if_then_else (ne (reg:SI 18) (const_int 0))
(pc) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1544,7 +1540,7 @@ ...@@ -1544,7 +1540,7 @@
(define_expand "bgt" (define_expand "bgt"
[(set (reg:SI 18) (gt:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (gt:SI (match_dup 1) (match_dup 2)))
(set (pc) (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1553,7 +1549,7 @@ ...@@ -1553,7 +1549,7 @@
(define_expand "blt" (define_expand "blt"
[(set (reg:SI 18) (ge:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (ge:SI (match_dup 1) (match_dup 2)))
(set (pc) (set (pc)
(if_then_else (eq (reg:SI 18) (const_int 1)) (if_then_else (ne (reg:SI 18) (const_int 0))
(pc) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1573,7 +1569,7 @@ ...@@ -1573,7 +1569,7 @@
(define_expand "ble" (define_expand "ble"
[(set (reg:SI 18) (gt:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (gt:SI (match_dup 1) (match_dup 2)))
(set (pc) (set (pc)
(if_then_else (eq (reg:SI 18) (const_int 1)) (if_then_else (ne (reg:SI 18) (const_int 0))
(pc) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1582,7 +1578,7 @@ ...@@ -1582,7 +1578,7 @@
(define_expand "bge" (define_expand "bge"
[(set (reg:SI 18) (ge:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (ge:SI (match_dup 1) (match_dup 2)))
(set (pc) (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1602,7 +1598,7 @@ ...@@ -1602,7 +1598,7 @@
(define_expand "bgtu" (define_expand "bgtu"
[(set (reg:SI 18) (gtu:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (gtu:SI (match_dup 1) (match_dup 2)))
(set (pc) (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1611,7 +1607,7 @@ ...@@ -1611,7 +1607,7 @@
(define_expand "bltu" (define_expand "bltu"
[(set (reg:SI 18) (geu:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (geu:SI (match_dup 1) (match_dup 2)))
(set (pc) (set (pc)
(if_then_else (eq (reg:SI 18) (const_int 1)) (if_then_else (ne (reg:SI 18) (const_int 0))
(pc) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1620,7 +1616,7 @@ ...@@ -1620,7 +1616,7 @@
(define_expand "bgeu" (define_expand "bgeu"
[(set (reg:SI 18) (geu:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (geu:SI (match_dup 1) (match_dup 2)))
(set (pc) (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 "" "")) (label_ref (match_operand 0 "" ""))
(pc)))] (pc)))]
"" ""
...@@ -1629,7 +1625,7 @@ ...@@ -1629,7 +1625,7 @@
(define_expand "bleu" (define_expand "bleu"
[(set (reg:SI 18) (gtu:SI (match_dup 1) (match_dup 2))) [(set (reg:SI 18) (gtu:SI (match_dup 1) (match_dup 2)))
(set (pc) (set (pc)
(if_then_else (eq (reg:SI 18) (const_int 1)) (if_then_else (ne (reg:SI 18) (const_int 0))
(pc) (pc)
(label_ref (match_operand 0 "" ""))))] (label_ref (match_operand 0 "" ""))))]
"" ""
...@@ -1776,8 +1772,8 @@ ...@@ -1776,8 +1772,8 @@
(gtu:SI (match_dup 5) (gtu:SI (match_dup 5)
(match_operand:SI 2 "arith_reg_operand" ""))) (match_operand:SI 2 "arith_reg_operand" "")))
(set (pc) (set (pc)
(if_then_else (eq (reg:SI 18) (if_then_else (ne (reg:SI 18)
(const_int 1)) (const_int 0))
(label_ref (match_operand 4 "" "")) (label_ref (match_operand 4 "" ""))
(pc))) (pc)))
(set (match_dup 6) (match_dup 5)) (set (match_dup 6) (match_dup 5))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment