提交 0e4a9952 编写于 作者: R Rich Felker

new math asm (abs/rounding) for x86_64

untested
上级 aa859403
.global fabs
.type fabs,@function
fabs:
xor %eax,%eax
dec %rax
shr %rax
movq %rax,%xmm1
andpd %xmm1,%xmm0
ret
.global fabsf
.type fabsf,@function
fabsf:
mov $0x7fffffff,%eax
movq %rax,%xmm1
andps %xmm1,%xmm0
ret
.global llrint
.type llrint,@function
llrint:
cvtsd2si @xmm0,%rax
ret
.global llrintf
.type llrintf,@function
llrintf:
cvtss2si @xmm0,%rax
ret
.global lrint
.type lrint,@function
lrint:
cvtsd2si @xmm0,%rax
ret
.global lrintf
.type lrintf,@function
lrintf:
cvtss2si @xmm0,%rax
ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册