aboutsummaryrefslogtreecommitdiff
path: root/gcc/config
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gcc.gnu.org>2006-01-26 18:45:29 +0000
committerPaolo Bonzini <bonzini@gcc.gnu.org>2006-01-26 18:45:29 +0000
commite046a30ab14ee10d1d4e0cbc179199c754192270 (patch)
treecfa409dff5d2ffc8ab53e2260242847a376668f5 /gcc/config
parent9cee8116904615365b56ebb8670cc7a6479595c4 (diff)
downloadgcc-e046a30ab14ee10d1d4e0cbc179199c754192270.zip
gcc-e046a30ab14ee10d1d4e0cbc179199c754192270.tar.gz
gcc-e046a30ab14ee10d1d4e0cbc179199c754192270.tar.bz2
i386.md (extendsfdf2, [...]): Emit constants provided by 80387 instructions in the destination mode.
2006-01-26 Paolo Bonzini <bonzini@gnu.org> * config/i386/i386.md (extendsfdf2, extendsfxf2, extenddfxf2): Emit constants provided by 80387 instructions in the destination mode. From-SVN: r110264
Diffstat (limited to 'gcc/config')
-rw-r--r--gcc/config/i386/i386.md34
1 files changed, 31 insertions, 3 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 0b1d153..39d542d 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -3521,7 +3521,17 @@
/* ??? Needed for compress_float_constant since all fp constants
are LEGITIMATE_CONSTANT_P. */
if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
+ {
+ if ((!TARGET_SSE2 || TARGET_MIX_SSE_I387)
+ && standard_80387_constant_p (operands[1]) > 0)
+ {
+ operands[1] = simplify_const_unary_operation
+ (FLOAT_EXTEND, DFmode, operands[1], SFmode);
+ emit_move_insn_1 (operands[0], operands[1]);
+ DONE;
+ }
+ operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
+ }
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
operands[1] = force_reg (SFmode, operands[1]);
})
@@ -3594,7 +3604,16 @@
/* ??? Needed for compress_float_constant since all fp constants
are LEGITIMATE_CONSTANT_P. */
if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
+ {
+ if (standard_80387_constant_p (operands[1]) > 0)
+ {
+ operands[1] = simplify_const_unary_operation
+ (FLOAT_EXTEND, XFmode, operands[1], SFmode);
+ emit_move_insn_1 (operands[0], operands[1]);
+ DONE;
+ }
+ operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
+ }
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
operands[1] = force_reg (SFmode, operands[1]);
})
@@ -3633,7 +3652,16 @@
/* ??? Needed for compress_float_constant since all fp constants
are LEGITIMATE_CONSTANT_P. */
if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1] = validize_mem (force_const_mem (DFmode, operands[1]));
+ {
+ if (standard_80387_constant_p (operands[1]) > 0)
+ {
+ operands[1] = simplify_const_unary_operation
+ (FLOAT_EXTEND, XFmode, operands[1], DFmode);
+ emit_move_insn_1 (operands[0], operands[1]);
+ DONE;
+ }
+ operands[1] = validize_mem (force_const_mem (DFmode, operands[1]));
+ }
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
operands[1] = force_reg (DFmode, operands[1]);
})