summaryrefslogtreecommitdiff
path: root/src/math/x86_64/fabs.s
diff options
context:
space:
mode:
Diffstat (limited to 'src/math/x86_64/fabs.s')
-rw-r--r--src/math/x86_64/fabs.s9
1 files changed, 9 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