2 /* { dg-options "-O2 -mavx512bitalg -mavx512f -mavx512bw" } */
3 /* { dg-require-effective-target avx512bitalg } */
6 #define SIZE (AVX512F_LEN / 8)
8 #include "avx512f-helper.h"
9 #include "avx512f-mask-type.h"
11 #define TYPE unsigned long long
16 unsigned char res
= 0;
17 for (int i
= 0; i
< 8; i
++)
19 unsigned char m
= (b
>> (64 - ((i
+1)*8))) & 0x3F;
20 unsigned char bit
= (a
>> m
) & 1;
21 res
|= (bit
<< (8 - i
- 1));
30 UNION_TYPE (AVX512F_LEN
, i_q
) src1
, src2
;
31 MASK_TYPE mask
= MASK_VALUE
;
35 src1
.x
= INTRINSIC (_set1_epi8
) (0x13);
36 src2
.x
= INTRINSIC (_set1_epi8
) (0x17);
41 for (int i
= 0; i
< SIZE
/8; i
++)
43 unsigned long long bit
= CALC (src1
.a
[i
], src2
.a
[i
]);
44 res_ref
|= ((unsigned long long)(CALC (src1
.a
[i
], src2
.a
[i
])) << (i
*8));
47 res1
= INTRINSIC (_bitshuffle_epi64_mask
) (src1
.x
, src2
.x
);
48 res2
= INTRINSIC (_mask_bitshuffle_epi64_mask
) (mask
, src1
.x
, src2
.x
);
53 for (int i
= 0; i
< SIZE
; i
++)
55 if (!((mask
>> i
) & 1))
56 res_ref
&= ~((unsigned long long)1 <<i
);