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_mul_u32 (unsigned volatile a
, unsigned b
)
14 unsigned long long res
= 0;
16 for (i
= 0; i
< b
; ++i
)
22 __attribute__((noinline
))
23 unsigned calc_mulx_u32 (unsigned x
, unsigned y
, unsigned *res_h
)
25 return (unsigned) _mulx_u32 (x
, y
, res_h
);
32 unsigned a
= 0xce7ace0;
33 unsigned b
= 0xfacefff;
34 unsigned res_l
, res_h
;
35 unsigned long long res
, res_ref
;
37 for (i
= 0; i
< 5; ++i
) {
41 res_ref
= calc_mul_u32 (a
, b
);
42 res_l
= calc_mulx_u32 (a
, b
, &res_h
);
44 res
= ((unsigned long long) res_h
<< 32) | res_l
;