| 1 |
/* { dg-do compile { target { { powerpc*-*-* } && { ! powerpc*-apple-darwin* } } } } */ |
| 2 |
/* { dg-require-effective-target powerpc_fprs } */ |
| 3 |
/* { dg-options "-O2 -mrecip -ffast-math -mdejagnu-cpu=power7" } */ |
| 4 |
/* { dg-final { scan-assembler-times "xsrsqrtedp\|frsqrte\ " 1 } } */ |
| 5 |
/* { dg-final { scan-assembler-times "xsmuldp\|fmul\ " 2 } } */ |
| 6 |
/* { dg-final { scan-assembler-times "xsnmsub.dp\|fnmsub\ " 2 } } */ |
| 7 |
/* { dg-final { scan-assembler-times "xsmadd.dp\|fmadd\ " 3 } } */ |
| 8 |
/* { dg-final { scan-assembler-times "xsrsqrtesp\|frsqrtes" 1 } } */ |
| 9 |
/* { dg-final { scan-assembler-times "xsmulsp\|fmuls" 2 } } */ |
| 10 |
/* { dg-final { scan-assembler-times "xsmadd.sp\|fmadds" 1 } } */ |
| 11 |
/* { dg-final { scan-assembler-times "xsnmsub.sp\|fnmsubs" 1 } } */ |
| 12 |
|
| 13 |
double |
| 14 |
rsqrt_d (double a) |
| 15 |
{ |
| 16 |
return 1.0 / __builtin_sqrt (a); |
| 17 |
} |
| 18 |
|
| 19 |
float |
| 20 |
rsqrt_f (float a) |
| 21 |
{ |
| 22 |
return 1.0f / __builtin_sqrtf (a); |
| 23 |
} |