2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 32)
10 #include "avx512f-mask-type.h"
14 CALC (UNION_TYPE (AVX512F_LEN
, i_d
) s1
, union128i_d s2
, int *res_ref
, int imm
)
16 memcpy (res_ref
, s1
.a
, SIZE
* sizeof (int));
17 memcpy (res_ref
+ imm
* 4, s2
.a
, 16);
23 UNION_TYPE (AVX512F_LEN
, i_d
) s1
, res1
, res2
, res3
;
28 MASK_TYPE mask
= 6 ^ (0xffd >> SIZE
);
30 for (j
= 0; j
< SIZE
; j
++)
33 res1
.a
[j
] = DEFAULT_VALUE
;
34 res2
.a
[j
] = DEFAULT_VALUE
;
35 res3
.a
[j
] = DEFAULT_VALUE
;
38 for (j
= 0; j
< 4; j
++)
41 res1
.x
= INTRINSIC (_inserti32x4
) (s1
.x
, s2
.x
, 1);
42 res2
.x
= INTRINSIC (_mask_inserti32x4
) (res2
.x
, mask
, s1
.x
, s2
.x
, 1);
43 res3
.x
= INTRINSIC (_maskz_inserti32x4
) (mask
, s1
.x
, s2
.x
, 1);
45 CALC (s1
, s2
, res_ref
, 1);
47 if (UNION_CHECK (AVX512F_LEN
, i_d
) (res1
, res_ref
))
50 MASK_MERGE (i_d
) (res_ref
, mask
, SIZE
);
52 if (UNION_CHECK (AVX512F_LEN
, i_d
) (res2
, res_ref
))
55 MASK_ZERO (i_d
) (res_ref
, mask
, SIZE
);
57 if (UNION_CHECK (AVX512F_LEN
, i_d
) (res3
, res_ref
))