2 /* { dg-options "-O3" } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-require-effective-target ppc_cpu_supports_hw } */
6 #define NO_WARN_X86_INTRINSICS 1
8 #include "bmi2-check.h"
10 __attribute__((noinline
))
12 calc_bzhi_u64 (unsigned long long a
, int l
)
14 unsigned long long res
= a
;
16 for (i
= 0; i
< 64 - l
; ++i
)
17 res
&= ~(1LL << (63 - i
));
26 unsigned long long src
= 0xce7ace0ce7ace0ff;
27 unsigned long long res
, res_ref
;
29 for (i
= 0; i
< 5; ++i
) {
32 res_ref
= calc_bzhi_u64 (src
, i
* 2);
33 res
= _bzhi_u64 (src
, i
* 2);