aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1996-04-16 17:43:09 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1996-04-16 17:43:09 -0400
commit70cff8f545f04281a8cf0e8d6ee604ee8026fe32 (patch)
treedc9445f7b32ab91c877bb846c684e92e8ba11fd4 /gcc
parent0500d6f9b27f4f499b7aa2256ebc35c1e3be57a2 (diff)
downloadgcc-70cff8f545f04281a8cf0e8d6ee604ee8026fe32.zip
gcc-70cff8f545f04281a8cf0e8d6ee604ee8026fe32.tar.gz
gcc-70cff8f545f04281a8cf0e8d6ee604ee8026fe32.tar.bz2
(addsidi3_2): Handle non-MEM overlap case.
From-SVN: r11829
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 7f6cd80..f307767 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -2764,6 +2764,36 @@
if (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
{
+ if (rtx_equal_p (low[0], operands[2]))
+ {
+ output_asm_insn (AS2 (mov%L0,%2,%0), high);
+ output_asm_insn (AS2 (add%L0,%1,%0), low);
+ output_asm_insn (AS2 (adc%L0,%1,%0), high);
+ RET;
+ }
+ if (rtx_equal_p (high[0], operands[2]))
+ {
+ if (GET_CODE (operands[0]) != MEM)
+ {
+ output_asm_insn (AS2 (mov%L0,%2,%0), low);
+ output_asm_insn (AS2 (mov%L0,%2,%0), high);
+ output_asm_insn (AS2 (add%L0,%1,%0), low);
+ output_asm_insn (AS2 (adc%L0,%1,%0), high);
+ }
+ else
+ {
+ /* It's too late to ask for a scratch now - but this
+ will probably not happen too often. */
+ output_asm_insn (AS2 (add%L1,%2,%1), low);
+ output_asm_insn (AS2 (mov%L0,%1,%0), low);
+ output_asm_insn (AS2 (mov%L1,%2,%1), low);
+ output_asm_insn (AS2 (mov%L0,%2,%0), high);
+ output_asm_insn (AS2 (adc%L0,%1,%0), high);
+ output_asm_insn (AS2 (sub%L1,%0,%1), low);
+ output_asm_insn (AS1 (neg%L1,%1), low);
+ }
+ RET;
+ }
output_asm_insn (AS2 (mov%L1,%3,%1), xops);
output_asm_insn (AS2 (mov%L0,%2,%0), xops);
}