Debian Codegraph @

gcc/testsuite/gcc.target/riscv/zfa-fround.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=rv32imafdc_zfa -mabi=ilp32d" { target { rv32 } } } */
3 /* { dg-options "-march=rv64imafdc_zfa -mabi=lp64d" { target { rv64 } } } */
4
5 extern float a;
6 extern double b;
7
8 void foo (float *x, double *y)
9 {
10 {
11 *x = __builtin_roundf (a);
12 *y = __builtin_round (b);
13 }
14 {
15 *x = __builtin_floorf (a);
16 *y = __builtin_floor (b);
17 }
18 {
19 *x = __builtin_ceilf (a);
20 *y = __builtin_ceil (b);
21 }
22 {
23 *x = __builtin_truncf (a);
24 *y = __builtin_trunc (b);
25 }
26 {
27 *x = __builtin_roundevenf (a);
28 *y = __builtin_roundeven (b);
29 }
30 {
31 *x = __builtin_nearbyintf (a);
32 *y = __builtin_nearbyint (b);
33 }
34 {
35 *x = __builtin_rintf (a);
36 *y = __builtin_rint (b);
37 }
38 }
39
40 /* { dg-final { scan-assembler-times "fround.s" 6 } } */
41 /* { dg-final { scan-assembler-times "fround.d" 6 } } */
42 /* { dg-final { scan-assembler-times "froundnx.s" 1 } } */
43 /* { dg-final { scan-assembler-times "froundnx.d" 1 } } */