aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.target/s390/nearestint-1.c
blob: 1d9a753b3e471035aae65c754257c090b5a9ad33 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* Since z196 the nearest integer functions can be expanded to single
   instructions.  */

/* { dg-do compile } */
/* { dg-options "-O3 -march=z196 -mzarch" } */

extern float ceilf (float x);
extern double ceil (double x);
extern long double ceill (long double x);
extern float floorf (float x);
extern double floor (double x);
extern long double floorl (long double x);
extern float truncf (float x);
extern double trunc (double x);
extern long double truncl (long double x);
extern float nearbyintf (float x);
extern double nearbyint (double x);
extern long double nearbyintl (long double x);
extern float rintf (float x);
extern double rint (double x);
extern long double rintl (long double x);

float my_ceilf (float x) { return ceilf (x); }
double my_ceil (double x) { return ceil (x); }
long double my_ceill (long double x) { return ceill (x); }

float my_floorf (float x) { return floorf (x); }
double my_floor (double x) { return floor (x); }
long double my_floorl (long double x) { return floorl (x); }

float my_truncf (float x) { return truncf (x); }
double my_trunc (double x) { return trunc (x); }
long double my_truncl (long double x) { return truncl (x); }

float my_nearbyintf (float x) { return nearbyintf (x); }
double my_nearbyint (double x) { return nearbyint (x); }
long double my_nearbyintl (long double x) { return nearbyintl (x); }

float my_rintf (float x) { return rintf (x); }
double my_rint (double x) { return rint (x); }
long double my_rintl (long double x) { return rintl (x); }

/* { dg-final { scan-assembler-times "fiebr\t" 1 } } */
/* { dg-final { scan-assembler-times "fidbr\t" 1 } } */
/* { dg-final { scan-assembler-times "fixbr\t" 1 } } */
/* { dg-final { scan-assembler-times "fiebra\t" 4 } } */
/* { dg-final { scan-assembler-times "fidbra\t" 4 } } */
/* { dg-final { scan-assembler-times "fixbra\t" 4 } } */