1 /* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */
2 /* { dg-require-effective-target powerpc_fprs } */
3 /* { dg-options "-O2 -mrecip -ffast-math -mcpu=power5" } */
4 /* { dg-final { scan-assembler-times "frsqrtes" 1 } } */
5 /* { dg-final { scan-assembler-times "fmsubs" 1 } } */
6 /* { dg-final { scan-assembler-times "fmuls" 6 } } */
7 /* { dg-final { scan-assembler-times "fnmsubs" 3 } } */
8 /* { dg-final { scan-assembler-times "fsqrt" 1 } } */
9 
10 /* power5 resqrte is not accurate enough, and should not be generated by
11    default for -mrecip.  */
12 double
rsqrt_d(double a)13 rsqrt_d (double a)
14 {
15   return 1.0 / __builtin_sqrt (a);
16 }
17 
18 float
rsqrt_f(float a)19 rsqrt_f (float a)
20 {
21   return 1.0f / __builtin_sqrtf (a);
22 }
23