new math asm (abs/rounding) for x86_64

untested
This commit is contained in:
Rich Felker 2012-04-29 20:31:46 -04:00
parent aa85940388
commit 0e4a995213
6 changed files with 36 additions and 0 deletions

9
src/math/x86_64/fabs.s Normal file
View File

@ -0,0 +1,9 @@
.global fabs
.type fabs,@function
fabs:
xor %eax,%eax
dec %rax
shr %rax
movq %rax,%xmm1
andpd %xmm1,%xmm0
ret

7
src/math/x86_64/fabsf.s Normal file
View File

@ -0,0 +1,7 @@
.global fabsf
.type fabsf,@function
fabsf:
mov $0x7fffffff,%eax
movq %rax,%xmm1
andps %xmm1,%xmm0
ret

5
src/math/x86_64/llrint.s Normal file
View File

@ -0,0 +1,5 @@
.global llrint
.type llrint,@function
llrint:
cvtsd2si @xmm0,%rax
ret

View File

@ -0,0 +1,5 @@
.global llrintf
.type llrintf,@function
llrintf:
cvtss2si @xmm0,%rax
ret

5
src/math/x86_64/lrint.s Normal file
View File

@ -0,0 +1,5 @@
.global lrint
.type lrint,@function
lrint:
cvtsd2si @xmm0,%rax
ret

5
src/math/x86_64/lrintf.s Normal file
View File

@ -0,0 +1,5 @@
.global lrintf
.type lrintf,@function
lrintf:
cvtss2si @xmm0,%rax
ret