mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-19 04:29:21 +00:00
Undo the last change and make this really implement remainder and not
modulus. The previous change was a result of incorrect documentation in the LangRef.html. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35305 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9f992aec98
commit
d3af825d29
@ -552,9 +552,11 @@ public:
|
|||||||
return this->udiv(RHS);
|
return this->udiv(RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Perform an Unsigned remainder operation on this APInt with RHS being the
|
/// Perform an unsigned remainder operation on this APInt with RHS being the
|
||||||
/// divisor. Both this and RHS are treated as unsigned quantities for purposes
|
/// divisor. Both this and RHS are treated as unsigned quantities for purposes
|
||||||
/// of this operation.
|
/// of this operation. Note that this is a true remainder operation and not
|
||||||
|
/// a modulo operation because the sign follows the sign of the dividend
|
||||||
|
/// which is *this.
|
||||||
/// @returns a new APInt value containing the remainder result
|
/// @returns a new APInt value containing the remainder result
|
||||||
/// @brief Unsigned remainder operation.
|
/// @brief Unsigned remainder operation.
|
||||||
APInt urem(const APInt& RHS) const;
|
APInt urem(const APInt& RHS) const;
|
||||||
@ -566,9 +568,9 @@ public:
|
|||||||
if (RHS.isNegative())
|
if (RHS.isNegative())
|
||||||
return -((-(*this)).urem(-RHS));
|
return -((-(*this)).urem(-RHS));
|
||||||
else
|
else
|
||||||
return (-(*this)).urem(RHS);
|
return -(-(*this)).urem(RHS);
|
||||||
else if (RHS.isNegative())
|
else if (RHS.isNegative())
|
||||||
return -(this->urem(-RHS));
|
return this->urem(-RHS);
|
||||||
return this->urem(RHS);
|
return this->urem(RHS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user