aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorStan Cox <coxs@gnu.org>1996-02-16 16:59:27 +0000
committerStan Cox <coxs@gnu.org>1996-02-16 16:59:27 +0000
commit0afeb08a70db2010b7c0fc5db09c1c5c454271d7 (patch)
treea9f1fb5c2fc04556f3890f115db0cce71246102f /gcc
parentb7237e6d0665c26eb8a85bcaba32e1a2b5992588 (diff)
downloadgcc-0afeb08a70db2010b7c0fc5db09c1c5c454271d7.zip
gcc-0afeb08a70db2010b7c0fc5db09c1c5c454271d7.tar.gz
gcc-0afeb08a70db2010b7c0fc5db09c1c5c454271d7.tar.bz2
(ix86_expand_binary_operator): Allow for operand1 of MINUS to be CONST_INT
From-SVN: r11289
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index aef0c8e..212c67b 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1560,6 +1560,14 @@ ix86_expand_binary_operator (code, mode, operands)
if (GET_CODE (operands[2]) == MEM)
operands[2] = force_reg (GET_MODE (operands[2]), operands[2]);
+
+ if (GET_CODE (operands[1]) == CONST_INT && code == MINUS)
+ {
+ rtx temp = gen_reg_rtx (GET_MODE (operands[0]));
+ emit_move_insn (temp, operands[1]);
+ operands[1] = temp;
+ return TRUE;
+ }
}
if (!ix86_binary_operator_ok (code, mode, operands))
@@ -1584,6 +1592,14 @@ ix86_expand_binary_operator (code, mode, operands)
modified = TRUE;
}
+ if (GET_CODE (operands[1]) == CONST_INT && code == MINUS)
+ {
+ rtx temp = gen_reg_rtx (GET_MODE (operands[0]));
+ emit_move_insn (temp, operands[1]);
+ operands[1] = temp;
+ return TRUE;
+ }
+
if (modified && !ix86_binary_operator_ok (code, mode, operands))
return FALSE;
}
@@ -1603,7 +1619,9 @@ ix86_binary_operator_ok (code, mode, operands)
enum machine_mode mode;
rtx operands[3];
{
- return TRUE;
+ return (GET_CODE (operands[1]) != MEM && GET_CODE (operands[2]) != MEM
+ && GET_CODE (operands[1]) != CONST_INT)
+ || GET_RTX_CLASS (code) == 'c';
}
/* Attempt to expand a unary operator. Make the expansion closer to the