Debian Codegraph @

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

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