asm for modf functions
This commit is contained in:
parent
0b70a1e9a9
commit
1bf4dad327
3 changed files with 45 additions and 0 deletions
15
src/math/i386/modf.s
Normal file
15
src/math/i386/modf.s
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
.global modf
|
||||||
|
.type modf,@function
|
||||||
|
modf:
|
||||||
|
mov 12(%esp),%eax
|
||||||
|
fldl 4(%esp)
|
||||||
|
fld1
|
||||||
|
fld %st(1)
|
||||||
|
1: fprem
|
||||||
|
fstsw %ax
|
||||||
|
sahf
|
||||||
|
jp 1b
|
||||||
|
fstp %st(1)
|
||||||
|
fsubr %st(1)
|
||||||
|
fstpl (%eax)
|
||||||
|
ret
|
||||||
15
src/math/i386/modff.s
Normal file
15
src/math/i386/modff.s
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
.global modff
|
||||||
|
.type modff,@function
|
||||||
|
modff:
|
||||||
|
mov 8(%esp),%eax
|
||||||
|
flds 4(%esp)
|
||||||
|
fld1
|
||||||
|
fld %st(1)
|
||||||
|
1: fprem
|
||||||
|
fstsw %ax
|
||||||
|
sahf
|
||||||
|
jp 1b
|
||||||
|
fstp %st(1)
|
||||||
|
fsubr %st(1)
|
||||||
|
fstps (%eax)
|
||||||
|
ret
|
||||||
15
src/math/i386/modfl.s
Normal file
15
src/math/i386/modfl.s
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
.global modfl
|
||||||
|
.type modfl,@function
|
||||||
|
modfl:
|
||||||
|
mov 16(%esp),%eax
|
||||||
|
fldt 4(%esp)
|
||||||
|
fld1
|
||||||
|
fld %st(1)
|
||||||
|
1: fprem
|
||||||
|
fstsw %ax
|
||||||
|
sahf
|
||||||
|
jp 1b
|
||||||
|
fstp %st(1)
|
||||||
|
fsubr %st(1)
|
||||||
|
fstpt (%eax)
|
||||||
|
ret
|
||||||
Loading…
Add table
Add a link
Reference in a new issue