1 /* { dg-do run { target { bmi && { ! ia32 } } } } */
2 /* { dg-options "-O2 -mbmi -fno-inline" } */
8 long long calc_bextr_u64 (unsigned long long src1
,
9 unsigned long long src2
)
12 unsigned char start
= (src2
& 0xff);
13 unsigned char len
= (int) ((src2
>> 8) & 0xff);
16 unsigned last
= (start
+len
) < 64 ? start
+len
: 64;
19 for (i
=start
; i
<last
; ++i
) {
20 res
|= (src1
& 1) << (i
-start
);
32 unsigned char start
, len
;
33 unsigned long long src1
= 0xfacec0ffeefacec0;
34 unsigned long long res
, res_ref
, src2
;
40 src2
= (start
& 0xff) | ((len
& 0xff) << 8);
42 res_ref
= calc_bextr_u64 (src1
, src2
);
43 res
= _bextr_u64 (src1
, start
, len
);