Fix warning with -Wsign-compare -Wsystem-headers
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / ppc-pow.c
blob3636679fedcc8546704b6c6638ac26f75dcd0a96
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-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power6" } } */
8 /* { dg-options "-O2 -ffast-math -mcpu=power6 -mno-vsx -mno-altivec" } */
9 /* { dg-final { scan-assembler-times "fsqrt" 3 } } */
10 /* { dg-final { scan-assembler-times "fmul" 1 } } */
11 /* { dg-final { scan-assembler-times "bl?\[\\. \]+pow" 1 } } */
12 /* { dg-final { scan-assembler-times "bl?\[\\. \]+sqrt" 1 } } */
14 double
15 do_pow_0_75_default (double a)
17 return __builtin_pow (a, 0.75); /* should generate 2 fsqrts */
20 double
21 do_pow_0_5_default (double a)
23 return __builtin_pow (a, 0.5); /* should generate fsqrt */
26 #pragma GCC target "no-powerpc-gpopt,no-powerpc-gfxopt"
28 double
29 do_pow_0_75_nosqrt (double a)
31 return __builtin_pow (a, 0.75); /* should call pow */
34 double
35 do_pow_0_5_nosqrt (double a)
37 return __builtin_pow (a, 0.5); /* should call sqrt */
40 #pragma GCC reset_options