2 /* { dg-options "-O2 -mavx512vbmi" } */
3 /* { dg-require-effective-target avx512vbmi } */
7 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 8)
10 #include "avx512f-mask-type.h"
13 CALC (char *r
, char *s1
, char *s2
)
18 for (i
= 0; i
< SIZE
/ sizeof (long long); i
++)
23 char a
[sizeof(long long)];
26 for (j
= 0; j
< sizeof (long long); j
++)
27 src
.a
[j
] = s2
[i
* sizeof (long long) + j
];
28 for (j
= 0; j
< sizeof (long long); j
++)
30 ctrl
= s1
[i
* sizeof (long long) + j
] & ((1 << sizeof (long long)) - 1);
31 r
[i
* sizeof (long long) + j
] = 0;
32 for (k
= 0; k
< 8; k
++)
34 r
[i
* sizeof (long long) + j
] |= ((src
.x
>> ((ctrl
+ k
) % (sizeof (long long) * 8))) & 1) << k
;
43 UNION_TYPE (AVX512F_LEN
, i_b
) src1
, src2
, dst1
, dst2
, dst3
;
46 MASK_TYPE mask
= MASK_VALUE
;
48 for (i
= 0; i
< SIZE
; i
++)
50 src1
.a
[i
] = 15 + 3467 * i
;
52 dst2
.a
[i
] = DEFAULT_VALUE
;
55 CALC (dst_ref
, src1
.a
, src2
.a
);
56 dst1
.x
= INTRINSIC (_multishift_epi64_epi8
) (src1
.x
, src2
.x
);
57 dst2
.x
= INTRINSIC (_mask_multishift_epi64_epi8
) (dst2
.x
, mask
, src1
.x
, src2
.x
);
58 dst3
.x
= INTRINSIC (_maskz_multishift_epi64_epi8
) (mask
, src1
.x
, src2
.x
);
60 if (UNION_CHECK (AVX512F_LEN
, i_b
) (dst1
, dst_ref
))
63 MASK_MERGE (i_b
) (dst_ref
, mask
, SIZE
);
64 if (UNION_CHECK (AVX512F_LEN
, i_b
) (dst2
, dst_ref
))
67 MASK_ZERO (i_b
) (dst_ref
, mask
, SIZE
);
68 if (UNION_CHECK (AVX512F_LEN
, i_b
) (dst3
, dst_ref
))