Fix x86 sqrt rounding (bug 14032)
Richard Henderson
rth@twiddle.net
Thu Nov 28 14:56:00 GMT 2013
On 11/28/2013 07:06 AM, Joseph S. Myers wrote:
> ENTRY(__ieee754_sqrt)
> fldl 4(%esp)
> fsqrt
> + fstsw %ax
> + subl $12, %esp
> + cfi_adjust_cfa_offset (12)
> + fld %st
> + fstpt (%esp)
> + movl (%esp), %edx
> + andl $0x7ff, %edx
> + cmpl $0x400, %edx
> + jne 1f
> + andl $0x200, %eax
> + subl $0x100, %eax
> + subl %eax, (%esp)
> + fstp %st
> + fldt (%esp)
> +1: fstpl (%esp)
> + fldl (%esp)
> + addl $12,%esp
> + cfi_adjust_cfa_offset (-12)
> ret
Surely this is much more complex than simply setting the rounding precision to
double before using fsqrt.
r~
More information about the Libc-alpha
mailing list