Cygwin: (mostly) drop NT4 and Samba < 3.0 support
[newlib-cygwin.git] / winsup / cygwin / math / llrintl.c
blob5ef74a5aa12ee32b6e121679136bf17186e8b24c
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the mingw-w64 runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 */
6 #include <math.h>
8 long long llrintl (long double x)
10 long long retval = 0ll;
11 #if defined(_AMD64_) || defined(__x86_64__) || defined(_X86_) || defined(__i386__)
12 __asm__ __volatile__ ("fistpll %0" : "=m" (retval) : "t" (x) : "st");
13 #else
14 retval = (long long)x;
15 #endif
16 return retval;