2 /* { dg-options "-O2 -mavx512vbmi" } */
3 /* { dg-require-effective-target avx512vbmi } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 8)
13 #include "avx512f-mask-type.h"
18 CALC (char *dst
, char *src1
, char *ind
, char *src2
)
22 for (i
= 0; i
< SIZE
; i
++)
24 unsigned long long offset
= ind
[i
] & (SIZE
- 1);
25 unsigned long long cond
= ind
[i
] & SIZE
;
27 dst
[i
] = cond
? src2
[offset
] : src1
[offset
];
35 UNION_TYPE (AVX512F_LEN
, i_b
) s1
, s2
, res
, ind
;
38 MASK_TYPE mask
= MASK_VALUE
;
40 for (i
= 0; i
< NUM
; i
++)
42 for (j
= 0; j
< SIZE
; j
++)
44 ind
.a
[j
] = DEFAULT_VALUE
;
45 s1
.a
[j
] = i
* 2 * j
+ 1;
48 res
.a
[j
] = DEFAULT_VALUE
;
51 CALC (res_ref
, s1
.a
, ind
.a
, s2
.a
);
54 INTRINSIC (_mask2_permutex2var_epi8
) (s1
.x
, ind
.x
, mask
,
57 MASK_MERGE (i_b
) (res_ref
, mask
, SIZE
);
58 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res
, res_ref
))