This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix x86 sqrt rounding (bug 14032)


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~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]