projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
5957d8f
)
Correct the implementation of srem to be remainder, not modulus. The sign of
author
Reid Spencer
<rspencer@reidspencer.com>
Sat, 24 Mar 2007 21:56:22 +0000
(21:56 +0000)
committer
Reid Spencer
<rspencer@reidspencer.com>
Sat, 24 Mar 2007 21:56:22 +0000
(21:56 +0000)
the result must follow the sign of the divisor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35302
91177308
-0d34-0410-b5e6-
96231b3b80d8
include/llvm/ADT/APInt.h
patch
|
blob
|
history
diff --git
a/include/llvm/ADT/APInt.h
b/include/llvm/ADT/APInt.h
index 44b5fd0403f2de1ba2ea0f52bafcbe5b4155be37..52509ed000c94b9e3920b8b30c38376cd13ec65a 100644
(file)
--- a/
include/llvm/ADT/APInt.h
+++ b/
include/llvm/ADT/APInt.h
@@
-564,9
+564,9
@@
public:
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);