===================================================================
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx" } */
+
+typedef double v2df __attribute__ ((vector_size (16)));
+typedef double v4df __attribute__ ((vector_size (32)));
+typedef double v4si __attribute__ ((vector_size (16)));
+typedef double v8si __attribute__ ((vector_size (32)));
+
+v4si
+avx_extract_v4si (v8si x)
+{
+ return *(v4si*)&x;
+}
+
+v2df
+avx_extract_v2df (v4df x __attribute((unused)), v4df y)
+{
+ return *(v2df*)&y;
+}
+
+/* { dg-final { scan-assembler-not "movdq" } } */
+/* { dg-final { scan-assembler-times "movapd" 1 } } */
Property changes on: gcc/testsuite/gcc.target/i386/pr53101.c
___________________________________________________________________
Added: svn:keywords
+ Author Date Id Revision URL
Added: svn:eol-style
+ native
===================================================================
@@ -4104,10 +4104,34 @@
emit_move_insn (operands[0], adjust_address (operands[1], SFmode, i*4));
DONE;
})
+;; This is how we receive accesses to the first half of a vector.
+(define_peephole2
+ [(set (match_operand:VI8F_256 3 "memory_operand")
+ (match_operand:VI8F_256 1 "register_operand"))
+ (set (match_operand:<ssehalfvecmode> 0 "register_operand")
+ (match_operand:<ssehalfvecmode> 2 "memory_operand"))]
+ "TARGET_AVX && rtx_equal_p (XEXP (operands[2], 0), XEXP (operands[3], 0))"
+ [(set (match_dup 0)
+ (vec_select:<ssehalfvecmode> (match_dup 1)
+ (parallel [(const_int 0) (const_int 1)])))]
+)
+
+(define_peephole2
+ [(set (match_operand:VI4F_256 3 "memory_operand")
+ (match_operand:VI4F_256 1 "register_operand"))
+ (set (match_operand:<ssehalfvecmode> 0 "register_operand")
+ (match_operand:<ssehalfvecmode> 2 "memory_operand"))]
+ "TARGET_AVX && rtx_equal_p (XEXP (operands[2], 0), XEXP (operands[3], 0))"
+ [(set (match_dup 0)
+ (vec_select:<ssehalfvecmode> (match_dup 1)
+ (parallel [(const_int 0) (const_int 1)
+ (const_int 2) (const_int 3)])))]
+)
+
(define_expand "avx_vextractf128<mode>"
[(match_operand:<ssehalfvecmode> 0 "nonimmediate_operand")
(match_operand:V_256 1 "register_operand")
(match_operand:SI 2 "const_0_to_1_operand")]
"TARGET_AVX"