(define_expand "vec_setv2hi"
[(match_operand:V2HI 0 "register_operand")
(match_operand:HI 1 "register_operand")
- (match_operand 2 "vec_setm_operand")]
+ (match_operand 2 "vec_setm_sse41_operand")]
"TARGET_SSE2"
{
if (CONST_INT_P (operands[2]))
})
;; True for registers, or const_int_operand, used to vec_setm expander.
-(define_predicate "vec_setm_operand"
+(define_predicate "vec_setm_sse41_operand"
(ior (and (match_operand 0 "register_operand")
(match_test "TARGET_SSE4_1"))
(match_code "const_int")))
+(define_predicate "vec_setm_avx2_operand"
+ (ior (and (match_operand 0 "register_operand")
+ (match_test "TARGET_AVX2"))
+ (match_code "const_int")))
+
(define_predicate "vec_setm_mmx_operand"
(ior (and (match_operand 0 "register_operand")
(match_test "TARGET_SSE4_1")
(set_attr "mode" "DF")])
(define_expand "vec_set<mode>"
- [(match_operand:V 0 "register_operand")
+ [(match_operand:V_128 0 "register_operand")
(match_operand:<ssescalarmode> 1 "register_operand")
- (match_operand 2 "vec_setm_operand")]
+ (match_operand 2 "vec_setm_sse41_operand")]
"TARGET_SSE"
{
if (CONST_INT_P (operands[2]))
DONE;
})
+(define_expand "vec_set<mode>"
+ [(match_operand:V_256_512 0 "register_operand")
+ (match_operand:<ssescalarmode> 1 "register_operand")
+ (match_operand 2 "vec_setm_avx2_operand")]
+ "TARGET_AVX"
+{
+ if (CONST_INT_P (operands[2]))
+ ix86_expand_vector_set (false, operands[0], operands[1],
+ INTVAL (operands[2]));
+ else
+ ix86_expand_vector_set_var (operands[0], operands[1], operands[2]);
+ DONE;
+})
+
(define_insn_and_split "*vec_extractv4sf_0"
[(set (match_operand:SF 0 "nonimmediate_operand" "=v,m,f,r")
(vec_select:SF
--- /dev/null
+/* PR target/101424 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx" } */
+
+typedef int v4df __attribute__((vector_size(32)));
+
+int foo_v4df_b, foo_v4df_c;
+
+v4df
+__attribute__foo_v4df ()
+{
+ v4df a;
+ a[foo_v4df_c] = foo_v4df_b;
+ return a;
+}