diff options
| author | Rich Felker <dalias@aerifal.cx> | 2012-05-04 20:56:01 -0400 | 
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2012-05-04 20:56:01 -0400 | 
| commit | dac791226a0f6fb8d19d83b63a837254f804dbac (patch) | |
| tree | b7c399afda1839f977673978e71450fce9451d65 /src | |
| parent | 4027f4e8f948c26be5e61c774f9f9ce9af8942b5 (diff) | |
| parent | f697d66b81912af59128ac1b96bc0e2a4514b758 (diff) | |
| download | musl-dac791226a0f6fb8d19d83b63a837254f804dbac.tar.gz | |
Merge remote-tracking branch 'nsz/master'
Diffstat (limited to 'src')
| -rw-r--r-- | src/math/i386/acos.s | 18 | ||||
| -rw-r--r-- | src/math/x86_64/acosl.s | 18 | 
2 files changed, 16 insertions, 20 deletions
| diff --git a/src/math/i386/acos.s b/src/math/i386/acos.s index bfff0c5c..47f365ef 100644 --- a/src/math/i386/acos.s +++ b/src/math/i386/acos.s @@ -1,3 +1,5 @@ +# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x) +  .global acosf  .type acosf,@function  acosf: @@ -14,17 +16,13 @@ acosl:  .type acos,@function  acos:  	fldl 4(%esp) -1:	fld1 -	fld %st(1) +1:	fld %st(0)  	fld1 -	fsubp -	fsqrt -	fxch %st(2) -	faddp +	fsub %st(0),%st(1) +	fadd %st(2) +	fmulp  	fsqrt +	fabs         # fix sign of zero (matters in downward rounding mode) +	fxch %st(1)  	fpatan -	fld1 -	fld1 -	faddp -	fmulp  	ret diff --git a/src/math/x86_64/acosl.s b/src/math/x86_64/acosl.s index db68d2de..88e01b49 100644 --- a/src/math/x86_64/acosl.s +++ b/src/math/x86_64/acosl.s @@ -1,18 +1,16 @@ +# see ../i386/acos.s +  .global acosl  .type acosl,@function  acosl:  	fldt 8(%rsp) +1:	fld %st(0)  	fld1 -	fld %st(1) -	fld1 -	fsubp -	fsqrt -	fxch %st(2) -	faddp +	fsub %st(0),%st(1) +	fadd %st(2) +	fmulp  	fsqrt +	fabs +	fxch %st(1)  	fpatan -	fld1 -	fld1 -	faddp -	fmulp  	ret | 
