summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/math/aarch64
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 13:54:38 +0000
commit8c1ab65c0f548d20b7f177bdb736daaf603340e1 (patch)
treedf55b7e75bf43f2bf500845b105afe3ac3a5157e /libc-top-half/musl/src/math/aarch64
parentInitial commit. (diff)
downloadwasi-libc-upstream/0.0_git20221206.8b7148f.tar.xz
wasi-libc-upstream/0.0_git20221206.8b7148f.zip
Adding upstream version 0.0~git20221206.8b7148f.upstream/0.0_git20221206.8b7148f
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'libc-top-half/musl/src/math/aarch64')
-rw-r--r--libc-top-half/musl/src/math/aarch64/ceil.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/ceilf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fabs.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fabsf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/floor.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/floorf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fma.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fmaf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fmax.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fmaxf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fmin.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/fminf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/llrint.c10
-rw-r--r--libc-top-half/musl/src/math/aarch64/llrintf.c10
-rw-r--r--libc-top-half/musl/src/math/aarch64/llround.c8
-rw-r--r--libc-top-half/musl/src/math/aarch64/llroundf.c8
-rw-r--r--libc-top-half/musl/src/math/aarch64/lrint.c10
-rw-r--r--libc-top-half/musl/src/math/aarch64/lrintf.c10
-rw-r--r--libc-top-half/musl/src/math/aarch64/lround.c8
-rw-r--r--libc-top-half/musl/src/math/aarch64/lroundf.c8
-rw-r--r--libc-top-half/musl/src/math/aarch64/nearbyint.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/nearbyintf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/rint.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/rintf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/round.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/roundf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/sqrt.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/sqrtf.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/trunc.c7
-rw-r--r--libc-top-half/musl/src/math/aarch64/truncf.c7
30 files changed, 226 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/math/aarch64/ceil.c b/libc-top-half/musl/src/math/aarch64/ceil.c
new file mode 100644
index 0000000..ac80c1d
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/ceil.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double ceil(double x)
+{
+ __asm__ ("frintp %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/ceilf.c b/libc-top-half/musl/src/math/aarch64/ceilf.c
new file mode 100644
index 0000000..1ef1e9c
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/ceilf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float ceilf(float x)
+{
+ __asm__ ("frintp %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fabs.c b/libc-top-half/musl/src/math/aarch64/fabs.c
new file mode 100644
index 0000000..5c3ecaf
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fabs.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double fabs(double x)
+{
+ __asm__ ("fabs %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fabsf.c b/libc-top-half/musl/src/math/aarch64/fabsf.c
new file mode 100644
index 0000000..7fde981
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fabsf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float fabsf(float x)
+{
+ __asm__ ("fabs %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/floor.c b/libc-top-half/musl/src/math/aarch64/floor.c
new file mode 100644
index 0000000..50ffdb2
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/floor.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double floor(double x)
+{
+ __asm__ ("frintm %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/floorf.c b/libc-top-half/musl/src/math/aarch64/floorf.c
new file mode 100644
index 0000000..8d007e9
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/floorf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float floorf(float x)
+{
+ __asm__ ("frintm %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fma.c b/libc-top-half/musl/src/math/aarch64/fma.c
new file mode 100644
index 0000000..2450ea7
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fma.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double fma(double x, double y, double z)
+{
+ __asm__ ("fmadd %d0, %d1, %d2, %d3" : "=w"(x) : "w"(x), "w"(y), "w"(z));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fmaf.c b/libc-top-half/musl/src/math/aarch64/fmaf.c
new file mode 100644
index 0000000..9a14721
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fmaf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float fmaf(float x, float y, float z)
+{
+ __asm__ ("fmadd %s0, %s1, %s2, %s3" : "=w"(x) : "w"(x), "w"(y), "w"(z));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fmax.c b/libc-top-half/musl/src/math/aarch64/fmax.c
new file mode 100644
index 0000000..86dcb3b
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fmax.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double fmax(double x, double y)
+{
+ __asm__ ("fmaxnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fmaxf.c b/libc-top-half/musl/src/math/aarch64/fmaxf.c
new file mode 100644
index 0000000..ee5eac2
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fmaxf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float fmaxf(float x, float y)
+{
+ __asm__ ("fmaxnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fmin.c b/libc-top-half/musl/src/math/aarch64/fmin.c
new file mode 100644
index 0000000..f1e9980
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fmin.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double fmin(double x, double y)
+{
+ __asm__ ("fminnm %d0, %d1, %d2" : "=w"(x) : "w"(x), "w"(y));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/fminf.c b/libc-top-half/musl/src/math/aarch64/fminf.c
new file mode 100644
index 0000000..80468f6
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/fminf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float fminf(float x, float y)
+{
+ __asm__ ("fminnm %s0, %s1, %s2" : "=w"(x) : "w"(x), "w"(y));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/llrint.c b/libc-top-half/musl/src/math/aarch64/llrint.c
new file mode 100644
index 0000000..a9e07a9
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/llrint.c
@@ -0,0 +1,10 @@
+#include <math.h>
+
+long long llrint(double x)
+{
+ long long n;
+ __asm__ (
+ "frintx %d1, %d1\n"
+ "fcvtzs %x0, %d1\n" : "=r"(n), "+w"(x));
+ return n;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/llrintf.c b/libc-top-half/musl/src/math/aarch64/llrintf.c
new file mode 100644
index 0000000..12b6804
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/llrintf.c
@@ -0,0 +1,10 @@
+#include <math.h>
+
+long long llrintf(float x)
+{
+ long long n;
+ __asm__ (
+ "frintx %s1, %s1\n"
+ "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x));
+ return n;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/llround.c b/libc-top-half/musl/src/math/aarch64/llround.c
new file mode 100644
index 0000000..e09ddd4
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/llround.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+long long llround(double x)
+{
+ long long n;
+ __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x));
+ return n;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/llroundf.c b/libc-top-half/musl/src/math/aarch64/llroundf.c
new file mode 100644
index 0000000..1669959
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/llroundf.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+long long llroundf(float x)
+{
+ long long n;
+ __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x));
+ return n;
+}
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;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/lrintf.c b/libc-top-half/musl/src/math/aarch64/lrintf.c
new file mode 100644
index 0000000..4d750d6
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/lrintf.c
@@ -0,0 +1,10 @@
+#include <math.h>
+
+long lrintf(float x)
+{
+ long n;
+ __asm__ (
+ "frintx %s1, %s1\n"
+ "fcvtzs %x0, %s1\n" : "=r"(n), "+w"(x));
+ return n;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/lround.c b/libc-top-half/musl/src/math/aarch64/lround.c
new file mode 100644
index 0000000..85656c7
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/lround.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+long lround(double x)
+{
+ long n;
+ __asm__ ("fcvtas %x0, %d1" : "=r"(n) : "w"(x));
+ return n;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/lroundf.c b/libc-top-half/musl/src/math/aarch64/lroundf.c
new file mode 100644
index 0000000..32e51f3
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/lroundf.c
@@ -0,0 +1,8 @@
+#include <math.h>
+
+long lroundf(float x)
+{
+ long n;
+ __asm__ ("fcvtas %x0, %s1" : "=r"(n) : "w"(x));
+ return n;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/nearbyint.c b/libc-top-half/musl/src/math/aarch64/nearbyint.c
new file mode 100644
index 0000000..9c3fdb4
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/nearbyint.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double nearbyint(double x)
+{
+ __asm__ ("frinti %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/nearbyintf.c b/libc-top-half/musl/src/math/aarch64/nearbyintf.c
new file mode 100644
index 0000000..8e7f61d
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/nearbyintf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float nearbyintf(float x)
+{
+ __asm__ ("frinti %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/rint.c b/libc-top-half/musl/src/math/aarch64/rint.c
new file mode 100644
index 0000000..45b194b
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/rint.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double rint(double x)
+{
+ __asm__ ("frintx %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/rintf.c b/libc-top-half/musl/src/math/aarch64/rintf.c
new file mode 100644
index 0000000..1ae7dd2
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/rintf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float rintf(float x)
+{
+ __asm__ ("frintx %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/round.c b/libc-top-half/musl/src/math/aarch64/round.c
new file mode 100644
index 0000000..897a84c
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/round.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double round(double x)
+{
+ __asm__ ("frinta %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/roundf.c b/libc-top-half/musl/src/math/aarch64/roundf.c
new file mode 100644
index 0000000..91637ea
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/roundf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float roundf(float x)
+{
+ __asm__ ("frinta %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/sqrt.c b/libc-top-half/musl/src/math/aarch64/sqrt.c
new file mode 100644
index 0000000..fe93c3e
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/sqrt.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double sqrt(double x)
+{
+ __asm__ ("fsqrt %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/sqrtf.c b/libc-top-half/musl/src/math/aarch64/sqrtf.c
new file mode 100644
index 0000000..275c7f3
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/sqrtf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float sqrtf(float x)
+{
+ __asm__ ("fsqrt %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/trunc.c b/libc-top-half/musl/src/math/aarch64/trunc.c
new file mode 100644
index 0000000..e592147
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/trunc.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+double trunc(double x)
+{
+ __asm__ ("frintz %d0, %d1" : "=w"(x) : "w"(x));
+ return x;
+}
diff --git a/libc-top-half/musl/src/math/aarch64/truncf.c b/libc-top-half/musl/src/math/aarch64/truncf.c
new file mode 100644
index 0000000..20ef30f
--- /dev/null
+++ b/libc-top-half/musl/src/math/aarch64/truncf.c
@@ -0,0 +1,7 @@
+#include <math.h>
+
+float truncf(float x)
+{
+ __asm__ ("frintz %s0, %s1" : "=w"(x) : "w"(x));
+ return x;
+}