1 /* Since z196 the nearest integer functions can be expanded to single
2 instructions. */
3
4 /* { dg-do compile } */
5 /* { dg-options "-O3 -march=z196 -mzarch" } */
6
7 extern float ceilf (float x);
8 extern double ceil (double x);
9 extern long double ceill (long double x);
10 extern float floorf (float x);
11 extern double floor (double x);
12 extern long double floorl (long double x);
13 extern float truncf (float x);
14 extern double trunc (double x);
15 extern long double truncl (long double x);
16 extern float nearbyintf (float x);
17 extern double nearbyint (double x);
18 extern long double nearbyintl (long double x);
19 extern float rintf (float x);
20 extern double rint (double x);
21 extern long double rintl (long double x);
22
my_ceilf(float x)23 float my_ceilf (float x) { return ceilf (x); }
my_ceil(double x)24 double my_ceil (double x) { return ceil (x); }
my_ceill(long double x)25 long double my_ceill (long double x) { return ceill (x); }
26
my_floorf(float x)27 float my_floorf (float x) { return floorf (x); }
my_floor(double x)28 double my_floor (double x) { return floor (x); }
my_floorl(long double x)29 long double my_floorl (long double x) { return floorl (x); }
30
my_truncf(float x)31 float my_truncf (float x) { return truncf (x); }
my_trunc(double x)32 double my_trunc (double x) { return trunc (x); }
my_truncl(long double x)33 long double my_truncl (long double x) { return truncl (x); }
34
my_nearbyintf(float x)35 float my_nearbyintf (float x) { return nearbyintf (x); }
my_nearbyint(double x)36 double my_nearbyint (double x) { return nearbyint (x); }
my_nearbyintl(long double x)37 long double my_nearbyintl (long double x) { return nearbyintl (x); }
38
my_rintf(float x)39 float my_rintf (float x) { return rintf (x); }
my_rint(double x)40 double my_rint (double x) { return rint (x); }
my_rintl(long double x)41 long double my_rintl (long double x) { return rintl (x); }
42
43 /* { dg-final { scan-assembler-times "fiebr\t" 1 } } */
44 /* { dg-final { scan-assembler-times "fidbr\t" 1 } } */
45 /* { dg-final { scan-assembler-times "fixbr\t" 1 } } */
46 /* { dg-final { scan-assembler-times "fiebra\t" 4 } } */
47 /* { dg-final { scan-assembler-times "fidbra\t" 4 } } */
48 /* { dg-final { scan-assembler-times "fixbra\t" 4 } } */
49