Browse Source

* src/base/cl_low.h: Add missing linefeeds in SPARC 64 inline assembler.

* src/base/low/cl_low_div.cc (divu_6464_6464_): Fix a copy-paste typo.
        Reported by Sven Verdoolaege <skimo@kotnet.org>.
master
Richard Kreckel 17 years ago
parent
commit
69c2eee786
  1. 6
      ChangeLog
  2. 10
      src/base/cl_low.h
  3. 4
      src/base/low/cl_low_div.cc

6
ChangeLog

@ -1,3 +1,9 @@
2007-10-10 Richard B. Kreckel <kreckel@ginac.de>
* src/base/cl_low.h: Add missing linefeeds in SPARC 64 inline assembler.
* src/base/low/cl_low_div.cc (divu_6464_6464_): Fix a copy-paste typo.
Reported by Sven Verdoolaege <skimo@kotnet.org>.
2007-10-02 Richard B. Kreckel <kreckel@ginac.de> 2007-10-02 Richard B. Kreckel <kreckel@ginac.de>
On popular demand (Debian bug #286266, Ubuntu bug #128851): On popular demand (Debian bug #286266, Ubuntu bug #128851):

10
src/base/cl_low.h

@ -439,7 +439,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"wr %%g0,%%g0,%%y\n\t" \ "wr %%g0,%%g0,%%y\n\t" \
"udiv %2,%3,%0\n\t" \ "udiv %2,%3,%0\n\t" \
"umul %0,%3,%1" \
"umul %0,%3,%1\n\t" \
"sub %2,%1,%1" \ "sub %2,%1,%1" \
: "=&r" (__q), "=&r" (__r) \ : "=&r" (__q), "=&r" (__r) \
: "r" (__x), "r" (__y)); \ : "r" (__x), "r" (__y)); \
@ -528,7 +528,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"wr %%g0,%%g0,%%y\n\t" \ "wr %%g0,%%g0,%%y\n\t" \
"udiv %2,%3,%0\n\t" \ "udiv %2,%3,%0\n\t" \
"umul %0,%3,%1" \
"umul %0,%3,%1\n\t" \
"sub %2,%1,%1" \ "sub %2,%1,%1" \
: "=&r" (__q), "=&r" (__r) \ : "=&r" (__q), "=&r" (__r) \
: "r" (__x), "r" (__y)); \ : "r" (__x), "r" (__y)); \
@ -578,7 +578,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"wr %%g0,%%g0,%%y\n\t" \ "wr %%g0,%%g0,%%y\n\t" \
"udiv %2,%3,%0\n\t" \ "udiv %2,%3,%0\n\t" \
"umul %0,%3,%1" \
"umul %0,%3,%1\n\t" \
"sub %2,%1,%1" \ "sub %2,%1,%1" \
: "=&r" (__q), "=&r" (__r) \ : "=&r" (__q), "=&r" (__r) \
: "r" (__x), "r" (__y)); \ : "r" (__x), "r" (__y)); \
@ -690,7 +690,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"wr %2,%%g0,%%y\n\t" \ "wr %2,%%g0,%%y\n\t" \
"udiv %3,%4,%0\n\t" \ "udiv %3,%4,%0\n\t" \
"umul %0,%4,%1" \
"umul %0,%4,%1\n\t" \
"sub %3,%1,%1" \ "sub %3,%1,%1" \
: "=&r" (__q), "=&r" (__r) \ : "=&r" (__q), "=&r" (__r) \
: "r" (__xhi), "r" (__xlo), "r" (__y)); \ : "r" (__xhi), "r" (__xlo), "r" (__y)); \
@ -791,7 +791,7 @@ inline uint32 mulu32_unchecked (uint32 arg1, uint32 arg2)
__asm__ __volatile__ ( \ __asm__ __volatile__ ( \
"wr %2,%%g0,%%y\n\t" \ "wr %2,%%g0,%%y\n\t" \
"udiv %3,%4,%0\n\t" \ "udiv %3,%4,%0\n\t" \
"umul %0,%4,%1" \
"umul %0,%4,%1\n\t" \
"sub %3,%1,%1" \ "sub %3,%1,%1" \
: "=&r" (__q), "=&r" (__r) \ : "=&r" (__q), "=&r" (__r) \
: "r" (__xhi), "r" (__xlo), "r" (__y)); \ : "r" (__xhi), "r" (__xlo), "r" (__y)); \

4
src/base/low/cl_low_div.cc

@ -259,9 +259,9 @@ uint64 divu_6464_6464_(uint64 x, uint64 y)
} }
// q = floor(x1/(y1+1)) // q = floor(x1/(y1+1))
// x-q*y bilden (eine 32-mal-64-Bit-Multiplikation ohne Überlauf): // x-q*y bilden (eine 32-mal-64-Bit-Multiplikation ohne Überlauf):
x -= highlow64_0(mulu32_64(q,high32(y))); // q * high32(y) * beta
x -= highlow64_0(mulu32_w(q,high32(y))); // q * high32(y) * beta
// gefahrlos, da q*high32(y) <= q*y/beta <= x/beta < beta // gefahrlos, da q*high32(y) <= q*y/beta <= x/beta < beta
x -= mulu32_64(q,low32(y)); // q * low32(y)
x -= mulu32_w(q,low32(y)); // q * low32(y)
// gefahrlos, da q*high32(y)*beta + q*low32(y) = q*y <= x // gefahrlos, da q*high32(y)*beta + q*low32(y) = q*y <= x
// Noch höchstens 2 mal y abziehen: // Noch höchstens 2 mal y abziehen:
if (x >= y) if (x >= y)

Loading…
Cancel
Save