aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wehle <john@feith.com>1998-06-18 19:13:01 -0600
committerJeff Law <law@gcc.gnu.org>1998-06-18 19:13:01 -0600
commitbbe8497f5ef17013e6bafb96d6666c536d8bdf2d (patch)
tree656beca7a13baff5b1d68111019eab7bd7251d40
parentb4d030e5b9aff5106a5da4c1d0749c6005ec72bc (diff)
downloadgcc-bbe8497f5ef17013e6bafb96d6666c536d8bdf2d.zip
gcc-bbe8497f5ef17013e6bafb96d6666c536d8bdf2d.tar.gz
gcc-bbe8497f5ef17013e6bafb96d6666c536d8bdf2d.tar.bz2
i386.md (movsfcc, [...]): Use emit_store_flag to support LT, LE, GE, and GT signed integer comparisons.
� * 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. From-SVN: r20574
-rw-r--r--gcc/config/i386/i386.md113
1 files changed, 73 insertions, 40 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index cb1a42a..e3dbea9 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -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);