+2012-11-16 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/i386/i386-protos.h (ix86_emit_mode_set): Add third argument.
+ * config/i386/i386.h (EMIT_MODE_SET): Update.
+ * config/i386/i386.c (ix86_avx_emit_vzeroupper): New function.
+ (ix86_emit_mode_set) <AVX_U128>: Call ix86_avx_emit_vzeroupper.
+
2012-11-16 Ganesh Gopalasubramanian <Ganesh.Gopalasubramanian@amd.com>
bdver3 Enablement
(case ${target}): Add bdver3.
* config/i386/i386.h (TARGET_BDVER3): New definition.
* config/i386/i386.md (define_attr "cpu"): Add bdver3.
- * config/i386/sse.md (sseshuf): New type attribute.
- * config/i386/athlon.md (sseshuf):Likewise.
- * config/i386/atom.md (sseshuf):Likewise.
- * config/i386/ppro.md (sseshuf):Likewise.
- * config/i386/bdver1.md (sseshuf):Likewise.
+ * config/i386/sse.md (sseshuf, sseshuf1): New type attributes.
+ * config/i386/athlon.md: Handle sseshuf attribute.
+ * config/i386/atom.md: Likewise.
+ * config/i386/ppro.md: Likewise.
+ * config/i386/bdver1.md: Likewise.
* config/i386/i386.opt (flag_dispatch_scheduler): Add bdver3.
* config/i386/i386-c.c (ix86_target_macros_internal): Add
bdver3 def_and_undef
(static const char *const cpu_names): Add bdver3 entry.
(software_prefetching_beneficial_p): Add bdver3.
(ix86_option_override_internal): Add bdver3 instruction sets.
- (ix86_option_override_internal): Remove XSAVEOPT for bdver1
- and bdver2.
+ (ix86_option_override_internal): Remove XSAVEOPT for bdver1 and bdver2.
(ix86_issue_rate): Add bdver3.
(ix86_adjust_cost): Add bdver3.
(enum target_cpu_default): Add TARGET_CPU_DEFAULT_bdver3.
* expmed.c (expand_shift_1): Don't strip non-integral SUBREGs.
- * configure.ac: Add check for assembler SPARC4 instruction
- support.
+ * configure.ac: Add check for assembler SPARC4 instruction support.
* configure: Rebuild.
* config.in: Add HAVE_AS_SPARC4 section.
* config/sparc/sparc.opt (mcbcond): New option.
* asan.c (report_error_func): Set DECL_IGNORED_P, don't touch
DECL_ASSEMBLER_NAME.
(asan_init_func): Likewise.
- (asan_finish_file): Use void * instead of __asan_global * as
- type of __asan_{,un}register_globals. Set DECL_IGNORED_P on
- the decls.
+ (asan_finish_file): Use void * instead of __asan_global * as type of
+ __asan_{,un}register_globals. Set DECL_IGNORED_P on the decls.
2012-11-15 Matthias Klose <doko@ubuntu.com>
extern int ix86_mode_after (int, int, rtx);
extern int ix86_mode_entry (int);
extern int ix86_mode_exit (int);
-extern void ix86_emit_mode_set (int, int);
+
+#ifdef HARD_CONST
+extern void ix86_emit_mode_set (int, int, HARD_REG_SET);
+#endif
extern void x86_order_regs_for_local_alloc (void);
extern void x86_function_profiler (FILE *, int);
emit_move_insn (new_mode, reg);
}
+/* Emit vzeroupper. */
+
+void
+ix86_avx_emit_vzeroupper (HARD_REG_SET regs_live)
+{
+ int i;
+
+ /* Cancel automatic vzeroupper insertion if there are
+ live call-saved SSE registers at the insertion point. */
+
+ for (i = FIRST_SSE_REG; i <= LAST_SSE_REG; i++)
+ if (TEST_HARD_REG_BIT (regs_live, i) && !call_used_regs[i])
+ return;
+
+ if (TARGET_64BIT)
+ for (i = FIRST_REX_SSE_REG; i <= LAST_REX_SSE_REG; i++)
+ if (TEST_HARD_REG_BIT (regs_live, i) && !call_used_regs[i])
+ return;
+
+ emit_insn (gen_avx_vzeroupper ());
+}
+
/* Generate one or more insns to set ENTITY to MODE. */
void
-ix86_emit_mode_set (int entity, int mode)
+ix86_emit_mode_set (int entity, int mode, HARD_REG_SET regs_live)
{
switch (entity)
{
case AVX_U128:
if (mode == AVX_U128_CLEAN)
- emit_insn (gen_avx_vzeroupper ());
+ ix86_avx_emit_vzeroupper (regs_live);
break;
case I387_TRUNC:
case I387_FLOOR: