2 /* { dg-options "-O2 -mavx512bw -DAVX512BW" } */
3 /* { dg-require-effective-target avx512bw } */
5 #include "avx512f-helper.h"
7 #define SIZE (AVX512F_LEN / 16)
10 #include "avx512f-mask-type.h"
15 CALC (short *dst
, short *src1
, short *ind
, short *src2
)
19 for (i
= 0; i
< SIZE
; i
++)
21 unsigned long long offset
= ind
[i
] & (SIZE
- 1);
22 unsigned long long cond
= ind
[i
] & SIZE
;
24 dst
[i
] = cond
? src2
[offset
] : src1
[offset
];
32 UNION_TYPE (AVX512F_LEN
, i_w
) s1
, s2
, res
, ind
;
35 MASK_TYPE mask
= MASK_VALUE
;
37 for (i
= 0; i
< NUM
; i
++)
39 for (j
= 0; j
< SIZE
; j
++)
41 ind
.a
[j
] = DEFAULT_VALUE
;
42 s1
.a
[j
] = i
* 2 * j
+ 1;
45 res
.a
[j
] = DEFAULT_VALUE
;
48 CALC (res_ref
, s1
.a
, ind
.a
, s2
.a
);
51 INTRINSIC (_mask2_permutex2var_epi16
) (s1
.x
, ind
.x
, mask
,
54 MASK_MERGE (i_w
) (res_ref
, mask
, SIZE
);
55 if (UNION_CHECK (AVX512F_LEN
, i_w
) (res
, res_ref
))