2 /* { dg-options "-O2 -mavx512bw" } */
3 /* { dg-require-effective-target avx512bw } */
6 #include "avx512f-helper.h"
8 #define SIZE (AVX512F_LEN / 8)
9 #include "avx512f-mask-type.h"
12 CALC (char *r
, char *s1
, char *s2
)
15 for (i
= 0; i
< SIZE
/16; i
++)
17 r
[16 * i
] = s1
[16 * i
+ 8];
18 r
[16 * i
+ 1] = s2
[16 * i
+ 8];
19 r
[16 * i
+ 2] = s1
[16 * i
+ 9];
20 r
[16 * i
+ 3] = s2
[16 * i
+ 9];
21 r
[16 * i
+ 4] = s1
[16 * i
+ 10];
22 r
[16 * i
+ 5] = s2
[16 * i
+ 10];
23 r
[16 * i
+ 6] = s1
[16 * i
+ 11];
24 r
[16 * i
+ 7] = s2
[16 * i
+ 11];
25 r
[16 * i
+ 8] = s1
[16 * i
+ 12];
26 r
[16 * i
+ 9] = s2
[16 * i
+ 12];
27 r
[16 * i
+ 10] = s1
[16 * i
+ 13];
28 r
[16 * i
+ 11] = s2
[16 * i
+ 13];
29 r
[16 * i
+ 12] = s1
[16 * i
+ 14];
30 r
[16 * i
+ 13] = s2
[16 * i
+ 14];
31 r
[16 * i
+ 14] = s1
[16 * i
+ 15];
32 r
[16 * i
+ 15] = s2
[16 * i
+ 15];
40 UNION_TYPE (AVX512F_LEN
, i_b
) res1
, res2
, res3
, src1
, src2
;
41 MASK_TYPE mask
= MASK_VALUE
;
45 for (i
= 0; i
< SIZE
; i
++)
47 src1
.a
[i
] = 34 * i
* sign
;
51 for (i
= 0; i
< SIZE
; i
++)
52 res2
.a
[i
] = DEFAULT_VALUE
;
54 res1
.x
= INTRINSIC (_unpackhi_epi8
) (src1
.x
, src2
.x
);
55 res2
.x
= INTRINSIC (_mask_unpackhi_epi8
) (res2
.x
, mask
, src1
.x
, src2
.x
);
56 res3
.x
= INTRINSIC (_maskz_unpackhi_epi8
) (mask
, src1
.x
, src2
.x
);
58 CALC (res_ref
, src1
.a
, src2
.a
);
60 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res1
, res_ref
))
63 MASK_MERGE (i_b
) (res_ref
, mask
, SIZE
);
64 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res2
, res_ref
))
67 MASK_ZERO (i_b
) (res_ref
, mask
, SIZE
);
68 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res3
, res_ref
))