From eb6e0f89020fbe1457af2af310cb6dd51f813f22 Mon Sep 17 00:00:00 2001 From: bonzini Date: Thu, 26 Jan 2006 18:45:29 +0000 Subject: [PATCH 1/1] 2006-01-26 Paolo Bonzini * config/i386/i386.md (extendsfdf2, extendsfxf2, extenddfxf2): Emit constants provided by 80387 instructions in the destination mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110264 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 23 ++++++++++++++--------- gcc/config/i386/i386.md | 34 +++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed19913d0d0..de6584822a4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2006-01-26 Paolo Bonzini + + * config/i386/i386.md (extendsfdf2, extendsfxf2, extenddfxf2): Emit + constants provided by 80387 instructions in the destination mode. + 2006-01-26 Richard Guenther Andrew Pinski @@ -19,7 +24,7 @@ (adjust_range_with_scev): Reject ranges from SCEV which are out of bounds for the type. -2005-01-26 Daniel Berlin +2006-01-26 Daniel Berlin * tree-ssa-alias.c (maybe_create_global_var): Change subvar walking to an assertion that we don't have subvar'd variables. @@ -572,7 +577,7 @@ mips-tdump.c (main), mips-tfile.c (main): Update copyright notice dates. -2005-01-21 Kenneth Zadeck +2006-01-21 Kenneth Zadeck * df-scan.c (problem_SCAN): Added NULL reset function. (df_scan_reset_blocks): Added code to call reset block function @@ -658,11 +663,11 @@ * c-common.c (empty_body_warning): Add (from c_finish_if_stmt). Now uses IS_EMPTY_STMT() instead of special NOP markers. -2005-01-20 Paul Brook +2006-01-20 Paul Brook * Makefile.in (lang_checks): Keep going if mkdir fails. -2005-01-19 Kenneth Zadeck +2006-01-19 Kenneth Zadeck * df-scan.c (df_scan_free_bb_info): Added basic block parameter to be able to clean out basic block when not necessary. @@ -689,7 +694,7 @@ Fixed to properly delete information if df is unused before calling df_finish. -2005-01-19 Kenneth Zadeck +2006-01-19 Kenneth Zadeck PR rtl-optimization/25799 * df-problems.c (df_ru_confluence_n, df_rd_confluence_n): @@ -1878,7 +1883,7 @@ * gcc.h (lang_specific_spec_functions): Remove. * gccspec.c (lang_specific_spec_functions): Remove. -2005-01-16 Paolo Bonzini +2006-01-16 Paolo Bonzini * combine.c (record_value_for_reg): Invalidate registers if INSN is null. @@ -2132,7 +2137,7 @@ * rtlanal.c (find_reg_note): Assert insn is not null. -2005-01-11 Kenneth Zadeck +2006-01-11 Kenneth Zadeck * df-scan.c (df_hard_reg_init): Move declaration of i outside ifdef. @@ -2186,7 +2191,7 @@ * tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, create_bb): Likewise. -2005-01-11 Kenneth Zadeck +2006-01-11 Kenneth Zadeck * Makefile.in: Removed rotted odf.c entry. @@ -2282,7 +2287,7 @@ optimizations. * doc/tm.texi (Misc): Document TARGET_MIN_DIVISIONS_FOR_RECIP_MUL. -2005-01-11 Danny Berlin +2006-01-11 Danny Berlin Kenneth Zadeck * df.h (DF_SCAN, DF_RU, DF_RD, DF_LR, DF_UR, DF_UREC, DF_CHAIN, diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 0b1d153af38..39d542dd6ce 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]); }) -- 2.11.0