summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-26 10:34:57 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2010-09-26 10:34:57 +0000
commit560d7a8af0161e4b62ff67fbdb405e718088b485 (patch)
treeaf1efb121d330912159529c978a7aa440efabf8a
parentc2d1f768cb106b92fc77352e9469222277d96f87 (diff)
downloadgcc-560d7a8af0161e4b62ff67fbdb405e718088b485.tar.gz
* config/i386/i386.md (movmsk_df): New insn.
(signbitdf): Split out of signbit<mode>2. Generate movmsk_df sequence for TARGET_SSE_MATH. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164630 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog24
-rw-r--r--gcc/config/i386/i386.md59
2 files changed, 67 insertions, 16 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9678b50258c..9433f5a17cc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-26 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386.md (movmsk_df): New insn.
+ (signbitdf): Split out of signbit<mode>2. Generate movmsk_df
+ sequence for TARGET_SSE_MATH.
+
2010-09-26 Richard Sandiford <rdsandiford@googlemail.com>
* config/mips/mips.c (mips_builtin_decls): Declare.
@@ -82,8 +88,7 @@
const_value_known.
(cgraph_externally_visible_p): Use cgraph_used_from_object_file_p.
(function_and_variable_visibility): Set resolution for local vars
- and functions.
- use varpool_used_from_object_file_p.
+ and functions; use varpool_used_from_object_file_p.
* varasm.c (resolution_to_local_definition_p, resolution_local_p): New
static functions.
(default_binds_local_p_1): Use resolutoin info.
@@ -121,16 +126,17 @@
* tree.c (local_define_builtin): Handle ECF_LEAF.
(build_common_builtin_nodes): Set ECF_LEAF where needed.
* tree.h (ECF_LEAF): New.
- * ipa-reference.c (propagate_bits): For leaf calls propagate ever overwrittable
- and unavailable functions.
+ * ipa-reference.c (propagate_bits): For leaf calls propagate ever
+ overwrittable and unavailable functions.
(ipa_init): Put all_module_statics into optimization_summary_obstack.
(copy_global_bitmap): Do not copy all_module_statics.
(read_write_all_from_decl): Use cgraph_node argument; handle ECF_LEAF.
(propagate): Handle overwritable and unavailable leaf functions;
initialize global info for overwritable and unavailable leaf functions;
do not free all module statics.
- (ipa_reference_get_not_read_global, ipa_reference_get_not_written_global):
- leaf calls don't clobber local statics.
+ (ipa_reference_get_not_read_global,
+ ipa_reference_get_not_written_global): leaf calls don't clobber
+ local statics.
* calls.c (flags_from_decl_or_type): Handle leaf.
* tree-cfg.c (stmt_can_make_abnormal_goto): Leaf functions can't do
abnormal gotos.
@@ -138,9 +144,7 @@
2010-09-24 Basile Starynkevitch <basile@starynkevitch.net>
* gengtype.c: Reindented.
-
* gengtype.h: Reindented.
-
* gengtype-parse.c: Reindented.
2010-09-24 Jan Hubicka <jh@suse.cz>
@@ -203,11 +207,11 @@
2010-09-24 Iain Sandoe <iains@gcc.gnu.org>
Dominique Dhumieres <dominiq@lps.ens.fr>
-
+
PR bootstrap/45751
* gcc/config/darwin-driver.c (darwin_default_min_version):
Adjust size passed to memcpy in two places.
-
+
2010-09-24 Richard Guenther <rguenther@suse.de>
* c-decl.c (pop_scope): Always set file-scope DECL_CONTEXT.
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index fddacd53791..0d76acb0ad5 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -14980,18 +14980,65 @@
DONE;
})
-(define_expand "signbit<mode>2"
+(define_expand "signbitxf2"
[(use (match_operand:SI 0 "register_operand" ""))
- (use (match_operand:X87MODEF 1 "register_operand" ""))]
+ (use (match_operand:XF 1 "register_operand" ""))]
+ "TARGET_USE_FANCY_MATH_387"
+{
+ rtx scratch = gen_reg_rtx (HImode);
+
+ emit_insn (gen_fxamxf2_i387 (scratch, operands[1]));
+ emit_insn (gen_andsi3 (operands[0],
+ gen_lowpart (SImode, scratch), GEN_INT (0x200)));
+ DONE;
+})
+
+(define_insn "movmsk_df"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (unspec:SI
+ [(match_operand:DF 1 "register_operand" "x")]
+ UNSPEC_MOVMSK))]
+ "SSE_FLOAT_MODE_P (DFmode) && TARGET_SSE_MATH"
+ "%vmovmskpd\t{%1, %0|%0, %1}"
+ [(set_attr "type" "ssemov")
+ (set_attr "prefix" "maybe_vex")
+ (set_attr "mode" "DF")])
+
+;; Use movmskpd in SSE mode to avoid store forwarding stall
+;; for 32bit targets and movq+shrq sequence for 64bit targets.
+(define_expand "signbitdf2"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:DF 1 "register_operand" ""))]
"TARGET_USE_FANCY_MATH_387
- && !(SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH)"
+ || (SSE_FLOAT_MODE_P (DFmode) && TARGET_SSE_MATH)"
{
- rtx mask = GEN_INT (0x0200);
+ if (SSE_FLOAT_MODE_P (DFmode) && TARGET_SSE_MATH)
+ {
+ emit_insn (gen_movmsk_df (operands[0], operands[1]));
+ emit_insn (gen_andsi3 (operands[0], operands[0], const1_rtx));
+ }
+ else
+ {
+ rtx scratch = gen_reg_rtx (HImode);
+ emit_insn (gen_fxamdf2_i387 (scratch, operands[1]));
+ emit_insn (gen_andsi3 (operands[0],
+ gen_lowpart (SImode, scratch), GEN_INT (0x200)));
+ }
+ DONE;
+})
+
+(define_expand "signbitsf2"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SF 1 "register_operand" ""))]
+ "TARGET_USE_FANCY_MATH_387
+ && !(SSE_FLOAT_MODE_P (SFmode) && TARGET_SSE_MATH)"
+{
rtx scratch = gen_reg_rtx (HImode);
- emit_insn (gen_fxam<mode>2_i387 (scratch, operands[1]));
- emit_insn (gen_andsi3 (operands[0], gen_lowpart (SImode, scratch), mask));
+ emit_insn (gen_fxamsf2_i387 (scratch, operands[1]));
+ emit_insn (gen_andsi3 (operands[0],
+ gen_lowpart (SImode, scratch), GEN_INT (0x200)));
DONE;
})