1 /* { dg-do compile } */
2 /* { dg-skip-if "" { powerpc*-*-darwin* } } */
3 /* Check for VSX here, even though we don't use VSX to eliminate SPE, PAIRED
4 and other ppc floating point varients. However, we need to also eliminate
5 Darwin, since it doesn't like -mcpu=power6. */
6 /* { dg-require-effective-target powerpc_vsx_ok } */
7 /* { dg-options "-O2 -ffast-math -mdejagnu-cpu=power6 -mno-vsx -mno-altivec" } */
8 /* { dg-final { scan-assembler-times "fsqrt" 3 } } */
9 /* { dg-final { scan-assembler-times "fmul" 1 } } */
10 /* { dg-final { scan-assembler-times "bl?\[\\. \]+pow" 1 } } */
11 /* { dg-final { scan-assembler-times "bl?\[\\. \]+sqrt" 1 } } */
14 do_pow_0_75_default (double a
)
16 return __builtin_pow (a
, 0.75); /* should generate 2 fsqrts */
20 do_pow_0_5_default (double a
)
22 return __builtin_pow (a
, 0.5); /* should generate fsqrt */
25 #pragma GCC target "no-powerpc-gpopt,no-powerpc-gfxopt"
28 do_pow_0_75_nosqrt (double a
)
30 return __builtin_pow (a
, 0.75); /* should call pow */
34 do_pow_0_5_nosqrt (double a
)
36 return __builtin_pow (a
, 0.5); /* should call sqrt */
39 #pragma GCC reset_options