(branch_true, branch_false, inverse_branch_true,
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 24 Jul 1996 21:44:03 +0000 (14:44 -0700)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 24 Jul 1996 21:44:03 +0000 (14:44 -0700)
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

gcc/config/sh/sh.md

index a5ec8b769efe4616b66c1ad43478980082ae220b..91fa45832142f49f1de4f95e71f5ee8a6d2b3eb4 100644 (file)
 ;; 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)))]
   ""
   [(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)))]
   ""
   [(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 "" ""))))]
   ""
   [(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 "" ""))))]
   ""
 (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)))]
   ""
 (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 "" ""))))]
   ""
 (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)))]
   ""
 (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 "" ""))))]
   ""
 (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 "" ""))))]
   ""
 (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)))]
   ""
 (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)))]
   ""
 (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 "" ""))))]
   ""
 (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)))]
   ""
 (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 "" ""))))]
   ""
        (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))