summaryrefslogtreecommitdiff
path: root/src/math/x86_64
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-04-29 20:31:46 -0400
committerRich Felker <dalias@aerifal.cx>2012-04-29 20:31:46 -0400
commit0e4a995213620630005a14f32c089879f7c0315e (patch)
treee5c584b6ceba8e24c312c67b82d59942d2bdc568 /src/math/x86_64
parentaa859403886ed4b50da36e7fe101f7431856c004 (diff)
downloadmusl-0e4a995213620630005a14f32c089879f7c0315e.tar.gz
new math asm (abs/rounding) for x86_64
untested
Diffstat (limited to 'src/math/x86_64')
-rw-r--r--src/math/x86_64/fabs.s9
-rw-r--r--src/math/x86_64/fabsf.s7
-rw-r--r--src/math/x86_64/llrint.s5
-rw-r--r--src/math/x86_64/llrintf.s5
-rw-r--r--src/math/x86_64/lrint.s5
-rw-r--r--src/math/x86_64/lrintf.s5
6 files changed, 36 insertions, 0 deletions
diff --git a/src/math/x86_64/fabs.s b/src/math/x86_64/fabs.s
new file mode 100644
index 00000000..5715005e
--- /dev/null
+++ b/src/math/x86_64/fabs.s
@@ -0,0 +1,9 @@
+.global fabs
+.type fabs,@function
+fabs:
+ xor %eax,%eax
+ dec %rax
+ shr %rax
+ movq %rax,%xmm1
+ andpd %xmm1,%xmm0
+ ret
diff --git a/src/math/x86_64/fabsf.s b/src/math/x86_64/fabsf.s
new file mode 100644
index 00000000..501a1f17
--- /dev/null
+++ b/src/math/x86_64/fabsf.s
@@ -0,0 +1,7 @@
+.global fabsf
+.type fabsf,@function
+fabsf:
+ mov $0x7fffffff,%eax
+ movq %rax,%xmm1
+ andps %xmm1,%xmm0
+ ret
diff --git a/src/math/x86_64/llrint.s b/src/math/x86_64/llrint.s
new file mode 100644
index 00000000..0de0658f
--- /dev/null
+++ b/src/math/x86_64/llrint.s
@@ -0,0 +1,5 @@
+.global llrint
+.type llrint,@function
+llrint:
+ cvtsd2si @xmm0,%rax
+ ret
diff --git a/src/math/x86_64/llrintf.s b/src/math/x86_64/llrintf.s
new file mode 100644
index 00000000..b05f7be9
--- /dev/null
+++ b/src/math/x86_64/llrintf.s
@@ -0,0 +1,5 @@
+.global llrintf
+.type llrintf,@function
+llrintf:
+ cvtss2si @xmm0,%rax
+ ret
diff --git a/src/math/x86_64/lrint.s b/src/math/x86_64/lrint.s
new file mode 100644
index 00000000..59b12038
--- /dev/null
+++ b/src/math/x86_64/lrint.s
@@ -0,0 +1,5 @@
+.global lrint
+.type lrint,@function
+lrint:
+ cvtsd2si @xmm0,%rax
+ ret
diff --git a/src/math/x86_64/lrintf.s b/src/math/x86_64/lrintf.s
new file mode 100644
index 00000000..951894b6
--- /dev/null
+++ b/src/math/x86_64/lrintf.s
@@ -0,0 +1,5 @@
+.global lrintf
+.type lrintf,@function
+lrintf:
+ cvtss2si @xmm0,%rax
+ ret