mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-23 15:29:51 +00:00
Correct the implementation of srem to be remainder, not modulus. The sign of
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
This commit is contained in:
parent
5957d8ffd8
commit
53c9520b23
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user