Cygwin: signal: Increase chance of handling signal in main thread
[newlib-cygwin.git] / winsup / cygwin / math / llrintf.c
blobcc85bf3c39851a39d58d4de95257b1946293864d
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 llrintf (float 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;