mirror of
https://github.com/fluencelabs/musl
synced 2025-07-31 06:11:57 +00:00
asm for remquo
this could perhaps use some additional testing for corner cases, but it seems to be correct.
This commit is contained in:
41
src/math/i386/remquo.s
Normal file
41
src/math/i386/remquo.s
Normal file
@@ -0,0 +1,41 @@
|
||||
.global remquof
|
||||
.type remquof,@function
|
||||
remquof:
|
||||
mov 12(%esp),%ecx
|
||||
fldl 4(%esp)
|
||||
fldl 8(%esp)
|
||||
jmp 1f
|
||||
|
||||
.global remquol
|
||||
.type remquol,@function
|
||||
remquol:
|
||||
mov 28(%esp),%ecx
|
||||
fldl 4(%esp)
|
||||
fldl 16(%esp)
|
||||
jmp 1f
|
||||
|
||||
.global remquo
|
||||
.type remquo,@function
|
||||
remquo:
|
||||
mov 20(%esp),%ecx
|
||||
fldl 4(%esp)
|
||||
fldl 12(%esp)
|
||||
1: fld %st(1)
|
||||
1: fprem1
|
||||
fnstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fsubr %st(0),%st(2)
|
||||
fxch %st(2)
|
||||
fdivp
|
||||
mov $0x4f000000,%eax
|
||||
mov %eax,4(%esp)
|
||||
flds 4(%esp)
|
||||
fxch %st(1)
|
||||
1: fprem
|
||||
fnstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fistpl (%ecx)
|
||||
fstp %st(0)
|
||||
ret
|
1
src/math/i386/remquof.s
Normal file
1
src/math/i386/remquof.s
Normal file
@@ -0,0 +1 @@
|
||||
# see remquo.s
|
1
src/math/i386/remquol.s
Normal file
1
src/math/i386/remquol.s
Normal file
@@ -0,0 +1 @@
|
||||
# see remquo.s
|
Reference in New Issue
Block a user