Optimise i387 trigonometric functions. Replace "andw 0x400,%ax \ jnz" with
"sahf \ jp", "fprem1" with "fprem" and "fstsw %ax" with "fnstsw %ax".
This commit is contained in:
parent
65e415b16e
commit
71dad5d6ad
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=240566
@ -40,16 +40,16 @@ ENTRY(cos)
|
|||||||
fldl 4(%esp)
|
fldl 4(%esp)
|
||||||
fcos
|
fcos
|
||||||
fnstsw %ax
|
fnstsw %ax
|
||||||
andw $0x400,%ax
|
sahf
|
||||||
jnz 1f
|
jp 1f
|
||||||
ret
|
ret
|
||||||
1: fldpi
|
1: fldpi
|
||||||
fadd %st(0)
|
fadd %st(0)
|
||||||
fxch %st(1)
|
fxch %st(1)
|
||||||
2: fprem1
|
2: fprem
|
||||||
fnstsw %ax
|
fnstsw %ax
|
||||||
andw $0x400,%ax
|
sahf
|
||||||
jnz 2b
|
jp 2b
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
fcos
|
fcos
|
||||||
ret
|
ret
|
||||||
|
@ -40,16 +40,16 @@ ENTRY(sin)
|
|||||||
fldl 4(%esp)
|
fldl 4(%esp)
|
||||||
fsin
|
fsin
|
||||||
fnstsw %ax
|
fnstsw %ax
|
||||||
andw $0x400,%ax
|
sahf
|
||||||
jnz 1f
|
jp 1f
|
||||||
ret
|
ret
|
||||||
1: fldpi
|
1: fldpi
|
||||||
fadd %st(0)
|
fadd %st(0)
|
||||||
fxch %st(1)
|
fxch %st(1)
|
||||||
2: fprem1
|
2: fprem
|
||||||
fnstsw %ax
|
fnstsw %ax
|
||||||
andw $0x400,%ax
|
sahf
|
||||||
jnz 2b
|
jp 2b
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
fsin
|
fsin
|
||||||
ret
|
ret
|
||||||
|
@ -40,17 +40,17 @@ ENTRY(tan)
|
|||||||
fldl 4(%esp)
|
fldl 4(%esp)
|
||||||
fptan
|
fptan
|
||||||
fnstsw %ax
|
fnstsw %ax
|
||||||
andw $0x400,%ax
|
sahf
|
||||||
jnz 1f
|
jp 1f
|
||||||
fstp %st(0)
|
fstp %st(0)
|
||||||
ret
|
ret
|
||||||
1: fldpi
|
1: fldpi
|
||||||
fadd %st(0)
|
fadd %st(0)
|
||||||
fxch %st(1)
|
fxch %st(1)
|
||||||
2: fprem1
|
2: fprem
|
||||||
fstsw %ax
|
fnstsw %ax
|
||||||
andw $0x400,%ax
|
sahf
|
||||||
jnz 2b
|
jp 2b
|
||||||
fstp %st(1)
|
fstp %st(1)
|
||||||
fptan
|
fptan
|
||||||
fstp %st(0)
|
fstp %st(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user