Debian Codegraph @

gcc/testsuite/gcc.target/riscv/zfa-fli-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv64imfd_zfa -mabi=lp64d" { target { rv64 } } } */
3 /* { dg-options "-march=rv32imfd_zfa -mabi=ilp32d" { target { rv32 } } } */
4 /* { dg-skip-if "" { *-*-* } {"-O0" "-O1" "-Os" "-Og" "-Oz"} } */
5
6 #ifndef __riscv_zfa
7 #error Feature macro not defined
8 #endif
9
10 double
11 foo_positive_d (double a)
12 {
13 /* Use 3 FLI FP constants. */
14 return (2.5 * a - 1.0) / 0.875;
15 }
16
17 float
18 foo_positive_s (float a)
19 {
20 return ((float) 2.5 * a - (float) 1.0) / (float) 0.875;
21 }
22
23 /* { dg-final { scan-assembler-times "fli\\.s\t" 3 } } */
24 /* { dg-final { scan-assembler-times "fli\\.d\t" 3 } } */