2 /* { dg-options "-O2 -mavx512f" } */
3 /* { dg-require-effective-target avx512f } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 64)
10 #include "avx512f-mask-type.h"
15 CALC (long long *dst
, long long *src1
, long long *ind
, long long *src2
)
19 for (i
= 0; i
< SIZE
; i
++)
21 unsigned long long offset
= ind
[i
] & (SIZE
- 1);
22 unsigned long long cond
= ind
[i
] & SIZE
;
24 dst
[i
] = cond
? src2
[offset
] : src1
[offset
];
32 UNION_TYPE (AVX512F_LEN
, i_q
) s1
, s2
, res
, ind
;
33 long long res_ref
[SIZE
];
35 MASK_TYPE mask
= MASK_VALUE
;
37 for (i
= 0; i
< SIZE
; i
++)
39 ind
.a
[i
] = DEFAULT_VALUE
;
43 res
.a
[i
] = DEFAULT_VALUE
;
46 CALC (res_ref
, s1
.a
, ind
.a
, s2
.a
);
49 INTRINSIC (_mask2_permutex2var_epi64
) (s1
.x
, ind
.x
, mask
, s2
.x
);
51 MASK_MERGE (i_q
) (res_ref
, mask
, SIZE
);
52 if (UNION_CHECK (AVX512F_LEN
, i_q
) (res
, res_ref
))