summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/math/aarch64/lrint.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/math/aarch64/lrint.c')
-rw-r--r--libc-top-half/musl/src/math/aarch64/lrint.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/math/aarch64/lrint.c b/libc-top-half/musl/src/math/aarch64/lrint.c
new file mode 100644
index 0000000..cb7785a
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/lrint.c
@@ -0,0 +1,10 @@
+#include <math.h>
+
+long lrint(double x)
+{
+ long n;
+ __asm__ (
+ "frintx %d1, %d1\n"
+ "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x));
+ return n;
+}