This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: libm functions for x86-64
On Tuesday 14 March 2006 19:04, Daniel Jacobowitz wrote:
> On Tue, Mar 14, 2006 at 06:44:43PM -0500, Mike Frysinger wrote:
> > On Tuesday 14 March 2006 11:42, Michael Matz wrote:
>
> [x86-64 IEEE snip]
>
> > is the attached change still relevant ?
>
> [MIPS patch snip]
>
> Wrong patch?
err, damnit ... right one is attached
-mike
Requires 6901_all_2.4-new-libm-20060314.patch
This fixes ceil (x) for -1.0 < x < 0.
--- sysdeps/x86_64/fpu/s_ceil.c
+++ sysdeps/x86_64/fpu/s_ceil.c
@@ -34,7 +34,11 @@
/* x is +zero or -zero; return the same zero */
return x;
else if (xneg) /* x < 0.0 */
- return 0.0;
+ {
+ /* Return zero with the sign of x */
+ PUT_BITS_DP64(SIGNBIT_DP64, x);
+ return x;
+ }
else
return 1.0;
}
--- sysdeps/x86_64/fpu/s_ceilf.c
+++ sysdeps/x86_64/fpu/s_ceilf.c
@@ -34,7 +34,11 @@
/* x is +zero or -zero; return the same zero */
return x;
else if (xneg) /* x < 0.0 */
- return 0.0F;
+ {
+ /* Return zero with the sign of x */
+ PUT_BITS_SP32(SIGNBIT_SP32, x);
+ return x;
+ }
else
return 1.0F;
}