mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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)
|
||||
fcos
|
||||
fnstsw %ax
|
||||
andw $0x400,%ax
|
||||
jnz 1f
|
||||
sahf
|
||||
jp 1f
|
||||
ret
|
||||
1: fldpi
|
||||
fadd %st(0)
|
||||
fxch %st(1)
|
||||
2: fprem1
|
||||
2: fprem
|
||||
fnstsw %ax
|
||||
andw $0x400,%ax
|
||||
jnz 2b
|
||||
sahf
|
||||
jp 2b
|
||||
fstp %st(1)
|
||||
fcos
|
||||
ret
|
||||
|
|
|
@ -40,16 +40,16 @@ ENTRY(sin)
|
|||
fldl 4(%esp)
|
||||
fsin
|
||||
fnstsw %ax
|
||||
andw $0x400,%ax
|
||||
jnz 1f
|
||||
sahf
|
||||
jp 1f
|
||||
ret
|
||||
1: fldpi
|
||||
fadd %st(0)
|
||||
fxch %st(1)
|
||||
2: fprem1
|
||||
2: fprem
|
||||
fnstsw %ax
|
||||
andw $0x400,%ax
|
||||
jnz 2b
|
||||
sahf
|
||||
jp 2b
|
||||
fstp %st(1)
|
||||
fsin
|
||||
ret
|
||||
|
|
|
@ -40,17 +40,17 @@ ENTRY(tan)
|
|||
fldl 4(%esp)
|
||||
fptan
|
||||
fnstsw %ax
|
||||
andw $0x400,%ax
|
||||
jnz 1f
|
||||
sahf
|
||||
jp 1f
|
||||
fstp %st(0)
|
||||
ret
|
||||
1: fldpi
|
||||
fadd %st(0)
|
||||
fxch %st(1)
|
||||
2: fprem1
|
||||
fstsw %ax
|
||||
andw $0x400,%ax
|
||||
jnz 2b
|
||||
2: fprem
|
||||
fnstsw %ax
|
||||
sahf
|
||||
jp 2b
|
||||
fstp %st(1)
|
||||
fptan
|
||||
fstp %st(0)
|
||||
|
|
Loading…
Reference in a new issue