[llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h
Reid Spencer
reid at x10sys.com
Sat Mar 24 14:56:39 PDT 2007
Changes in directory llvm/include/llvm/ADT:
APInt.h updated: 1.47 -> 1.48
---
Log message:
Correct the implementation of srem to be remainder, not modulus. The sign of
the result must follow the sign of the divisor.
---
Diffs of the changes: (+2 -2)
APInt.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Index: llvm/include/llvm/ADT/APInt.h
diff -u llvm/include/llvm/ADT/APInt.h:1.47 llvm/include/llvm/ADT/APInt.h:1.48
--- llvm/include/llvm/ADT/APInt.h:1.47 Sat Mar 24 13:09:18 2007
+++ llvm/include/llvm/ADT/APInt.h Sat Mar 24 16:56:22 2007
@@ -564,9 +564,9 @@
inline APInt srem(const APInt& RHS) const {
if (isNegative())
if (RHS.isNegative())
- return (-(*this)).urem(-RHS);
+ return -((-(*this)).urem(-RHS));
else
- return -((-(*this)).urem(RHS));
+ return (-(*this)).urem(RHS);
else if (RHS.isNegative())
return -(this->urem(-RHS));
return this->urem(RHS);
More information about the llvm-commits
mailing list