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
,) s1
, union128 s2
, float *res_ref
, int imm
)
16 memcpy (res_ref
, s1
.a
, SIZE
* sizeof (float));
17 memcpy (res_ref
+ imm
* 4, s2
.a
, 16);
23 UNION_TYPE (AVX512F_LEN
,) s1
, res1
, res2
, res3
;
28 MASK_TYPE mask
= 6 ^ (0xffd >> SIZE
);
30 for (j
= 0; j
< SIZE
; j
++)
32 s1
.a
[j
] = j
* j
/ 10.2;
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
++)
39 s2
.a
[j
] = j
* j
* j
/ 2.03;
41 res1
.x
= INTRINSIC (_insertf32x4
) (s1
.x
, s2
.x
, 1);
42 res2
.x
= INTRINSIC (_mask_insertf32x4
) (res2
.x
, mask
, s1
.x
, s2
.x
, 1);
43 res3
.x
= INTRINSIC (_maskz_insertf32x4
) (mask
, s1
.x
, s2
.x
, 1);
45 CALC (s1
, s2
, res_ref
, 1);
47 if (UNION_CHECK (AVX512F_LEN
,) (res1
, res_ref
))
50 MASK_MERGE () (res_ref
, mask
, SIZE
);
52 if (UNION_CHECK (AVX512F_LEN
,) (res2
, res_ref
))
55 MASK_ZERO () (res_ref
, mask
, SIZE
);
57 if (UNION_CHECK (AVX512F_LEN
,) (res3
, res_ref
))