1 /* { dg-do run { target { bmi2 && { ia32 } } } } */
2 /* { dg-options "-mbmi2 -O2" } */
4 #include "bmi2-check.h"
6 __attribute__((noinline
))
8 calc_mul_u32 (unsigned volatile a
, unsigned b
)
10 unsigned long long res
= 0;
12 for (i
= 0; i
< b
; ++i
)
18 __attribute__((noinline
, regparm (2)))
20 gen_mulx (unsigned a
, unsigned b
)
22 unsigned long long res
;
24 res
= (unsigned long long)a
* b
;
33 unsigned a
= 0xce7ace0;
34 unsigned b
= 0xfacefff;
35 unsigned long long res
, res_ref
;
37 for (i
= 0; i
< 5; ++i
) {
41 res_ref
= calc_mul_u32 (a
, b
);
42 res
= gen_mulx (a
, b
);