From ea3bc4e821e20e70b093c9a33e54f99c79e0d847 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 29 Nov 2013 16:31:16 +0000 Subject: Fix x86 sqrt rounding (bug 14032). --- sysdeps/i386/fpu/e_sqrt.S | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'sysdeps/i386/fpu/e_sqrt.S') diff --git a/sysdeps/i386/fpu/e_sqrt.S b/sysdeps/i386/fpu/e_sqrt.S index 1054ba4532..fba5833a9a 100644 --- a/sysdeps/i386/fpu/e_sqrt.S +++ b/sysdeps/i386/fpu/e_sqrt.S @@ -7,7 +7,17 @@ ENTRY(__ieee754_sqrt) fldl 4(%esp) + subl $8, %esp + cfi_adjust_cfa_offset (8) + fstcw 4(%esp) + movl $0xfeff, %edx + andl 4(%esp), %edx + movl %edx, (%esp) + fldcw (%esp) fsqrt + fldcw 4(%esp) + addl $8, %esp + cfi_adjust_cfa_offset (-8) ret END (__ieee754_sqrt) strong_alias (__ieee754_sqrt, __sqrt_finite) -- cgit v1.2.3