;; 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))