Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/vector/lsx/lsx-sqrtf.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ffast-math -mrecip -mlsx -mfrecipe -fno-unsafe-math-optimizations" } */
3 /* { dg-final { scan-assembler-times "vfsqrt.s" 3 } } */
4 /* { dg-final { scan-assembler-not "vfrsqrte.s" } } */
5
6 float a[4], b[4], c[4];
7
8 extern float sqrtf (float);
9
10 void
11 foo1 (void)
12 {
13 for (int i = 0; i < 4; i++)
14 c[i] = a[i] / sqrtf (b[i]);
15 }
16
17 void
18 foo2 (void)
19 {
20 for (int i = 0; i < 4; i++)
21 c[i] = sqrtf (a[i] / b[i]);
22 }
23
24 void
25 foo3 (void)
26 {
27 for (int i = 0; i < 4; i++)
28 c[i] = sqrtf (a[i]);
29 }