mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
Constant folding support for calls to umul.with.overflow(), basically identical to the smul.with.overflow() code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128379 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2078,6 +2078,16 @@ APInt APInt::smul_ov(const APInt &RHS, bool &Overflow) const {
|
||||
return Res;
|
||||
}
|
||||
|
||||
APInt APInt::umul_ov(const APInt &RHS, bool &Overflow) const {
|
||||
APInt Res = *this * RHS;
|
||||
|
||||
if (*this != 0 && RHS != 0)
|
||||
Overflow = Res.udiv(RHS) != *this || Res.udiv(*this) != RHS;
|
||||
else
|
||||
Overflow = false;
|
||||
return Res;
|
||||
}
|
||||
|
||||
APInt APInt::sshl_ov(unsigned ShAmt, bool &Overflow) const {
|
||||
Overflow = ShAmt >= getBitWidth();
|
||||
if (Overflow)
|
||||
|
||||
Reference in New Issue
Block a user