本文整理汇总了C++中tr::Node::setDecimalPrecision方法的典型用法代码示例。如果您正苦于以下问题:C++ Node::setDecimalPrecision方法的具体用法?C++ Node::setDecimalPrecision怎么用?C++ Node::setDecimalPrecision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::Node
的用法示例。
在下文中一共展示了Node::setDecimalPrecision方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: traceMsg
TR::Node *
OMR::TransformUtil::scalarizeAddressParameter(
TR::Compilation *comp,
TR::Node *address,
size_t byteLengthOrPrecision, // precision for BCD types and byteLength for all other types
TR::DataType dataType,
TR::SymbolReference *ref,
bool store)
{
TR_ASSERT(ref,"symRef should not be NULL in scalarizeAddressParameter for address node %p\n",address);
TR::Node * loadOrStore = NULL;
#ifdef J9_PROJECT_SPECIFIC
size_t byteLength = dataType.isBCD() ? TR::DataType::getSizeFromBCDPrecision(dataType, byteLengthOrPrecision) : byteLengthOrPrecision;
#else
size_t byteLength = byteLengthOrPrecision;
#endif
bool isLengthValidForDirect = false;
if (address->getOpCodeValue() == TR::loadaddr &&
address->getOpCode().hasSymbolReference() &&
address->getSymbolReference() &&
!address->getSymbol()->isStatic())
{
if (byteLength == address->getSymbol()->getSize())
isLengthValidForDirect = true;
}
if (address->getOpCodeValue() == TR::loadaddr &&
!address->getSymbol()->isStatic() &&
isLengthValidForDirect &&
address->getSymbolReference() == ref &&
ref->getSymbol()->getDataType() == dataType)
{
if (comp->getOption(TR_TraceScalarizeSSOps))
traceMsg(comp,"\n\tscalarizeAddressParameter auto direct case: address %p, dt %s\n",address,dataType.toString());
TR::ILOpCodes opcode = store ? comp->il.opCodeForDirectStore(dataType)
: comp->il.opCodeForDirectLoad(dataType);
loadOrStore = TR::Node::create(address, opcode, store ? 1 : 0);
loadOrStore->setSymbolReference(ref);
}
else
{
TR::ILOpCodes opcode = store ? comp->il.opCodeForIndirectArrayStore(dataType)
: comp->il.opCodeForIndirectArrayLoad(dataType);
loadOrStore = TR::Node::create(address, opcode, store ? 2 : 1);
loadOrStore->setSymbolReference(ref);
loadOrStore->setAndIncChild(0, address);
}
if (byteLength == 8)
{
comp->getJittedMethodSymbol()->setMayHaveLongOps(true);
}
#ifdef J9_PROJECT_SPECIFIC
if (loadOrStore->getType().isBCD())
{
loadOrStore->setDecimalPrecision(byteLengthOrPrecision);
}
else
#endif
if (!store && loadOrStore->getType().isIntegral() && !loadOrStore->getType().isInt64())
{
loadOrStore->setUnsigned(true);
}
return loadOrStore;
}