mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-25 15:42:06 +03:00
new math asm (abs/rounding) for x86_64
untested
This commit is contained in:
parent
aa85940388
commit
0e4a995213
9
src/math/x86_64/fabs.s
Normal file
9
src/math/x86_64/fabs.s
Normal 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
7
src/math/x86_64/fabsf.s
Normal 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
5
src/math/x86_64/llrint.s
Normal file
@ -0,0 +1,5 @@
|
||||
.global llrint
|
||||
.type llrint,@function
|
||||
llrint:
|
||||
cvtsd2si @xmm0,%rax
|
||||
ret
|
5
src/math/x86_64/llrintf.s
Normal file
5
src/math/x86_64/llrintf.s
Normal file
@ -0,0 +1,5 @@
|
||||
.global llrintf
|
||||
.type llrintf,@function
|
||||
llrintf:
|
||||
cvtss2si @xmm0,%rax
|
||||
ret
|
5
src/math/x86_64/lrint.s
Normal file
5
src/math/x86_64/lrint.s
Normal file
@ -0,0 +1,5 @@
|
||||
.global lrint
|
||||
.type lrint,@function
|
||||
lrint:
|
||||
cvtsd2si @xmm0,%rax
|
||||
ret
|
5
src/math/x86_64/lrintf.s
Normal file
5
src/math/x86_64/lrintf.s
Normal file
@ -0,0 +1,5 @@
|
||||
.global lrintf
|
||||
.type lrintf,@function
|
||||
lrintf:
|
||||
cvtss2si @xmm0,%rax
|
||||
ret
|
Loading…
Reference in New Issue
Block a user