Merged trunk at revision 161680 into branch.
[official-gcc.git] / gcc / testsuite / gcc.target / powerpc / recip-2.c
blob69442733aabb4fb5df06bf5321efb8704ae0ec9b
1 /* { dg-do compile { target { powerpc*-*-* } } } */
2 /* { dg-options "-O2 -mrecip -ffast-math -mcpu=power5" } */
3 /* { dg-final { scan-assembler-times "frsqrtes" 1 } } */
4 /* { dg-final { scan-assembler-times "fmsubs" 1 } } */
5 /* { dg-final { scan-assembler-times "fmuls" 6 } } */
6 /* { dg-final { scan-assembler-times "fnmsubs" 3 } } */
7 /* { dg-final { scan-assembler-times "fsqrt" 1 } } */
9 /* power5 resqrte is not accurate enough, and should not be generated by
10 default for -mrecip. */
11 double
12 rsqrt_d (double a)
14 return 1.0 / __builtin_sqrt (a);
17 float
18 rsqrt_f (float a)
20 return 1.0f / __builtin_sqrtf (a);