mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1176864 - Truncate modulo operator for int32 r=h4writer, r=nbp
This commit is contained in:
parent
c474a69974
commit
e8615dcf20
@ -2902,10 +2902,13 @@ ComputeTruncateKind(MDefinition* candidate, bool* shouldClone)
|
||||
const Range* r = candidate->range();
|
||||
bool canHaveRoundingErrors = !r || r->canHaveRoundingErrors();
|
||||
|
||||
// Special case integer division: the result of a/b can be infinite
|
||||
// but cannot actually have rounding errors induced by truncation.
|
||||
if (candidate->isDiv() && candidate->toDiv()->specialization() == MIRType_Int32)
|
||||
// Special case integer division and modulo: a/b can be infinite, and a%b
|
||||
// can be NaN but cannot actually have rounding errors induced by truncation.
|
||||
if ((candidate->isDiv() || candidate->isMod()) &&
|
||||
static_cast<const MBinaryArithInstruction *>(candidate)->specialization() == MIRType_Int32)
|
||||
{
|
||||
canHaveRoundingErrors = false;
|
||||
}
|
||||
|
||||
if (canHaveRoundingErrors)
|
||||
return MDefinition::NoTruncate;
|
||||
|
Loading…
Reference in New Issue
Block a user