summaryrefslogtreecommitdiff
path: root/src/math/i386/lrintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/i386/lrintf.c')
-rw-r--r--src/math/i386/lrintf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/math/i386/lrintf.c b/src/math/i386/lrintf.c
new file mode 100644
index 00000000..0bbf29de
--- /dev/null
+++ b/src/math/i386/lrintf.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+long lrintf(float x)
+{
+ long r;
+ __asm__ ("fistpl %0" : "=m"(r) : "t"(x) : "st");
+ return r;
+}