1 /* { dg-do run { target { bmi } } } */
2 /* { dg-require-effective-target bmi } */
3 /* { dg-options "-O2 -mbmi -fno-inline" } */
9 unsigned calc_bextr_u32 (unsigned src1
, unsigned src2
)
12 unsigned char start
= (src2
& 0xff);
13 unsigned char len
= (int) ((src2
>> 8) & 0xff);
16 unsigned last
= (start
+len
) < 32 ? start
+len
: 32;
19 for (i
=start
; i
<last
; ++i
) {
20 res
|= (src1
& 1) << (i
-start
);
32 unsigned char start
, len
;
33 unsigned src1
= 0xfacec0ff;
34 unsigned res
, res_ref
, src2
;
37 start
= (i
* 1983) % 32;
38 len
= i
+ (i
* 1983) % 32;
41 src2
= start
| (((unsigned)len
) << 8);
43 res_ref
= calc_bextr_u32 (src1
, src2
);
44 res
= __bextr_u32 (src1
, src2
);