Commit ff97910d by Vladimir Yakovlev Committed by Kirill Yukhin

i386-protos.h (emit_i387_cw_initialization): Deleted.

        * config/i386/i386-protos.h (emit_i387_cw_initialization): Deleted.
        (emit_vzero): Added prototype.
        (ix86_mode_entry): Likewise.
        (ix86_mode_exit): Likewise.
        (ix86_emit_mode_set): Likewise.

        * config/i386/i386.c (typedef struct block_info_def): Deleted.
        (define BLOCK_INFO): Deleted.
        (check_avx256_stores): Added checking for MEM_P.
        (move_or_delete_vzeroupper_2): Deleted.
        (move_or_delete_vzeroupper_1): Deleted.
        (move_or_delete_vzeroupper): Deleted.
        (ix86_maybe_emit_epilogue_vzeroupper): Deleted.
        (function_pass_avx256_p): Deleted.
        (ix86_function_ok_for_sibcall): Deleted disabling sibcall.
        (nit_cumulative_args): Deleted initialization of of avx256 fields of
        cfun->machine.
        (ix86_emit_restore_sse_regs_using_mov): Deleted vzeroupper generation.
        (ix86_expand_epilogue): Likewise.
        (ix86_avx_u128_mode_needed): New.
        (ix86_i387_mode_needed): Renamed ix86_mode_needed.
        (ix86_mode_needed): New.
        (ix86_avx_u128_mode_after): New.
        (ix86_mode_after): New.
        (ix86_avx_u128_mode_entry): New.
        (ix86_mode_entry): New.
        (ix86_avx_u128_mode_exit): New.
        (ix86_mode_exit): New.
        (ix86_emit_mode_set): New.
        (ix86_expand_call): Deleted vzeroupper generation.
        (ix86_split_call_vzeroupper): Deleted.
        (ix86_init_machine_status): Initialzed optimize_mode_switching.
        (ix86_expand_special_args_builtin): Changed.
        (ix86_reorg): Deleted a call of move_or_delete_vzeroupper.

        * config/i386/i386.h  (VALID_AVX256_REG_OR_OI_MODE): New.
        (AVX_U128): New.
        (avx_u128_state): New.
        (NUM_MODES_FOR_MODE_SWITCHING): Added AVX_U128_ANY.
        (MODE_AFTER): New.
        (MODE_ENTRY): New.
        (MODE_EXIT): New.
        (EMIT_MODE_SET): Changed.
        (machine_function): Deleted avx256 fields.

        * config/i386/i386.md (UNSPEC_CALL_NEEDS_VZEROUPPER): Deleted.
        (define_insn_and_split "*call_vzeroupper"): Deleted.
        (define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"): Deleted.
        (define_insn_and_split "*sibcall_vzeroupper"): Deleted.
        (define_insn_and_split "*call_pop_vzeroupper"): Deleted.
        (define_insn_and_split "*sibcall_pop_vzeroupper"): Deleted.
        (define_insn_and_split "*call_value_vzeroupper"): Deleted.
        (define_insn_and_split "*sibcall_value_vzeroupper"): Deleted.
        (define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"): Deleted.
        (define_insn_and_split "*call_value_pop_vzeroupper"): Deleted.
        (define_insn_and_split "*sibcall_value_pop_vzeroupper"): Deleted.
        (define_expand "return"): Deleted vzeroupper emitting.
        (define_expand "simple_return"): Deleted.

        * config/i386/predicates.md (vzeroupper_operation): New.

        * config/i386/sse.md (avx_vzeroupper): Changed.

testsuite/ChangeLog:
        * gcc.target/i386/avx-vzeroupper-5.c: Changed scan-assembler-times.
        * gcc.target/i386/avx-vzeroupper-8.c: Likewise.
        * gcc.target/i386/avx-vzeroupper-9.c: Likewise.
        * gcc.target/i386/avx-vzeroupper-10.c: Likewise.
        * gcc.target/i386/avx-vzeroupper-11.c: Likewise.
        * gcc.target/i386/avx-vzeroupper-12.c: Likewise.
        * gcc.target/i386/avx-vzeroupper-19.c: Likewis.
        * gcc.target/i386/avx-vzeroupper-27.c: New.

From-SVN: r193229
parent 3d6db7f8
2012-11-06 Vladimir Yakovlev <vladimir.b.yakovlev@intel.com>
* config/i386/i386-protos.h (emit_i387_cw_initialization): Deleted.
(emit_vzero): Added prototype.
(ix86_mode_entry): Likewise.
(ix86_mode_exit): Likewise.
(ix86_emit_mode_set): Likewise.
* config/i386/i386.c (typedef struct block_info_def): Deleted.
(define BLOCK_INFO): Deleted.
(check_avx256_stores): Added checking for MEM_P.
(move_or_delete_vzeroupper_2): Deleted.
(move_or_delete_vzeroupper_1): Deleted.
(move_or_delete_vzeroupper): Deleted.
(ix86_maybe_emit_epilogue_vzeroupper): Deleted.
(function_pass_avx256_p): Deleted.
(ix86_function_ok_for_sibcall): Deleted disabling sibcall.
(nit_cumulative_args): Deleted initialization of of avx256 fields of
cfun->machine.
(ix86_emit_restore_sse_regs_using_mov): Deleted vzeroupper generation.
(ix86_expand_epilogue): Likewise.
(ix86_avx_u128_mode_needed): New.
(ix86_i387_mode_needed): Renamed ix86_mode_needed.
(ix86_mode_needed): New.
(ix86_avx_u128_mode_after): New.
(ix86_mode_after): New.
(ix86_avx_u128_mode_entry): New.
(ix86_mode_entry): New.
(ix86_avx_u128_mode_exit): New.
(ix86_mode_exit): New.
(ix86_emit_mode_set): New.
(ix86_expand_call): Deleted vzeroupper generation.
(ix86_split_call_vzeroupper): Deleted.
(ix86_init_machine_status): Initialzed optimize_mode_switching.
(ix86_expand_special_args_builtin): Changed.
(ix86_reorg): Deleted a call of move_or_delete_vzeroupper.
* config/i386/i386.h (VALID_AVX256_REG_OR_OI_MODE): New.
(AVX_U128): New.
(avx_u128_state): New.
(NUM_MODES_FOR_MODE_SWITCHING): Added AVX_U128_ANY.
(MODE_AFTER): New.
(MODE_ENTRY): New.
(MODE_EXIT): New.
(EMIT_MODE_SET): Changed.
(machine_function): Deleted avx256 fields.
* config/i386/i386.md (UNSPEC_CALL_NEEDS_VZEROUPPER): Deleted.
(define_insn_and_split "*call_vzeroupper"): Deleted.
(define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"): Deleted.
(define_insn_and_split "*sibcall_vzeroupper"): Deleted.
(define_insn_and_split "*call_pop_vzeroupper"): Deleted.
(define_insn_and_split "*sibcall_pop_vzeroupper"): Deleted.
(define_insn_and_split "*call_value_vzeroupper"): Deleted.
(define_insn_and_split "*sibcall_value_vzeroupper"): Deleted.
(define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"): Deleted.
(define_insn_and_split "*call_value_pop_vzeroupper"): Deleted.
(define_insn_and_split "*sibcall_value_pop_vzeroupper"): Deleted.
(define_expand "return"): Deleted vzeroupper emitting.
(define_expand "simple_return"): Deleted.
* config/i386/predicates.md (vzeroupper_operation): New.
* config/i386/sse.md (avx_vzeroupper): Changed.
2012-11-06 Uros Bizjak <ubizjak@gmail.com> 2012-11-06 Uros Bizjak <ubizjak@gmail.com>
Kaz Kojima <kkojima@gcc.gnu.org> Kaz Kojima <kkojima@gcc.gnu.org>
...@@ -167,8 +167,13 @@ extern bool ix86_secondary_memory_needed (enum reg_class, enum reg_class, ...@@ -167,8 +167,13 @@ extern bool ix86_secondary_memory_needed (enum reg_class, enum reg_class,
enum machine_mode, int); enum machine_mode, int);
extern bool ix86_cannot_change_mode_class (enum machine_mode, extern bool ix86_cannot_change_mode_class (enum machine_mode,
enum machine_mode, enum reg_class); enum machine_mode, enum reg_class);
extern int ix86_mode_needed (int, rtx); extern int ix86_mode_needed (int, rtx);
extern void emit_i387_cw_initialization (int); 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);
extern void x86_order_regs_for_local_alloc (void); extern void x86_order_regs_for_local_alloc (void);
extern void x86_function_profiler (FILE *, int); extern void x86_function_profiler (FILE *, int);
extern void x86_emit_floatuns (rtx [2]); extern void x86_emit_floatuns (rtx [2]);
......
...@@ -1035,6 +1035,9 @@ enum target_cpu_default ...@@ -1035,6 +1035,9 @@ enum target_cpu_default
|| (MODE) == V4DImode || (MODE) == V2TImode || (MODE) == V8SFmode \ || (MODE) == V4DImode || (MODE) == V2TImode || (MODE) == V8SFmode \
|| (MODE) == V4DFmode) || (MODE) == V4DFmode)
#define VALID_AVX256_REG_OR_OI_MODE(MODE) \
(VALID_AVX256_REG_MODE (MODE) || (MODE) == OImode)
#define VALID_SSE2_REG_MODE(MODE) \ #define VALID_SSE2_REG_MODE(MODE) \
((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \ ((MODE) == V16QImode || (MODE) == V8HImode || (MODE) == V2DFmode \
|| (MODE) == V2DImode || (MODE) == DFmode) || (MODE) == V2DImode || (MODE) == DFmode)
...@@ -2141,7 +2144,8 @@ enum ix86_fpcmp_strategy { ...@@ -2141,7 +2144,8 @@ enum ix86_fpcmp_strategy {
enum ix86_entity enum ix86_entity
{ {
I387_TRUNC = 0, AVX_U128 = 0,
I387_TRUNC,
I387_FLOOR, I387_FLOOR,
I387_CEIL, I387_CEIL,
I387_MASK_PM, I387_MASK_PM,
...@@ -2160,6 +2164,13 @@ enum ix86_stack_slot ...@@ -2160,6 +2164,13 @@ enum ix86_stack_slot
MAX_386_STACK_LOCALS MAX_386_STACK_LOCALS
}; };
enum avx_u128_state
{
AVX_U128_CLEAN,
AVX_U128_DIRTY,
AVX_U128_ANY
};
/* Define this macro if the port needs extra instructions inserted /* Define this macro if the port needs extra instructions inserted
for mode switching in an optimizing compilation. */ for mode switching in an optimizing compilation. */
...@@ -2175,16 +2186,34 @@ enum ix86_stack_slot ...@@ -2175,16 +2186,34 @@ enum ix86_stack_slot
refer to the mode-switched entity in question. */ refer to the mode-switched entity in question. */
#define NUM_MODES_FOR_MODE_SWITCHING \ #define NUM_MODES_FOR_MODE_SWITCHING \
{ I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY } { AVX_U128_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY, I387_CW_ANY }
/* ENTITY is an integer specifying a mode-switched entity. If /* ENTITY is an integer specifying a mode-switched entity. If
`OPTIMIZE_MODE_SWITCHING' is defined, you must define this macro to `OPTIMIZE_MODE_SWITCHING' is defined, you must define this macro to
return an integer value not larger than the corresponding element return an integer value not larger than the corresponding element
in `NUM_MODES_FOR_MODE_SWITCHING', to denote the mode that ENTITY in `NUM_MODES_FOR_MODE_SWITCHING', to denote the mode that ENTITY
must be switched into prior to the execution of INSN. */ must be switched into prior to the execution of INSN. */
#define MODE_NEEDED(ENTITY, I) ix86_mode_needed ((ENTITY), (I)) #define MODE_NEEDED(ENTITY, I) ix86_mode_needed ((ENTITY), (I))
/* If this macro is defined, it is evaluated for every INSN during
mode switching. It determines the mode that an insn results in (if
different from the incoming mode). */
#define MODE_AFTER(ENTITY, MODE, I) ix86_mode_after ((ENTITY), (MODE), (I))
/* If this macro is defined, it is evaluated for every ENTITY that
needs mode switching. It should evaluate to an integer, which is
a mode that ENTITY is assumed to be switched to at function entry. */
#define MODE_ENTRY(ENTITY) ix86_mode_entry (ENTITY)
/* If this macro is defined, it is evaluated for every ENTITY that
needs mode switching. It should evaluate to an integer, which is
a mode that ENTITY is assumed to be switched to at function exit. */
#define MODE_EXIT(ENTITY) ix86_mode_exit (ENTITY)
/* This macro specifies the order in which modes for ENTITY are /* This macro specifies the order in which modes for ENTITY are
processed. 0 is the highest priority. */ processed. 0 is the highest priority. */
...@@ -2194,11 +2223,8 @@ enum ix86_stack_slot ...@@ -2194,11 +2223,8 @@ enum ix86_stack_slot
is the set of hard registers live at the point where the insn(s) is the set of hard registers live at the point where the insn(s)
are to be inserted. */ are to be inserted. */
#define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \ #define EMIT_MODE_SET(ENTITY, MODE, HARD_REGS_LIVE) \
((MODE) != I387_CW_ANY && (MODE) != I387_CW_UNINITIALIZED \ ix86_emit_mode_set ((ENTITY), (MODE))
? emit_i387_cw_initialization (MODE), 0 \
: 0)
/* Avoid renaming of stack registers, as doing so in combination with /* Avoid renaming of stack registers, as doing so in combination with
scheduling just increases amount of live registers at time and in scheduling just increases amount of live registers at time and in
...@@ -2299,21 +2325,6 @@ struct GTY(()) machine_function { ...@@ -2299,21 +2325,6 @@ struct GTY(()) machine_function {
stack below the return address. */ stack below the return address. */
BOOL_BITFIELD static_chain_on_stack : 1; BOOL_BITFIELD static_chain_on_stack : 1;
/* Nonzero if caller passes 256bit AVX modes. */
BOOL_BITFIELD caller_pass_avx256_p : 1;
/* Nonzero if caller returns 256bit AVX modes. */
BOOL_BITFIELD caller_return_avx256_p : 1;
/* Nonzero if the current callee passes 256bit AVX modes. */
BOOL_BITFIELD callee_pass_avx256_p : 1;
/* Nonzero if the current callee returns 256bit AVX modes. */
BOOL_BITFIELD callee_return_avx256_p : 1;
/* Nonzero if rescan vzerouppers in the current function is needed. */
BOOL_BITFIELD rescan_vzeroupper_p : 1;
/* During prologue/epilogue generation, the current frame state. /* During prologue/epilogue generation, the current frame state.
Otherwise, the frame state at the end of the prologue. */ Otherwise, the frame state at the end of the prologue. */
struct machine_frame_state fs; struct machine_frame_state fs;
......
...@@ -109,7 +109,6 @@ ...@@ -109,7 +109,6 @@
UNSPEC_TRUNC_NOOP UNSPEC_TRUNC_NOOP
UNSPEC_DIV_ALREADY_SPLIT UNSPEC_DIV_ALREADY_SPLIT
UNSPEC_MS_TO_SYSV_CALL UNSPEC_MS_TO_SYSV_CALL
UNSPEC_CALL_NEEDS_VZEROUPPER
UNSPEC_PAUSE UNSPEC_PAUSE
UNSPEC_LEA_ADDR UNSPEC_LEA_ADDR
UNSPEC_XBEGIN_ABORT UNSPEC_XBEGIN_ABORT
...@@ -11503,18 +11502,6 @@ ...@@ -11503,18 +11502,6 @@
DONE; DONE;
}) })
(define_insn_and_split "*call_vzeroupper"
[(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw"))
(match_operand 1))
(unspec [(match_operand 2 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && !SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
[(set_attr "type" "call")])
(define_insn "*call" (define_insn "*call"
[(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw")) [(call (mem:QI (match_operand:W 0 "call_insn_operand" "<c>zw"))
(match_operand 1))] (match_operand 1))]
...@@ -11522,31 +11509,6 @@ ...@@ -11522,31 +11509,6 @@
"* return ix86_output_call_insn (insn, operands[0]);" "* return ix86_output_call_insn (insn, operands[0]);"
[(set_attr "type" "call")]) [(set_attr "type" "call")])
(define_insn_and_split "*call_rex64_ms_sysv_vzeroupper"
[(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzw"))
(match_operand 1))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
(clobber (reg:TI XMM6_REG))
(clobber (reg:TI XMM7_REG))
(clobber (reg:TI XMM8_REG))
(clobber (reg:TI XMM9_REG))
(clobber (reg:TI XMM10_REG))
(clobber (reg:TI XMM11_REG))
(clobber (reg:TI XMM12_REG))
(clobber (reg:TI XMM13_REG))
(clobber (reg:TI XMM14_REG))
(clobber (reg:TI XMM15_REG))
(clobber (reg:DI SI_REG))
(clobber (reg:DI DI_REG))
(unspec [(match_operand 2 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
[(set_attr "type" "call")])
(define_insn "*call_rex64_ms_sysv" (define_insn "*call_rex64_ms_sysv"
[(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzw")) [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rzw"))
(match_operand 1)) (match_operand 1))
...@@ -11567,18 +11529,6 @@ ...@@ -11567,18 +11529,6 @@
"* return ix86_output_call_insn (insn, operands[0]);" "* return ix86_output_call_insn (insn, operands[0]);"
[(set_attr "type" "call")]) [(set_attr "type" "call")])
(define_insn_and_split "*sibcall_vzeroupper"
[(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz"))
(match_operand 1))
(unspec [(match_operand 2 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[2]); DONE;"
[(set_attr "type" "call")])
(define_insn "*sibcall" (define_insn "*sibcall"
[(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz")) [(call (mem:QI (match_operand:W 0 "sibcall_insn_operand" "Uz"))
(match_operand 1))] (match_operand 1))]
...@@ -11599,21 +11549,6 @@ ...@@ -11599,21 +11549,6 @@
DONE; DONE;
}) })
(define_insn_and_split "*call_pop_vzeroupper"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lzm"))
(match_operand 1))
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(match_operand:SI 2 "immediate_operand" "i")))
(unspec [(match_operand 3 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && !TARGET_64BIT && !SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
[(set_attr "type" "call")])
(define_insn "*call_pop" (define_insn "*call_pop"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lzm")) [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "lzm"))
(match_operand 1)) (match_operand 1))
...@@ -11624,21 +11559,6 @@ ...@@ -11624,21 +11559,6 @@
"* return ix86_output_call_insn (insn, operands[0]);" "* return ix86_output_call_insn (insn, operands[0]);"
[(set_attr "type" "call")]) [(set_attr "type" "call")])
(define_insn_and_split "*sibcall_pop_vzeroupper"
[(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "Uz"))
(match_operand 1))
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(match_operand:SI 2 "immediate_operand" "i")))
(unspec [(match_operand 3 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
[(set_attr "type" "call")])
(define_insn "*sibcall_pop" (define_insn "*sibcall_pop"
[(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "Uz")) [(call (mem:QI (match_operand:SI 0 "sibcall_insn_operand" "Uz"))
(match_operand 1)) (match_operand 1))
...@@ -11675,19 +11595,6 @@ ...@@ -11675,19 +11595,6 @@
DONE; DONE;
}) })
(define_insn_and_split "*call_value_vzeroupper"
[(set (match_operand 0)
(call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw"))
(match_operand 2)))
(unspec [(match_operand 3 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && !SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
[(set_attr "type" "callv")])
(define_insn "*call_value" (define_insn "*call_value"
[(set (match_operand 0) [(set (match_operand 0)
(call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw")) (call (mem:QI (match_operand:W 1 "call_insn_operand" "<c>zw"))
...@@ -11696,19 +11603,6 @@ ...@@ -11696,19 +11603,6 @@
"* return ix86_output_call_insn (insn, operands[1]);" "* return ix86_output_call_insn (insn, operands[1]);"
[(set_attr "type" "callv")]) [(set_attr "type" "callv")])
(define_insn_and_split "*sibcall_value_vzeroupper"
[(set (match_operand 0)
(call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz"))
(match_operand 2)))
(unspec [(match_operand 3 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
[(set_attr "type" "callv")])
(define_insn "*sibcall_value" (define_insn "*sibcall_value"
[(set (match_operand 0) [(set (match_operand 0)
(call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz")) (call (mem:QI (match_operand:W 1 "sibcall_insn_operand" "Uz"))
...@@ -11717,32 +11611,6 @@ ...@@ -11717,32 +11611,6 @@
"* return ix86_output_call_insn (insn, operands[1]);" "* return ix86_output_call_insn (insn, operands[1]);"
[(set_attr "type" "callv")]) [(set_attr "type" "callv")])
(define_insn_and_split "*call_value_rex64_ms_sysv_vzeroupper"
[(set (match_operand 0)
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzw"))
(match_operand 2)))
(unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL)
(clobber (reg:TI XMM6_REG))
(clobber (reg:TI XMM7_REG))
(clobber (reg:TI XMM8_REG))
(clobber (reg:TI XMM9_REG))
(clobber (reg:TI XMM10_REG))
(clobber (reg:TI XMM11_REG))
(clobber (reg:TI XMM12_REG))
(clobber (reg:TI XMM13_REG))
(clobber (reg:TI XMM14_REG))
(clobber (reg:TI XMM15_REG))
(clobber (reg:DI SI_REG))
(clobber (reg:DI DI_REG))
(unspec [(match_operand 3 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && TARGET_64BIT && !SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[3]); DONE;"
[(set_attr "type" "callv")])
(define_insn "*call_value_rex64_ms_sysv" (define_insn "*call_value_rex64_ms_sysv"
[(set (match_operand 0) [(set (match_operand 0)
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzw")) (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rzw"))
...@@ -11778,22 +11646,6 @@ ...@@ -11778,22 +11646,6 @@
DONE; DONE;
}) })
(define_insn_and_split "*call_value_pop_vzeroupper"
[(set (match_operand 0)
(call (mem:QI (match_operand:SI 1 "call_insn_operand" "lzm"))
(match_operand 2)))
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(match_operand:SI 3 "immediate_operand" "i")))
(unspec [(match_operand 4 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && !TARGET_64BIT && !SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
[(set_attr "type" "callv")])
(define_insn "*call_value_pop" (define_insn "*call_value_pop"
[(set (match_operand 0) [(set (match_operand 0)
(call (mem:QI (match_operand:SI 1 "call_insn_operand" "lzm")) (call (mem:QI (match_operand:SI 1 "call_insn_operand" "lzm"))
...@@ -11805,22 +11657,6 @@ ...@@ -11805,22 +11657,6 @@
"* return ix86_output_call_insn (insn, operands[1]);" "* return ix86_output_call_insn (insn, operands[1]);"
[(set_attr "type" "callv")]) [(set_attr "type" "callv")])
(define_insn_and_split "*sibcall_value_pop_vzeroupper"
[(set (match_operand 0)
(call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "Uz"))
(match_operand 2)))
(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG)
(match_operand:SI 3 "immediate_operand" "i")))
(unspec [(match_operand 4 "const_int_operand")]
UNSPEC_CALL_NEEDS_VZEROUPPER)]
"TARGET_VZEROUPPER && !TARGET_64BIT && SIBLING_CALL_P (insn)"
"#"
"&& reload_completed"
[(const_int 0)]
"ix86_split_call_vzeroupper (curr_insn, operands[4]); DONE;"
[(set_attr "type" "callv")])
(define_insn "*sibcall_value_pop" (define_insn "*sibcall_value_pop"
[(set (match_operand 0) [(set (match_operand 0)
(call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "Uz")) (call (mem:QI (match_operand:SI 1 "sibcall_insn_operand" "Uz"))
...@@ -11922,7 +11758,6 @@ ...@@ -11922,7 +11758,6 @@
[(simple_return)] [(simple_return)]
"ix86_can_use_return_insn_p ()" "ix86_can_use_return_insn_p ()"
{ {
ix86_maybe_emit_epilogue_vzeroupper ();
if (crtl->args.pops_args) if (crtl->args.pops_args)
{ {
rtx popc = GEN_INT (crtl->args.pops_args); rtx popc = GEN_INT (crtl->args.pops_args);
...@@ -11939,7 +11774,6 @@ ...@@ -11939,7 +11774,6 @@
[(simple_return)] [(simple_return)]
"!TARGET_SEH" "!TARGET_SEH"
{ {
ix86_maybe_emit_epilogue_vzeroupper ();
if (crtl->args.pops_args) if (crtl->args.pops_args)
{ {
rtx popc = GEN_INT (crtl->args.pops_args); rtx popc = GEN_INT (crtl->args.pops_args);
......
...@@ -1229,6 +1229,13 @@ ...@@ -1229,6 +1229,13 @@
return true; return true;
}) })
;; return true if OP is a vzeroupper operation.
(define_predicate "vzeroupper_operation"
(match_code "unspec_volatile")
{
return XINT (op, 1) == UNSPECV_VZEROUPPER;
})
;; Return true if OP is a parallel for a vbroadcast permute. ;; Return true if OP is a parallel for a vbroadcast permute.
(define_predicate "avx_vbroadcast_operand" (define_predicate "avx_vbroadcast_operand"
......
...@@ -10452,8 +10452,7 @@ ...@@ -10452,8 +10452,7 @@
;; Clear the upper 128bits of AVX registers, equivalent to a NOP ;; Clear the upper 128bits of AVX registers, equivalent to a NOP
;; if the upper 128bits are unused. ;; if the upper 128bits are unused.
(define_insn "avx_vzeroupper" (define_insn "avx_vzeroupper"
[(unspec_volatile [(match_operand 0 "const_int_operand")] [(unspec_volatile [(const_int 0)] UNSPECV_VZEROUPPER)]
UNSPECV_VZEROUPPER)]
"TARGET_AVX" "TARGET_AVX"
"vzeroupper" "vzeroupper"
[(set_attr "type" "sse") [(set_attr "type" "sse")
......
2012-11-06 Vladimir Yakovlev <vladimir.b.yakovlev@intel.com>
* gcc.target/i386/avx-vzeroupper-5.c: Changed scan-assembler-times.
* gcc.target/i386/avx-vzeroupper-8.c: Likewise.
* gcc.target/i386/avx-vzeroupper-9.c: Likewise.
* gcc.target/i386/avx-vzeroupper-10.c: Likewise.
* gcc.target/i386/avx-vzeroupper-11.c: Likewise.
* gcc.target/i386/avx-vzeroupper-12.c: Likewise.
* gcc.target/i386/avx-vzeroupper-19.c: Likewis.
* gcc.target/i386/avx-vzeroupper-27.c: New.
2012-11-06 Janus Weil <janus@gcc.gnu.org> 2012-11-06 Janus Weil <janus@gcc.gnu.org>
PR fortran/54917 PR fortran/54917
......
...@@ -14,4 +14,4 @@ foo () ...@@ -14,4 +14,4 @@ foo ()
_mm256_zeroupper (); _mm256_zeroupper ();
} }
/* { dg-final { scan-assembler-not "avx_vzeroupper" } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 3 } } */
...@@ -16,4 +16,4 @@ foo () ...@@ -16,4 +16,4 @@ foo ()
} }
/* { dg-final { scan-assembler-times "\\*avx_vzeroall" 1 } } */ /* { dg-final { scan-assembler-times "\\*avx_vzeroall" 1 } } */
/* { dg-final { scan-assembler-not "avx_vzeroupper" } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 3 } } */
...@@ -16,5 +16,5 @@ foo () ...@@ -16,5 +16,5 @@ foo ()
_mm256_zeroupper (); _mm256_zeroupper ();
} }
/* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 4 } } */
/* { dg-final { scan-assembler-times "\\*avx_vzeroall" 1 } } */ /* { dg-final { scan-assembler-times "\\*avx_vzeroall" 1 } } */
...@@ -14,4 +14,4 @@ void feat_s3_cep_dcep (int cepsize_used, float **mfc, float **feat) ...@@ -14,4 +14,4 @@ void feat_s3_cep_dcep (int cepsize_used, float **mfc, float **feat)
f[i] = w[i] - _w[i]; f[i] = w[i] - _w[i];
} }
/* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 2 } } */
/* { dg-do compile } */
/* { dg-options "-O2 -mavx -mtune=generic -dp" } */
typedef struct objc_class *Class;
typedef struct objc_object
{
Class class_pointer;
} *id;
typedef const struct objc_selector *SEL;
typedef void * retval_t;
typedef void * arglist_t;
extern retval_t __objc_forward (id object, SEL sel, arglist_t args);
double
__objc_double_forward (id rcv, SEL op, ...)
{
void *args, *res;
args = __builtin_apply_args ();
res = __objc_forward (rcv, op, args);
__builtin_return (res);
}
/* { dg-final { scan-assembler-times "avx_vzeroupper" 2 } } */
...@@ -14,4 +14,4 @@ foo () ...@@ -14,4 +14,4 @@ foo ()
_mm256_zeroupper (); _mm256_zeroupper ();
} }
/* { dg-final { scan-assembler-not "avx_vzeroupper" } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */
...@@ -13,4 +13,4 @@ foo () ...@@ -13,4 +13,4 @@ foo ()
_mm256_zeroupper (); _mm256_zeroupper ();
} }
/* { dg-final { scan-assembler-not "avx_vzeroupper" } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */
...@@ -15,4 +15,4 @@ foo () ...@@ -15,4 +15,4 @@ foo ()
_mm256_zeroupper (); _mm256_zeroupper ();
} }
/* { dg-final { scan-assembler-times "avx_vzeroupper" 1 } } */ /* { dg-final { scan-assembler-times "avx_vzeroupper" 4 } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment