diff gcc/config/iq2000/iq2000.md @ 55:77e2b8dfacca gcc-4.4.5

update it from 4.4.3 to 4.5.0
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Fri, 12 Feb 2010 23:39:51 +0900
parents a06113de4d67
children f6334be47118
line wrap: on
line diff
--- a/gcc/config/iq2000/iq2000.md	Sun Feb 07 18:28:00 2010 +0900
+++ b/gcc/config/iq2000/iq2000.md	Fri Feb 12 23:39:51 2010 +0900
@@ -737,7 +737,7 @@
   "* return iq2000_move_1word (operands, insn, FALSE);"
   [(set_attr "type"	"move,load,arith,arith,load,load,store,store,xfer,xfer,move,move,move,move")
    (set_attr "mode"	"SI")
-   (set_attr "length"	"4,8,4,8,4,8,4,8,4,4,4,4,4,4")])
+   (set_attr "length"	"4,8,4,8,8,8,4,8,4,4,4,4,4,4")])
 
 ;; 16-bit Integer moves
 
@@ -989,63 +989,25 @@
 ;;
 ;;  ....................
 ;;
-;;	COMPARISONS
+;;	CONDITIONAL BRANCHES
 ;;
 ;;  ....................
 
-;; Flow here is rather complex:
-;;
-;;  1)	The cmp{si,di,sf,df} routine is called.  It deposits the
-;;	arguments into the branch_cmp array, and the type into
-;;	branch_type.  No RTL is generated.
-;;
-;;  2)	The appropriate branch define_expand is called, which then
-;;	creates the appropriate RTL for the comparison and branch.
-;;	Different CC modes are used, based on what type of branch is
-;;	done, so that we can constrain things appropriately.  There
-;;	are assumptions in the rest of GCC that break if we fold the
-;;	operands into the branches for integer operations, and use cc0
-;;	for floating point, so we use the fp status register instead.
-;;	If needed, an appropriate temporary is created to hold the
-;;	of the integer compare.
-
-(define_expand "cmpsi"
-  [(set (cc0)
-	(compare:CC (match_operand:SI 0 "register_operand" "")
-		    (match_operand:SI 1 "arith_operand" "")))]
+(define_expand "cbranchsi4"
+  [(set (pc)
+        (if_then_else
+         (match_operator:SI 0 "ordered_comparison_operator"
+                            [(match_operand:SI 1 "register_operand")
+                             (match_operand:SI 2 "reg_or_const_operand")])
+	 (label_ref (match_operand:SI 3 ""))
+	 (pc)))]
   ""
   "
 {
-  if (operands[0])		/* avoid unused code message */
-    {
-      branch_cmp[0] = operands[0];
-      branch_cmp[1] = operands[1];
-      branch_type = CMP_SI;
-      DONE;
-    }
+  gen_conditional_branch (operands, SImode);
+  DONE;
 }")
 
-(define_expand "tstsi"
-  [(set (cc0)
-	(match_operand:SI 0 "register_operand" ""))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code message */
-    {
-      branch_cmp[0] = operands[0];
-      branch_cmp[1] = const0_rtx;
-      branch_type = CMP_SI;
-      DONE;
-    }
-}")
-
-;;
-;;  ....................
-;;
-;;	CONDITIONAL BRANCHES
-;;
-;;  ....................
 
 ;; Conditional branches on comparisons with zero.
 
@@ -1135,166 +1097,6 @@
   [(set_attr "type"	"branch")
    (set_attr "mode"	"none")])
 
-(define_expand "beq"
-  [(set (pc)
-	(if_then_else (eq:CC (cc0)
-			     (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, EQ);
-      DONE;
-    }
-}")
-
-(define_expand "bne"
-  [(set (pc)
-	(if_then_else (ne:CC (cc0)
-			     (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, NE);
-      DONE;
-    }
-}")
-
-(define_expand "bgt"
-  [(set (pc)
-	(if_then_else (gt:CC (cc0)
-			     (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, GT);
-      DONE;
-    }
-}")
-
-(define_expand "bge"
-  [(set (pc)
-	(if_then_else (ge:CC (cc0)
-			     (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, GE);
-      DONE;
-    }
-}")
-
-(define_expand "blt"
-  [(set (pc)
-	(if_then_else (lt:CC (cc0)
-			     (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, LT);
-      DONE;
-    }
-}")
-
-(define_expand "ble"
-  [(set (pc)
-	(if_then_else (le:CC (cc0)
-			     (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, LE);
-      DONE;
-    }
-}")
-
-(define_expand "bgtu"
-  [(set (pc)
-	(if_then_else (gtu:CC (cc0)
-			      (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, GTU);
-      DONE;
-    }
-}")
-
-(define_expand "bgeu"
-  [(set (pc)
-	(if_then_else (geu:CC (cc0)
-			      (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, GEU);
-      DONE;
-    }
-}")
-
-
-(define_expand "bltu"
-  [(set (pc)
-	(if_then_else (ltu:CC (cc0)
-			      (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, LTU);
-      DONE;
-    }
-}")
-
-(define_expand "bleu"
-  [(set (pc)
-	(if_then_else (leu:CC (cc0)
-			      (const_int 0))
-		      (label_ref (match_operand 0 "" ""))
-		      (pc)))]
-  ""
-  "
-{
-  if (operands[0])		/* avoid unused code warning */
-    {
-      gen_conditional_branch (operands, LEU);
-      DONE;
-    }
-}")
 
 ;; Recognize bbi and bbin instructions.  These use two unusual template
 ;; patterns, %Ax and %Px.  %Ax outputs an 'i' if operand `x' is a LABEL_REF
@@ -1390,25 +1192,19 @@
 ;;
 ;;  ....................
 
-(define_expand "seq"
+(define_expand "cstoresi4"
   [(set (match_operand:SI 0 "register_operand" "=d")
-	(eq:SI (match_dup 1)
-	       (match_dup 2)))]
+	(match_operator:SI 1 "ordered_comparison_operator"
+	 [(match_operand:SI 2 "register_operand")
+	  (match_operand:SI 3 "reg_or_const_operand")]))]
   ""
   "
 {
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (EQ, operands[0], operands[1], operands[2], (int *)0);
+  gen_int_relational (GET_CODE (operands[1]), operands[0],
+		      operands[2], operands[3], (int *)0);
   DONE;
 }")
 
-
 (define_insn "seq_si_zero"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(eq:SI (match_operand:SI 1 "register_operand" "d")
@@ -1418,24 +1214,6 @@
   [(set_attr "type"	"arith")
    (set_attr "mode"	"SI")])
 
-(define_expand "sne"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(ne:SI (match_dup 1)
-	       (match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (NE, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "sne_si_zero"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(ne:SI (match_operand:SI 1 "register_operand" "d")
@@ -1445,24 +1223,6 @@
   [(set_attr "type"	"arith")
    (set_attr "mode"	"SI")])
 
-(define_expand "sgt"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(gt:SI (match_dup 1)
-	       (match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (GT, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "sgt_si"
   [(set (match_operand:SI 0 "register_operand" "=d,=d")
 	(gt:SI (match_operand:SI 1 "register_operand" "d,d")
@@ -1474,42 +1234,6 @@
   [(set_attr "type"	"arith,arith")
    (set_attr "mode"	"SI,SI")])
 
-(define_expand "sge"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(ge:SI (match_dup 1)
-	       (match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (GE, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
-(define_expand "slt"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(lt:SI (match_dup 1)
-	       (match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (LT, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "slt_si"
   [(set (match_operand:SI 0 "register_operand" "=d,=d")
 	(lt:SI (match_operand:SI 1 "register_operand" "d,d")
@@ -1521,24 +1245,6 @@
   [(set_attr "type"	"arith,arith")
    (set_attr "mode"	"SI,SI")])
 
-(define_expand "sle"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(le:SI (match_dup 1)
-	       (match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (LE, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "sle_si_const"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(le:SI (match_operand:SI 1 "register_operand" "d")
@@ -1552,24 +1258,6 @@
   [(set_attr "type"	"arith")
    (set_attr "mode"	"SI")])
 
-(define_expand "sgtu"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(gtu:SI (match_dup 1)
-		(match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (GTU, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "sgtu_si"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(gtu:SI (match_operand:SI 1 "register_operand" "d")
@@ -1588,42 +1276,6 @@
   [(set_attr "type"	"arith")
    (set_attr "mode"	"SI")])
 
-(define_expand "sgeu"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-        (geu:SI (match_dup 1)
-                (match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (GEU, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
-(define_expand "sltu"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(ltu:SI (match_dup 1)
-		(match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (LTU, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "sltu_si"
   [(set (match_operand:SI 0 "register_operand" "=d,=d")
 	(ltu:SI (match_operand:SI 1 "register_operand" "d,d")
@@ -1635,24 +1287,6 @@
   [(set_attr "type"	"arith,arith")
    (set_attr "mode"	"SI,SI")])
 
-(define_expand "sleu"
-  [(set (match_operand:SI 0 "register_operand" "=d")
-	(leu:SI (match_dup 1)
-		(match_dup 2)))]
-  ""
-  "
-{
-  if (branch_type != CMP_SI && (branch_type != CMP_DI))
-    FAIL;
-
-  /* Set up operands from compare.  */
-  operands[1] = branch_cmp[0];
-  operands[2] = branch_cmp[1];
-
-  gen_int_relational (LEU, operands[0], operands[1], operands[2], (int *)0);
-  DONE;
-}")
-
 (define_insn "sleu_si_const"
   [(set (match_operand:SI 0 "register_operand" "=d")
 	(leu:SI (match_operand:SI 1 "register_operand" "d")