OSDN Git Service

2003-11-10 Jeff Johnston <jjohnstn@redhat.com>
authorjjohnstn <jjohnstn>
Mon, 10 Nov 2003 21:36:37 +0000 (21:36 +0000)
committerjjohnstn <jjohnstn>
Mon, 10 Nov 2003 21:36:37 +0000 (21:36 +0000)
        * libc/machine/powerpc/ufix64toa.c (_ufix64to_r): Fix shifts
        to use (Ebits + 1) which accounts for the sign-bit.

newlib/ChangeLog
newlib/libc/machine/powerpc/ufix64toa.c

index 302a864..4bf935d 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-10  Jeff Johnston  <jjohnstn@redhat.com>
+
+       * libc/machine/powerpc/ufix64toa.c (_ufix64to_r): Fix shifts
+       to use (Ebits + 1) which accounts for the sign-bit.
+
 2003-11-07  Jeff Johnston  <jjohnstn@redhat.com>
 
        * configure.host: Remove -DLOOSE_KERNEL_NAMES flag for linux 
index 6f0d128..450e0a3 100644 (file)
@@ -74,13 +74,13 @@ _DEFUN (_ufix64toa_r, (rptr, value, mode, ndigits, decpt, sign, rve),
       /* build long double */
       exp = -negexp + Bias;
       word0(ldbl) = (exp << Exp_shift);
-      word1(ldbl) = hiword(fix64) << (32-Ebits);
-      word2(ldbl) = loword(fix64) << (32-Ebits);
+      word1(ldbl) = hiword(fix64) << (32-Ebits-1);
+      word2(ldbl) = loword(fix64) << (32-Ebits-1);
       word3(ldbl) = 0;
-      if (Ebits < 32)
+      if (Ebits+1 < 32)
        {
-         word0(ldbl) |= hiword(fix64) >> Ebits;
-         word1(ldbl) |= loword(fix64) >> Ebits;
+         word0(ldbl) |= hiword(fix64) >> (Ebits + 1);
+         word1(ldbl) |= loword(fix64) >> (Ebits + 1);
        }
     }