gcc/testsuite/gcc.target/loongarch/sqrtf.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O2 -ffast-math -mrecip -mfrecipe -fno-unsafe-math-optimizations" } */ |
| 3 | /* { dg-final { scan-assembler-times "fsqrt.s" 3 } } */ |
| 4 | /* { dg-final { scan-assembler-not "frsqrte.s" } } */ |
| 5 | |
| 6 | extern float sqrtf (float); |
| 7 | |
| 8 | float |
| 9 | foo1 (float a, float b) |
| 10 | { |
| 11 | return a/sqrtf(b); |
| 12 | } |
| 13 | |
| 14 | float |
| 15 | foo2 (float a, float b) |
| 16 | { |
| 17 | return sqrtf(a/b); |
| 18 | } |
| 19 | |
| 20 | float |
| 21 | foo3 (float a) |
| 22 | { |
| 23 | return sqrtf(a); |
| 24 | } |