This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Fix x86 sqrt rounding (bug 14032)
- From: Richard Henderson <rth at twiddle dot net>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>, libc-alpha at sourceware dot org
- Date: Thu, 28 Nov 2013 10:34:13 +1300
- Subject: Re: Fix x86 sqrt rounding (bug 14032)
- Authentication-results: sourceware.org; auth=none
- References: <Pine dot LNX dot 4 dot 64 dot 1311271803540 dot 7837 at digraph dot polyomino dot org dot uk>
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~