aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/frv/frv.md
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/config/frv/frv.md')
-rw-r--r--gcc/config/frv/frv.md330
1 files changed, 43 insertions, 287 deletions
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index aadf02c..9315f9b 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -3734,59 +3734,7 @@
;; ::
;; ::::::::::::::::::::
-;; Note, we store the operands in the comparison insns, and use them later
-;; when generating the branch or scc operation.
-
-;; First the routines called by the machine independent part of the compiler
-(define_expand "cmpsi"
- [(set (cc0)
- (compare (match_operand:SI 0 "integer_register_operand" "")
- (match_operand:SI 1 "gpr_or_int10_operand" "")))]
- ""
- "
-{
- frv_compare_op0 = operands[0];
- frv_compare_op1 = operands[1];
- DONE;
-}")
-
-;(define_expand "cmpdi"
-; [(set (cc0)
-; (compare (match_operand:DI 0 "register_operand" "")
-; (match_operand:DI 1 "nonmemory_operand" "")))]
-; ""
-; "
-;{
-; frv_compare_op0 = operands[0];
-; frv_compare_op1 = operands[1];
-; DONE;
-;}")
-
-(define_expand "cmpsf"
- [(set (cc0)
- (compare (match_operand:SF 0 "fpr_operand" "")
- (match_operand:SF 1 "fpr_operand" "")))]
- "TARGET_HARD_FLOAT"
- "
-{
- frv_compare_op0 = operands[0];
- frv_compare_op1 = operands[1];
- DONE;
-}")
-
-(define_expand "cmpdf"
- [(set (cc0)
- (compare (match_operand:DF 0 "fpr_operand" "")
- (match_operand:DF 1 "fpr_operand" "")))]
- "TARGET_HARD_FLOAT && TARGET_DOUBLE"
- "
-{
- frv_compare_op0 = operands[0];
- frv_compare_op1 = operands[1];
- DONE;
-}")
-
-;; Now, the actual comparisons, generated by the branch and/or scc operations
+;; The comparisons are generated by the branch and/or scc operations
(define_insn "cmpsi_cc"
[(set (match_operand:CC 0 "icc_operand" "=t,t")
@@ -3847,137 +3795,31 @@
;; ::::::::::::::::::::
;; Define_expands called by the machine independent part of the compiler
-;; to allocate a new comparison register. Each of these named patterns
-;; must be present, and they cannot be amalgamated into one pattern.
-;;
-;; If a fixed condition code register is being used, (as opposed to, say,
-;; using cc0), then the expands should look like this:
-;;
-;; (define_expand "<name_of_test>"
-;; [(set (reg:CC <number_of_CC_register>)
-;; (compare:CC (match_dup 1)
-;; (match_dup 2)))
-;; (set (pc)
-;; (if_then_else (eq:CC (reg:CC <number_of_CC_register>)
-;; (const_int 0))
-;; (label_ref (match_operand 0 "" ""))
-;; (pc)))]
-;; ""
-;; "{
-;; operands[1] = frv_compare_op0;
-;; operands[2] = frv_compare_op1;
-;; }"
-;; )
-
-(define_expand "beq"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (EQ, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "bne"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (NE, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "blt"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (LT, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "ble"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (LE, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "bgt"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (GT, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "bge"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (GE, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "bltu"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (LTU, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "bleu"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (LEU, operands[0]))
- FAIL;
-
- DONE;
-}")
+;; to allocate a new comparison register.
-(define_expand "bgtu"
- [(use (match_operand 0 "" ""))]
- ""
- "
-{
- if (! frv_emit_cond_branch (GTU, operands[0]))
- FAIL;
+(define_expand "cbranchdf4"
+ [(use (match_operator 0 "ordered_comparison_operator"
+ [(match_operand:DF 1 "fpr_operand" "")
+ (match_operand:DF 2 "fpr_operand" "")]))
+ (use (match_operand 3 ""))]
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE"
+ { if (frv_emit_cond_branch (operands)) DONE; gcc_unreachable (); })
- DONE;
-}")
+(define_expand "cbranchsf4"
+ [(use (match_operator 0 "ordered_comparison_operator"
+ [(match_operand:SF 1 "fpr_operand" "")
+ (match_operand:SF 2 "fpr_operand" "")]))
+ (use (match_operand 3 ""))]
+ "TARGET_HARD_FLOAT"
+ { if (frv_emit_cond_branch (operands)) DONE; gcc_unreachable (); })
-(define_expand "bgeu"
- [(use (match_operand 0 "" ""))]
+(define_expand "cbranchsi4"
+ [(use (match_operator 0 "ordered_comparison_operator"
+ [(match_operand:SI 1 "integer_register_operand" "")
+ (match_operand:SI 2 "gpr_or_int10_operand" "")]))
+ (use (match_operand 3 ""))]
""
- "
-{
- if (! frv_emit_cond_branch (GEU, operands[0]))
- FAIL;
-
- DONE;
-}")
+ { if (frv_emit_cond_branch (operands)) DONE; gcc_unreachable (); })
;; Actual branches. We must allow for the (label_ref) and the (pc) to be
;; swapped. If they are swapped, it reverses the sense of the branch.
@@ -4142,115 +3984,29 @@
;; Define_expands called by the machine independent part of the compiler
;; to allocate a new comparison register
-(define_expand "seq"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (EQ, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sne"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (NE, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "slt"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (LT, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sle"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (LE, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sgt"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (GT, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sge"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (GE, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sltu"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (LTU, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sleu"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (LEU, operands[0]))
- FAIL;
-
- DONE;
-}")
-
-(define_expand "sgtu"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (GTU, operands[0]))
- FAIL;
-
- DONE;
-}")
+(define_expand "cstoredf4"
+ [(use (match_operator:SI 1 "ordered_comparison_operator"
+ [(match_operand:DF 2 "fpr_operand")
+ (match_operand:DF 3 "fpr_operand")]))
+ (clobber (match_operand:SI 0 "register_operand"))]
+ "TARGET_HARD_FLOAT && TARGET_DOUBLE"
+ { if (frv_emit_scc (operands)) DONE; else FAIL; })
-(define_expand "sgeu"
- [(match_operand:SI 0 "integer_register_operand" "")]
- "TARGET_SCC"
- "
-{
- if (! frv_emit_scc (GEU, operands[0]))
- FAIL;
+(define_expand "cstoresf4"
+ [(use (match_operator:SI 1 "ordered_comparison_operator"
+ [(match_operand:SF 2 "fpr_operand")
+ (match_operand:SF 3 "fpr_operand")]))
+ (clobber (match_operand:SI 0 "register_operand"))]
+ "TARGET_HARD_FLOAT"
+ { if (frv_emit_scc (operands)) DONE; else FAIL; })
- DONE;
-}")
+(define_expand "cstoresi4"
+ [(use (match_operator:SI 1 "ordered_comparison_operator"
+ [(match_operand:SI 2 "integer_register_operand")
+ (match_operand:SI 3 "gpr_or_int10_operand")]))
+ (clobber (match_operand:SI 0 "register_operand"))]
+ ""
+ { if (frv_emit_scc (operands)) DONE; else FAIL; })
(define_insn "*scc_int"
[(set (match_operand:SI 0 "integer_register_operand" "=d")