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