[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

Reid Spencer reid at x10sys.com
Wed Feb 21 16:59:01 PST 2007



Changes in directory llvm/lib/Support:

APInt.cpp updated: 1.30 -> 1.31
---
Log message:

When converting from 64 to 32-bits, use the actual number of words to
extract the value, not the number of words implied by the active bits.
This fixes numerous, but not all divide bugs.


---
Diffs of the changes:  (+2 -2)

 APInt.cpp |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Index: llvm/lib/Support/APInt.cpp
diff -u llvm/lib/Support/APInt.cpp:1.30 llvm/lib/Support/APInt.cpp:1.31
--- llvm/lib/Support/APInt.cpp:1.30	Wed Feb 21 18:22:00 2007
+++ llvm/lib/Support/APInt.cpp	Wed Feb 21 18:58:45 2007
@@ -1177,7 +1177,7 @@
   uint32_t *U = new uint32_t[m + n + 1];
   memset(U, 0, (m+n+1)*sizeof(uint32_t));
   for (unsigned i = 0; i < lhsWords; ++i) {
-    uint64_t tmp = (lhsWords == 1 ? LHS.VAL : LHS.pVal[i]);
+    uint64_t tmp = (LHS.getNumWords() == 1 ? LHS.VAL : LHS.pVal[i]);
     U[i * 2] = tmp & mask;
     U[i * 2 + 1] = tmp >> (sizeof(uint32_t)*8);
   }
@@ -1186,7 +1186,7 @@
   uint32_t *V = new uint32_t[n];
   memset(V, 0, (n)*sizeof(uint32_t));
   for (unsigned i = 0; i < rhsWords; ++i) {
-    uint64_t tmp = (rhsWords == 1 ? RHS.VAL : RHS.pVal[i]);
+    uint64_t tmp = (RHS.getNumWords() == 1 ? RHS.VAL : RHS.pVal[i]);
     V[i * 2] = tmp & mask;
     V[i * 2 + 1] = tmp >> (sizeof(uint32_t)*8);
   }






More information about the llvm-commits mailing list