2 /* { dg-options "-O3 -fno-inline" } */
3 /* { dg-require-effective-target lp64 } */
4 /* { dg-require-effective-target ppc_cpu_supports_hw } */
6 #define NO_WARN_X86_INTRINSICS 1
10 long long calc_bextr_u64 (unsigned long long src1
,
11 unsigned long long src2
)
14 unsigned char start
= (src2
& 0xff);
15 unsigned char len
= (int) ((src2
>> 8) & 0xff);
18 unsigned last
= (start
+len
) < 64 ? start
+len
: 64;
21 for (i
=start
; i
<last
; ++i
) {
22 res
|= (src1
& 1) << (i
-start
);
34 unsigned char start
, len
;
35 unsigned long long src1
= 0xfacec0ffeefacec0;
36 unsigned long long res
, res_ref
, src2
;
42 src2
= (start
& 0xff) | ((len
& 0xff) << 8);
44 res_ref
= calc_bextr_u64 (src1
, src2
);
45 res
= _bextr_u64 (src1
, start
, len
);