(ior (match_code "symbol_ref")
(match_operand 0 "register_operand")))
+(define_predicate "cc_reg_operand"
+ (and (match_code "reg")
+ (match_test "REGNO (op) == CC_REGNUM")))
+
(define_predicate "nosp_reg_operand"
(and (match_operand 0 "register_operand")
(match_test "REGNO (op) != SP_REGNUM")))
(define_code_iterator mima_oprnd [smax umax smin umin])
(define_code_attr mimaIsa [(smax "maxs") (umax "maxu") (smin "mins") (umin "minu")])
-(define_code_iterator any_cond [eq ne gt gtu lt ltu ge geu le leu])
-
;; Addition Instructions
(define_insn "adddi3"
;; Compare and Branch Instructions
+(define_insn "cbranchcc4"
+ [(set (pc)
+ (if_then_else (match_operator 0 "ordered_comparison_operator"
+ [(match_operand:CC 1 "cc_reg_operand" "r")
+ (match_operand 2 "cst4_operand" "L")])
+ (label_ref (match_operand 3 ""))
+ (pc)))]
+ ""
+ "b%d0\t%l3"
+ [(set_attr "length" "6")]
+)
+
(define_insn "cbranch<mode>4"
[(set (pc)
- (if_then_else (match_operator 0 "comparison_operator"
+ (if_then_else (match_operator 0 "ordered_comparison_operator"
[(match_operand:CRXIM 1 "register_operand" "r")
(match_operand:CRXIM 2 "reg_or_cst4_operand" "rL")])
(label_ref (match_operand 3 "" ""))
[(set_attr "length" "6")]
)
-;; Compare Instructions
-(define_expand "cmp<mode>"
+;; Scond Instructions
+
+(define_expand "cstore<mode>4"
[(set (reg:CC CC_REGNUM)
- (compare:CC (match_operand:CRXIM 0 "register_operand" "")
- (match_operand:CRXIM 1 "nonmemory_operand" "")))]
+ (compare:CC (match_operand:CRXIM 2 "register_operand" "")
+ (match_operand:CRXIM 3 "nonmemory_operand" "")))
+ (set (match_operand:SI 0 "register_operand")
+ (match_operator:SI 1 "ordered_comparison_operator"
+ [(reg:CC CC_REGNUM) (const_int 0)]))]
+ ""
""
- {
- crx_compare_op0 = operands[0];
- crx_compare_op1 = operands[1];
- DONE;
- }
)
(define_insn "cmp<mode>_internal"
[(set_attr "length" "2,<lImmArith>")]
)
-;; Conditional Branch Instructions
-
-(define_expand "b<code>"
- [(set (pc)
- (if_then_else (any_cond (reg:CC CC_REGNUM)
- (const_int 0))
- (label_ref (match_operand 0 ""))
- (pc)))]
- ""
- {
- crx_expand_branch (<CODE>, operands[0]);
- DONE;
- }
-)
-
-(define_insn "bCOND_internal"
- [(set (pc)
- (if_then_else (match_operator 0 "comparison_operator"
- [(reg:CC CC_REGNUM)
- (const_int 0)])
- (label_ref (match_operand 1 ""))
- (pc)))]
- ""
- "b%d0\t%l1"
- [(set_attr "length" "6")]
-)
-
-;; Scond Instructions
-
-(define_expand "s<code>"
- [(set (match_operand:SI 0 "register_operand")
- (any_cond:SI (reg:CC CC_REGNUM) (const_int 0)))]
- ""
- {
- crx_expand_scond (<CODE>, operands[0]);
- DONE;
- }
-)
-
(define_insn "sCOND_internal"
[(set (match_operand:SI 0 "register_operand" "=r")
- (match_operator:SI 1 "comparison_operator"
+ (match_operator:SI 1 "ordered_comparison_operator"
[(reg:CC CC_REGNUM) (const_int 0)]))]
""
"s%d1\t%0"