assembly optimizations for fmod/remainder functions
This commit is contained in:
parent
8d9e948652
commit
b935147761
8 changed files with 88 additions and 0 deletions
11
src/math/i386/fmod.s
Normal file
11
src/math/i386/fmod.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global fmod
|
||||
.type fmod,@function
|
||||
fmod:
|
||||
fldl 12(%esp)
|
||||
fldl 4(%esp)
|
||||
1: fprem
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/i386/fmodf.s
Normal file
11
src/math/i386/fmodf.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global fmodf
|
||||
.type fmodf,@function
|
||||
fmodf:
|
||||
flds 8(%esp)
|
||||
flds 4(%esp)
|
||||
1: fprem
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/i386/fmodl.s
Normal file
11
src/math/i386/fmodl.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global fmodl
|
||||
.type fmodl,@function
|
||||
fmodl:
|
||||
fldt 16(%esp)
|
||||
fldt 4(%esp)
|
||||
1: fprem
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/i386/remainder.s
Normal file
11
src/math/i386/remainder.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global remainder
|
||||
.type remainder,@function
|
||||
remainder:
|
||||
fldl 12(%esp)
|
||||
fldl 4(%esp)
|
||||
1: fprem1
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/i386/remainderf.s
Normal file
11
src/math/i386/remainderf.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global remainderf
|
||||
.type remainderf,@function
|
||||
remainderf:
|
||||
flds 8(%esp)
|
||||
flds 4(%esp)
|
||||
1: fprem1
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/i386/remainderl.s
Normal file
11
src/math/i386/remainderl.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global remainderl
|
||||
.type remainderl,@function
|
||||
remainderl:
|
||||
fldt 16(%esp)
|
||||
fldt 4(%esp)
|
||||
1: fprem1
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/x86_64/fmodl.s
Normal file
11
src/math/x86_64/fmodl.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global fmodl
|
||||
.type fmodl,@function
|
||||
fmodl:
|
||||
fldt 24(%rsp)
|
||||
fldt 8(%rsp)
|
||||
1: fprem
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
11
src/math/x86_64/remainderl.s
Normal file
11
src/math/x86_64/remainderl.s
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
.global remainderl
|
||||
.type remainderl,@function
|
||||
remainderl:
|
||||
fldt 24(%rsp)
|
||||
fldt 8(%rsp)
|
||||
1: fprem1
|
||||
fstsw %ax
|
||||
sahf
|
||||
jp 1b
|
||||
fstp %st(1)
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue