OSDN Git Service

authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jun 1998 01:13:01 +0000 (01:13 +0000)
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 19 Jun 1998 01:13:01 +0000 (01:13 +0000)
* i386.md (movsfcc, movdfcc, movxfcc): Use emit_store_flag
to support LT, LE, GE, and GT signed integer comparisons.
(movsfcc+1, movsfcc+2, movdfcc+1, movdfcc+2,
movxfcc+1, movxfcc+2): Pattern doesn't match if the comparison
is LT, LE, GE, or GT.
(movdicc): Remove code resulting from an earlier patch which
didn't apply correctly.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20574 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/i386/i386.md

index cb1a42a..e3dbea9 100644 (file)
@@ -7368,12 +7368,36 @@ byte_xor_operation:
   "TARGET_CMOVE"
   "
 {
+  rtx temp;
+
   if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
     FAIL;
 
-  operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+  /* The floating point conditional move instructions don't directly
+     support conditions resulting from a signed integer comparison. */
+
+  switch (GET_CODE (operands[1]))
+    {
+    case LT:
+    case LE:
+    case GE:
+    case GT:
+      temp = emit_store_flag (gen_reg_rtx (QImode),
+               GET_CODE (operands[1]), i386_compare_op0, i386_compare_op1,
+               VOIDmode, 0, 0);
+
+      if (!temp)
+        FAIL;
+
+      operands[1] = gen_rtx_fmt_ee (NE, QImode, temp, const0_rtx);
+      break;
+
+    default:
+      operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
                        GET_MODE (i386_compare_op0),
                        i386_compare_op0, i386_compare_op1);
+      break;
+    }
 }")
 
 (define_insn ""
@@ -7383,7 +7407,9 @@ byte_xor_operation:
                (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
              (match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
              (match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
-  "TARGET_CMOVE"
+  "TARGET_CMOVE
+    && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+    && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
   "#")
 
 (define_insn ""
@@ -7393,7 +7419,9 @@ byte_xor_operation:
                 (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
              (match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
              (match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
-  "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
+  "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT
+    && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+    && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
   "#")
 
 (define_split
@@ -7442,11 +7470,13 @@ byte_xor_operation:
   "TARGET_CMOVE"
   "
 {
+  rtx temp;
+
   if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
     FAIL;
 
-  /* The floating point conditional move instructions don't support
-     signed integer comparisons. */
+  /* The floating point conditional move instructions don't directly
+     support conditions resulting from a signed integer comparison. */
 
   switch (GET_CODE (operands[1]))
     {
@@ -7454,17 +7484,22 @@ byte_xor_operation:
     case LE:
     case GE:
     case GT:
-      FAIL;
-    /* NOTREACHED */
-      break;
+      temp = emit_store_flag (gen_reg_rtx (QImode),
+               GET_CODE (operands[1]), i386_compare_op0, i386_compare_op1,
+               VOIDmode, 0, 0);
 
-    default:
+      if (!temp)
+        FAIL;
+
+      operands[1] = gen_rtx_fmt_ee (NE, QImode, temp, const0_rtx);
       break;
-    }
 
-  operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+    default:
+      operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
                        GET_MODE (i386_compare_op0),
                        i386_compare_op0, i386_compare_op1);
+      break;
+    }
 }")
 
 (define_insn ""
@@ -7474,7 +7509,9 @@ byte_xor_operation:
                (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
              (match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
              (match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
-  "TARGET_CMOVE"
+  "TARGET_CMOVE
+    && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+    && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
   "#")
 
 (define_insn ""
@@ -7484,7 +7521,9 @@ byte_xor_operation:
                (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
              (match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
              (match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
-  "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
+  "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT
+    && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+    && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
   "#")
 
 (define_split
@@ -7533,11 +7572,13 @@ byte_xor_operation:
   "TARGET_CMOVE"
   "
 {
+  rtx temp;
+
   if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
     FAIL;
 
-  /* The floating point conditional move instructions don't support
-     signed integer comparisons. */
+  /* The floating point conditional move instructions don't directly
+     support conditions resulting from a signed integer comparison. */
 
   switch (GET_CODE (operands[1]))
     {
@@ -7545,17 +7586,22 @@ byte_xor_operation:
     case LE:
     case GE:
     case GT:
-      FAIL;
-    /* NOTREACHED */
-      break;
+      temp = emit_store_flag (gen_reg_rtx (QImode),
+               GET_CODE (operands[1]), i386_compare_op0, i386_compare_op1,
+               VOIDmode, 0, 0);
 
-    default:
+      if (!temp)
+        FAIL;
+
+      operands[1] = gen_rtx_fmt_ee (NE, QImode, temp, const0_rtx);
       break;
-    }
 
-  operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
+    default:
+      operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
                        GET_MODE (i386_compare_op0),
                        i386_compare_op0, i386_compare_op1);
+      break;
+    }
 }")
 
 (define_insn ""
@@ -7565,7 +7611,9 @@ byte_xor_operation:
                (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
              (match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
              (match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
-  "TARGET_CMOVE"
+  "TARGET_CMOVE
+    && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+    && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
   "#")
 
 (define_insn ""
@@ -7575,7 +7623,9 @@ byte_xor_operation:
                (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
              (match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
              (match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
-  "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
+  "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT
+    && GET_CODE (operands[1]) != LT && GET_CODE (operands[1]) != LE
+    && GET_CODE (operands[1]) != GE && GET_CODE (operands[1]) != GT"
   "#")
 
 (define_split
@@ -7627,23 +7677,6 @@ byte_xor_operation:
   if (GET_MODE_CLASS (GET_MODE (i386_compare_op0)) != MODE_INT)
     FAIL;
 
-  /* The floating point conditional move instructions don't support
-     signed integer comparisons. */
-
-  switch (GET_CODE (operands[1]))
-    {
-    case LT:
-    case LE:
-    case GE:
-    case GT:
-      FAIL;
-    /* NOTREACHED */
-      break;
-
-    default:
-      break;
-    }
-
   operands[1] = gen_rtx_fmt_ee (GET_CODE (operands[1]),
                        GET_MODE (i386_compare_op0),
                        i386_compare_op0, i386_compare_op1);