From 9443f1b5cfeba687f45b96572378519e81ff9a56 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sat, 11 Jan 2020 18:14:24 +0300 Subject: math: move x87-family lrint functions to C with inline asm --- src/math/x86_64/lrintl.c | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/math/x86_64/lrintl.c (limited to 'src/math/x86_64/lrintl.c') diff --git a/src/math/x86_64/lrintl.c b/src/math/x86_64/lrintl.c new file mode 100644 index 00000000..068e2e4d --- /dev/null +++ b/src/math/x86_64/lrintl.c @@ -0,0 +1,8 @@ +#include + +long lrintl(long double x) +{ + long r; + __asm__ ("fistpll %0" : "=m"(r) : "t"(x) : "st"); + return r; +} -- cgit v1.2.3-70-g09d2