Cygwin: Add new APIs tc[gs]etwinsize()
[newlib-cygwin.git] / newlib / libm / machine / i386 / f_rintl.c
blob0e67739b58faca2df6c84c8f0eb823d8e9a42c2c
1 /*
2 * ====================================================
3 * x87 FP implementation contributed to Newlib by
4 * Dave Korn, November 2007. This file is placed in the
5 * public domain. Permission to use, copy, modify, and
6 * distribute this software is freely granted.
7 * ====================================================
8 */
10 #ifdef __GNUC__
11 #if !defined(_SOFT_FLOAT)
13 #include <math.h>
16 * Fast math version of rintl(x)
17 * Return x rounded to integral value according to the prevailing
18 * rounding mode.
19 * Method:
20 * Using inline x87 asms.
21 * Exception:
22 * Governed by x87 FPCR.
25 long double _f_rintl (long double x)
27 long double _result;
28 asm ("frndint" : "=t" (_result) : "0" (x));
29 return _result;
32 /* For now, we only have the fast math version. */
33 long double rintl (long double x) {
34 return _f_rintl(x);
37 #endif /* !_SOFT_FLOAT */
38 #endif /* __GNUC__ */