Commit 5617c135 by Uros Bizjak

re PR target/36992 (Very stange code for _mm_move_epi64)

	PR target/36992
	* config/i386/sse.md (vec_concatv2di): Add Y2 constraint to
	alternative 0 of operand 1.
	(*vec_concatv2di_rex64_sse): Ditto.
	(*vec_concatv2di_rex64_sse4_1): Add x constraint to alternative 0
	of operand 1.
	(*sse2_storeq_rex64): Penalize allocation of "r" registers.
	* config/i386/mmx.md (*mov<mode>_internal_rex64): Penalize allocation
	of "Y2" registers to avoid SSE <-> MMX conversions for DImode moves.
	(*movv2sf_internal_rex64): Ditto.

testsuite/ChangeLog:

	PR target/36992
	* gcc.target/i386/pr36992-1.c: New test.
	* gcc.target/i386/pr36992-2.c: Ditto.

From-SVN: r138564
parent d6833cf9
2008-08-03 Uros Bizjak <ubizjak@gmail.com>
PR target/36992
* config/i386/sse.md (vec_concatv2di): Add Y2 constraint to
alternative 0 of operand 1.
(*vec_concatv2di_rex64_sse): Ditto.
(*vec_concatv2di_rex64_sse4_1): Add x constraint to alternative 0
of operand 1.
(*sse2_storeq_rex64): Penalize allocation of "r" registers.
* config/i386/mmx.md (*mov<mode>_internal_rex64): Penalize allocation
of "Y2" registers to avoid SSE <-> MMX conversions for DImode moves.
(*movv2sf_internal_rex64): Ditto.
2008-08-02 Richard Guenther <rguenther@suse.de> 2008-08-02 Richard Guenther <rguenther@suse.de>
PR target/35252 PR target/35252
...@@ -161,8 +174,7 @@ ...@@ -161,8 +174,7 @@
* dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried * dwarf2out.c (based_loc_descr): Check crtl->stack_realign_tried
for stack alignment. for stack alignment.
* function.h (rtl_data): Add stack_realign_tried. Update * function.h (rtl_data): Add stack_realign_tried. Update comments.
comments.
2008-07-31 Kaz Kojima <kkojima@gcc.gnu.org> 2008-07-31 Kaz Kojima <kkojima@gcc.gnu.org>
...@@ -203,8 +215,7 @@ ...@@ -203,8 +215,7 @@
* passes.c (init_optimization_passes): Always call * passes.c (init_optimization_passes): Always call
pass_early_warn_uninitialized. pass_early_warn_uninitialized.
* opts.c (decode_options): Do not warn about -Wuninitialized * opts.c (decode_options): Do not warn about -Wuninitialized at -O0.
at -O0.
* doc/invoke.texi (-Wuninitialized): Correct for enabling at -O0. * doc/invoke.texi (-Wuninitialized): Correct for enabling at -O0.
* doc/passes.texi (Warn for uninitialized variables): Adjust. * doc/passes.texi (Warn for uninitialized variables): Adjust.
...@@ -312,8 +323,7 @@ ...@@ -312,8 +323,7 @@
(TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and (TARGET_CALLS): Add TARGET_UPDATE_STACK_BOUNDARY and
TARGET_GET_DRAP_RTX. TARGET_GET_DRAP_RTX.
* target.h (gcc_target): Add update_stack_boundary and * target.h (gcc_target): Add update_stack_boundary and get_drap_rtx.
get_drap_rtx.
* tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace * tree-vectorizer.c (vect_can_force_dr_alignment_p): Replace
STACK_BOUNDARY with MAX_STACK_ALIGNMENT. STACK_BOUNDARY with MAX_STACK_ALIGNMENT.
...@@ -360,16 +370,14 @@ ...@@ -360,16 +370,14 @@
force_align_arg_pointer. force_align_arg_pointer.
(ix86_handle_cconv_attribute): Likewise. (ix86_handle_cconv_attribute): Likewise.
(ix86_function_regparm): Likewise. (ix86_function_regparm): Likewise.
(setup_incoming_varargs_64): Don't set stack_alignment_needed (setup_incoming_varargs_64): Don't set stack_alignment_needed here.
here.
(ix86_va_start): Replace virtual_incoming_args_rtx with (ix86_va_start): Replace virtual_incoming_args_rtx with
crtl->args.internal_arg_pointer. crtl->args.internal_arg_pointer.
(ix86_select_alt_pic_regnum): Check DRAP register. (ix86_select_alt_pic_regnum): Check DRAP register.
(ix86_save_reg): Replace force_align_arg_pointer with drap_reg. (ix86_save_reg): Replace force_align_arg_pointer with drap_reg.
(ix86_compute_frame_layout): Compute frame layout wrt stack (ix86_compute_frame_layout): Compute frame layout wrt stack
realignment. realignment.
(ix86_internal_arg_pointer): Just return (ix86_internal_arg_pointer): Just return virtual_incoming_args_rtx.
virtual_incoming_args_rtx.
(ix86_expand_prologue): Decide if stack realignment is needed (ix86_expand_prologue): Decide if stack realignment is needed
and generate prologue code accordingly. and generate prologue code accordingly.
(ix86_expand_epilogue): Generate epilogue code wrt stack (ix86_expand_epilogue): Generate epilogue code wrt stack
...@@ -522,8 +530,7 @@ ...@@ -522,8 +530,7 @@
2008-07-29 Richard Guenther <rguenther@suse.de> 2008-07-29 Richard Guenther <rguenther@suse.de>
* gimplify.c (gimplify_expr): Clear TREE_SIDE_EFFECTS for * gimplify.c (gimplify_expr): Clear TREE_SIDE_EFFECTS for OBJ_TYPE_REF.
OBJ_TYPE_REF.
2008-07-29 Jakub Jelinek <jakub@redhat.com> 2008-07-29 Jakub Jelinek <jakub@redhat.com>
...@@ -599,8 +606,7 @@ ...@@ -599,8 +606,7 @@
(insert_fake_stores): Remove. (insert_fake_stores): Remove.
(realify_fake_stores): Likewise. (realify_fake_stores): Likewise.
(execute_pre): Remove dead code. (execute_pre): Remove dead code.
* tree-ssa-structalias.c (get_constraint_for_1): Remove tcc_unary * tree-ssa-structalias.c (get_constraint_for_1): Remove tcc_unary case.
case.
(find_func_aliases): Deal with it here instead. (find_func_aliases): Deal with it here instead.
Re-enable gcc_unreachable call. Re-enable gcc_unreachable call.
...@@ -838,7 +844,8 @@ ...@@ -838,7 +844,8 @@
2008-07-25 Jan Hubicka <jh@suse.cz> 2008-07-25 Jan Hubicka <jh@suse.cz>
* cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on DECL_INLINE. * cgraph.c (cgraph_function_possibly_inlined_p): Do not rely on
DECL_INLINE.
* cgraphunit.c (record_cdtor_fn): Do not initialize DECL_INLINE * cgraphunit.c (record_cdtor_fn): Do not initialize DECL_INLINE
(cgraph_preserve_function_body_p): Do not rely on DECL_INLINE. (cgraph_preserve_function_body_p): Do not rely on DECL_INLINE.
* dojump.c (clear_pending_stack_adjust): Likewise. * dojump.c (clear_pending_stack_adjust): Likewise.
...@@ -985,8 +992,7 @@ ...@@ -985,8 +992,7 @@
* config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer * config/sh/sh.h (OPTIMIZATION_OPTIONS): Set flag_omit_frame_pointer
to 2 instead of -1. to 2 instead of -1.
(OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal (OVERRIDE_OPTIONS): Check if flag_omit_frame_pointer is equal to 2.
to 2.
2008-07-24 Kai Tietz <kai.tietz@onevision.com> 2008-07-24 Kai Tietz <kai.tietz@onevision.com>
...@@ -1351,15 +1357,13 @@ ...@@ -1351,15 +1357,13 @@
(optimize_args): New static vector to remember the optimization (optimize_args): New static vector to remember the optimization
arguments. arguments.
(parse_optimize_options): New function to set up the optimization (parse_optimize_options): New function to set up the optimization
arguments from either the optimize attribute or #pragma GCC arguments from either the optimize attribute or #pragma GCC optimize.
optimize.
* c-common.h (c_cpp_builtins_optimize_pragma): Add declaration. * c-common.h (c_cpp_builtins_optimize_pragma): Add declaration.
(builtin_define_std): Ditto. (builtin_define_std): Ditto.
* config.gcc (i[3467]86-*-*): Add i386-c.o to C/C++ languages. * config.gcc (i[3467]86-*-*): Add i386-c.o to C/C++ languages.
Add t-i386 Makefile fragment to add i386-c.o and i386.o Add t-i386 Makefile fragment to add i386-c.o and i386.o dependencies.
dependencies.
(x86_64-*-*): Ditto. (x86_64-*-*): Ditto.
* Makefile.in (TREE_H): Add options.h. * Makefile.in (TREE_H): Add options.h.
...@@ -1377,12 +1381,10 @@ ...@@ -1377,12 +1381,10 @@
(Save): Document Save option to create target specific options (Save): Document Save option to create target specific options
that can be saved/restored on a function specific context. that can be saved/restored on a function specific context.
* doc/c-tree.texi (DECL_FUNCTION_SPECIFIC_TARGET): Document new * doc/c-tree.texi (DECL_FUNCTION_SPECIFIC_TARGET): Document new macro.
macro.
(DECL_FUNCTION_SPECIFIC_OPTIMIZATION): Ditto. (DECL_FUNCTION_SPECIFIC_OPTIMIZATION): Ditto.
* doc/tm.texi (TARGET_VALID_OPTION_ATTRIBUTE_P): Document new * doc/tm.texi (TARGET_VALID_OPTION_ATTRIBUTE_P): Document new hook.
hook.
(TARGET_OPTION_SAVE): Ditto. (TARGET_OPTION_SAVE): Ditto.
(TARGET_OPTION_RESTORE): Ditto. (TARGET_OPTION_RESTORE): Ditto.
(TARGET_OPTION_PRINT): Ditto. (TARGET_OPTION_PRINT): Ditto.
...@@ -1396,8 +1398,7 @@ ...@@ -1396,8 +1398,7 @@
2008-07-23 Michael Meissner <gnu@the-meissners.org> 2008-07-23 Michael Meissner <gnu@the-meissners.org>
Karthik Kumar <karthikkumar@gmail.com> Karthik Kumar <karthikkumar@gmail.com>
* config/i386/i386.h (TARGET_ABM): Move switch into * config/i386/i386.h (TARGET_ABM): Move switch into ix86_isa_flags.
ix86_isa_flags.
(TARGET_POPCNT): Ditto. (TARGET_POPCNT): Ditto.
(TARGET_SAHF): Ditto. (TARGET_SAHF): Ditto.
(TARGET_AES): Ditto. (TARGET_AES): Ditto.
...@@ -1412,8 +1413,7 @@ ...@@ -1412,8 +1413,7 @@
(REGISTER_TARGET_PRAGMAS): Define, call ix86_register_pragmas. (REGISTER_TARGET_PRAGMAS): Define, call ix86_register_pragmas.
* config/i386/i386.opt (arch): New TargetSave field to define * config/i386/i386.opt (arch): New TargetSave field to define
fields that need to be saved for function specific option fields that need to be saved for function specific option support.
support.
(tune): Ditto. (tune): Ditto.
(fpmath): Ditto. (fpmath): Ditto.
(branch_cost): Ditto. (branch_cost): Ditto.
...@@ -1484,8 +1484,7 @@ ...@@ -1484,8 +1484,7 @@
(i386.o): Make dependencies mirror the include files used. (i386.o): Make dependencies mirror the include files used.
(i386-c.o): New file, add dependencies. (i386-c.o): New file, add dependencies.
* config/i386/i386-protos.h (override_options): Add bool * config/i386/i386-protos.h (override_options): Add bool argument.
argument.
(ix86_valid_option_attribute_tree): Add declaration. (ix86_valid_option_attribute_tree): Add declaration.
(ix86_target_macros): Ditto. (ix86_target_macros): Ditto.
(ix86_register_macros): Ditto. (ix86_register_macros): Ditto.
...@@ -1498,8 +1497,7 @@ ...@@ -1498,8 +1497,7 @@
masks for the tune variables. masks for the tune variables.
(ix86_arch_features): Move initialization of the target masks to (ix86_arch_features): Move initialization of the target masks to
initial_ix86_arch_features to allow functions to have different initial_ix86_arch_features to allow functions to have different
target options. Make type unsigned char, instead of unsigned target options. Make type unsigned char, instead of unsigned int.
int.
(initial_ix86_arch_features): New static vector to hold processor (initial_ix86_arch_features): New static vector to hold processor
masks for the arch variables. masks for the arch variables.
(enum ix86_function_specific_strings): New enum to describe the (enum ix86_function_specific_strings): New enum to describe the
...@@ -1509,8 +1507,7 @@ ...@@ -1509,8 +1507,7 @@
(ix86_debug_options): New function to print the current options in (ix86_debug_options): New function to print the current options in
the debugger. the debugger.
(ix86_function_specific_save): New function hook to save the (ix86_function_specific_save): New function hook to save the
function specific global variables in the cl_target_option function specific global variables in the cl_target_option structure.
structure.
(ix86_function_specific_restore): New function hook to restore the (ix86_function_specific_restore): New function hook to restore the
function specific variables from the cl_target_option structure to function specific variables from the cl_target_option structure to
the global variables. the global variables.
...@@ -1520,8 +1517,7 @@ ...@@ -1520,8 +1517,7 @@
attribute((option(...))) arguments. attribute((option(...))) arguments.
(ix86_valid_option_attribute_tree): New function that is common (ix86_valid_option_attribute_tree): New function that is common
code between attribute((option(...))) and #pragma GCC option code between attribute((option(...))) and #pragma GCC option
support that parses the options and returns a tree holding the support that parses the options and returns a tree holding the options.
options.
(ix86_valid_option_attribute_inner_p): New helper function for (ix86_valid_option_attribute_inner_p): New helper function for
ix86_valid_option_attribute_tree. ix86_valid_option_attribute_tree.
(ix86_can_inline_p): New function hook to decide if one function (ix86_can_inline_p): New function hook to decide if one function
...@@ -1548,8 +1544,7 @@ ...@@ -1548,8 +1544,7 @@
(struct ptt): Move to static file scope from override_options. (struct ptt): Move to static file scope from override_options.
(processor_target_table): Ditto. (processor_target_table): Ditto.
(cpu_names): Ditto. (cpu_names): Ditto.
(ix86_handle_option): Add support for options that are now isa (ix86_handle_option): Add support for options that are now isa options.
options.
(override_options): Add support for declaring functions that (override_options): Add support for declaring functions that
support different target options than were specified on the support different target options than were specified on the
command line. Move struct ptt, processor_target_table, cpu_names, command line. Move struct ptt, processor_target_table, cpu_names,
...@@ -16208,7 +16203,7 @@ ...@@ -16208,7 +16203,7 @@
(LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51' (LINK_SPEC, CRT_BINUTILS_SPECS, ASM_SPEC): Add 'avr31' and 'avr51'
architectures. architectures.
* config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES, * config/avr/t-avr (MULTILIB_OPTIONS, MULTILIB_DIRNAMES,
MULTILIB_MATCHES): (Ditto.). MULTILIB_MATCHES): Ditto.
2008-01-23 Richard Guenther <rguenther@suse.de> 2008-01-23 Richard Guenther <rguenther@suse.de>
......
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
(define_insn "*mov<mode>_internal_rex64" (define_insn "*mov<mode>_internal_rex64"
[(set (match_operand:MMXMODEI8 0 "nonimmediate_operand" [(set (match_operand:MMXMODEI8 0 "nonimmediate_operand"
"=rm,r,!?y,!?y ,m ,!y,Y2,x,x ,m,r,x") "=rm,r,!?y,!?y ,m ,!y,*Y2,x,x ,m,r,x")
(match_operand:MMXMODEI8 1 "vector_move_operand" (match_operand:MMXMODEI8 1 "vector_move_operand"
"Cr ,m,C ,!?ym,!?y,Y2,!y,C,xm,x,x,r"))] "Cr ,m,C ,!?ym,!?y,*Y2,!y,C,xm,x,x,r"))]
"TARGET_64BIT && TARGET_MMX "TARGET_64BIT && TARGET_MMX
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))" && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@ "@
...@@ -124,9 +124,9 @@ ...@@ -124,9 +124,9 @@
(define_insn "*movv2sf_internal_rex64" (define_insn "*movv2sf_internal_rex64"
[(set (match_operand:V2SF 0 "nonimmediate_operand" [(set (match_operand:V2SF 0 "nonimmediate_operand"
"=rm,r ,!?y,!?y ,m ,!y,Y2,x,x,x,m,r,x") "=rm,r ,!?y,!?y ,m ,!y,*Y2,x,x,x,m,r,x")
(match_operand:V2SF 1 "vector_move_operand" (match_operand:V2SF 1 "vector_move_operand"
"Cr ,m ,C ,!?ym,!y,Y2,!y,C,x,m,x,x,r"))] "Cr ,m ,C ,!?ym,!y,*Y2,!y,C,x,m,x,x,r"))]
"TARGET_64BIT && TARGET_MMX "TARGET_64BIT && TARGET_MMX
&& !(MEM_P (operands[0]) && MEM_P (operands[1]))" && !(MEM_P (operands[0]) && MEM_P (operands[1]))"
"@ "@
......
...@@ -4777,7 +4777,7 @@ ...@@ -4777,7 +4777,7 @@
"") "")
(define_insn "*sse2_storeq_rex64" (define_insn "*sse2_storeq_rex64"
[(set (match_operand:DI 0 "nonimmediate_operand" "=mx,r,r") [(set (match_operand:DI 0 "nonimmediate_operand" "=mx,*r,r")
(vec_select:DI (vec_select:DI
(match_operand:V2DI 1 "nonimmediate_operand" "x,Yi,o") (match_operand:V2DI 1 "nonimmediate_operand" "x,Yi,o")
(parallel [(const_int 0)])))] (parallel [(const_int 0)])))]
...@@ -4940,10 +4940,10 @@ ...@@ -4940,10 +4940,10 @@
(set_attr "mode" "TI,V4SF,V2SF")]) (set_attr "mode" "TI,V4SF,V2SF")])
(define_insn "vec_concatv2di" (define_insn "vec_concatv2di"
[(set (match_operand:V2DI 0 "register_operand" "=Y2,?Y2,Y2,x,x,x") [(set (match_operand:V2DI 0 "register_operand" "=Y2 ,?Y2,Y2,x,x,x")
(vec_concat:V2DI (vec_concat:V2DI
(match_operand:DI 1 "nonimmediate_operand" " m,*y ,0 ,0,0,m") (match_operand:DI 1 "nonimmediate_operand" " mY2,*y ,0 ,0,0,m")
(match_operand:DI 2 "vector_move_operand" " C, C,Y2,x,m,0")))] (match_operand:DI 2 "vector_move_operand" " C , C,Y2,x,m,0")))]
"!TARGET_64BIT && TARGET_SSE" "!TARGET_64BIT && TARGET_SSE"
"@ "@
movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1}
...@@ -4956,10 +4956,10 @@ ...@@ -4956,10 +4956,10 @@
(set_attr "mode" "TI,TI,TI,V4SF,V2SF,V2SF")]) (set_attr "mode" "TI,TI,TI,V4SF,V2SF,V2SF")])
(define_insn "*vec_concatv2di_rex64_sse4_1" (define_insn "*vec_concatv2di_rex64_sse4_1"
[(set (match_operand:V2DI 0 "register_operand" "=x,x,Yi,!x,x,x,x,x") [(set (match_operand:V2DI 0 "register_operand" "=x ,x ,Yi,!x,x,x,x,x")
(vec_concat:V2DI (vec_concat:V2DI
(match_operand:DI 1 "nonimmediate_operand" " 0,m,r ,*y,0,0,0,m") (match_operand:DI 1 "nonimmediate_operand" " 0 ,mx,r ,*y,0,0,0,m")
(match_operand:DI 2 "vector_move_operand" "rm,C,C ,C ,x,x,m,0")))] (match_operand:DI 2 "vector_move_operand" " rm,C ,C ,C ,x,x,m,0")))]
"TARGET_64BIT && TARGET_SSE4_1" "TARGET_64BIT && TARGET_SSE4_1"
"@ "@
pinsrq\t{$0x1, %2, %0|%0, %2, 0x1} pinsrq\t{$0x1, %2, %0|%0, %2, 0x1}
...@@ -4975,10 +4975,10 @@ ...@@ -4975,10 +4975,10 @@
(set_attr "mode" "TI,TI,TI,TI,TI,V4SF,V2SF,V2SF")]) (set_attr "mode" "TI,TI,TI,TI,TI,V4SF,V2SF,V2SF")])
(define_insn "*vec_concatv2di_rex64_sse" (define_insn "*vec_concatv2di_rex64_sse"
[(set (match_operand:V2DI 0 "register_operand" "=Y2,Yi,!Y2,Y2,x,x,x") [(set (match_operand:V2DI 0 "register_operand" "=Y2 ,Yi,!Y2,Y2,x,x,x")
(vec_concat:V2DI (vec_concat:V2DI
(match_operand:DI 1 "nonimmediate_operand" " m,r ,*y ,0 ,0,0,m") (match_operand:DI 1 "nonimmediate_operand" " mY2,r ,*y ,0 ,0,0,m")
(match_operand:DI 2 "vector_move_operand" " C,C ,C ,Y2,x,m,0")))] (match_operand:DI 2 "vector_move_operand" " C ,C ,C ,Y2,x,m,0")))]
"TARGET_64BIT && TARGET_SSE" "TARGET_64BIT && TARGET_SSE"
"@ "@
movq\t{%1, %0|%0, %1} movq\t{%1, %0|%0, %1}
......
2008-08-03 Uros Bizjak <ubizjak@gmail.com>
PR target/36992
* gcc.target/i386/pr36992-1.c: New test.
* gcc.target/i386/pr36992-2.c: Ditto.
2008-08-02 Richard Guenther <rguenther@suse.de> 2008-08-02 Richard Guenther <rguenther@suse.de>
PR target/35252 PR target/35252
......
/* { dg-do compile }
/* { dg-options "-O2 -msse2" } */
#include <emmintrin.h>
__m128i
test (__m128i b)
{
return _mm_move_epi64 (b);
}
/* { dg-final { scan-assembler-times "mov\[qd\]\[ \\t\]+.*%xmm" 1 } } */
/* { dg-do compile }
/* { dg-options "-O0 -msse2" } */
#include <emmintrin.h>
__m128i
test (__m128i b)
{
return _mm_move_epi64 (b);
}
/* { dg-final { scan-assembler-not "%mm" } } */
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