2 /* { dg-options "-O2 -mavx512bw -DAVX512BW" } */
3 /* { dg-require-effective-target avx512bw } */
5 #include "avx512f-helper.h"
9 #define SIZE (AVX512F_LEN / 8)
10 #include "avx512f-mask-type.h"
15 CALC (char *src1
, char *src2
, char * dst
)
17 /* result for EVEX.U1.512 version consists from 4 result block, each of them
18 * has length of 128 bits. */
19 unsigned block_len
= 16;
20 unsigned double_block_len
= 32;
22 char buf
[double_block_len
];
26 for (bits
= 0; bits
< AVX512F_LEN
; bits
+= 128)
28 memcpy (&buf
[0], src2
+ shift
, block_len
);
29 memcpy (&buf
[block_len
], src1
+ shift
, block_len
);
31 for (i
= 0; i
< block_len
; i
++)
32 /* shift counts larger than 32 produces zero result. */
33 if (N
>= 32 || N
+ i
>= 32)
46 UNION_TYPE (AVX512F_LEN
, i_b
) s1
, s2
, res1
, res2
, res3
;
47 MASK_TYPE mask
= MASK_VALUE
;
51 for (i
= 0; i
< SIZE
; i
++)
55 res2
.a
[i
] = DEFAULT_VALUE
;
58 res1
.x
= INTRINSIC (_alignr_epi8
) (s1
.x
, s2
.x
, N
);
59 res2
.x
= INTRINSIC (_mask_alignr_epi8
) (res2
.x
, mask
, s1
.x
, s2
.x
, N
);
60 res3
.x
= INTRINSIC (_maskz_alignr_epi8
) (mask
, s1
.x
, s2
.x
, N
);
62 CALC (s1
.a
, s2
.a
, res_ref
);
64 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res1
, res_ref
))
67 MASK_MERGE (i_b
) (res_ref
, mask
, SIZE
);
68 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res2
, res_ref
))
71 MASK_ZERO (i_b
) (res_ref
, mask
, SIZE
);
72 if (UNION_CHECK (AVX512F_LEN
, i_b
) (res3
, res_ref
))