本文整理汇总了C++中MDefinition::isBitNot方法的典型用法代码示例。如果您正苦于以下问题:C++ MDefinition::isBitNot方法的具体用法?C++ MDefinition::isBitNot怎么用?C++ MDefinition::isBitNot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDefinition
的用法示例。
在下文中一共展示了MDefinition::isBitNot方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
EdgeCaseAnalysis::AllUsesTruncate(MInstruction *m)
{
for (MUseIterator use = m->usesBegin(); use != m->usesEnd(); use++) {
// See #809485 why this is allowed
if (use->node()->isResumePoint())
continue;
MDefinition *def = use->node()->toDefinition();
if (def->isTruncateToInt32())
continue;
if (def->isBitAnd())
continue;
if (def->isBitOr())
continue;
if (def->isBitXor())
continue;
if (def->isLsh())
continue;
if (def->isRsh())
continue;
if (def->isBitNot())
continue;
if (def->isAdd() && def->toAdd()->isTruncated())
continue;
if (def->isSub() && def->toSub()->isTruncated())
continue;
// cannot use divide, since |truncate(int32(x/y) + int32(a/b)) != truncate(x/y+a/b)|
return false;
}
return true;
}
示例2: New
MDefinition *
MBitNot::foldsTo(bool useValueNumbers)
{
if (specialization_ != MIRType_Int32)
return this;
MDefinition *input = getOperand(0);
if (input->isConstant()) {
js::Value v = Int32Value(~(input->toConstant()->value().toInt32()));
return MConstant::New(v);
}
if (input->isBitNot())
return input->getOperand(0); // ~~x => x
return this;
}
示例3: Max
int
EdgeCaseAnalysis::AllUsesTruncate(MInstruction *m)
{
// If all uses truncate, the return value must be at least 1. If anything doesn't truncate
// 0 is explicitly returned.
int ret = 1;
for (MUseIterator use = m->usesBegin(); use != m->usesEnd(); use++) {
// See #809485 why this is allowed
if (use->node()->isResumePoint())
continue;
MDefinition *def = use->node()->toDefinition();
if (def->isTruncateToInt32())
continue;
if (def->isBitAnd())
continue;
if (def->isBitOr())
continue;
if (def->isBitXor())
continue;
if (def->isLsh())
continue;
if (def->isRsh())
continue;
if (def->isBitNot())
continue;
if (def->isAdd() && def->toAdd()->isTruncated()) {
ret = Max(ret, def->toAdd()->isTruncated() + 1);
continue;
}
if (def->isSub() && def->toSub()->isTruncated()) {
ret = Max(ret, def->toSub()->isTruncated() + 1);
continue;
}
// cannot use divide, since |truncate(int32(x/y) + int32(a/b)) != truncate(x/y+a/b)|
return 0;
}
return ret;
}