本文整理汇总了C++中tr::Register::setIsSinglePrecision方法的典型用法代码示例。如果您正苦于以下问题:C++ Register::setIsSinglePrecision方法的具体用法?C++ Register::setIsSinglePrecision怎么用?C++ Register::setIsSinglePrecision使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tr::Register
的用法示例。
在下文中一共展示了Register::setIsSinglePrecision方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cg
//.........这里部分代码省略.........
returnKind = TR_FPR;
break;
case TR::Aggregate:
default:
TR_ASSERT(false, "Unrecognized call node data type: #%d", (int)callNode->getDataType());
break;
}
// Kill all non-preserved int and float regs besides the return register.
//
int32_t i;
TR::RealRegister::RegNum scratchIndex = getProperties().getIntegerScratchRegister(1);
for (i=0; i<getProperties().getNumVolatileRegisters(); i++)
{
TR::RealRegister::RegNum regIndex = getProperties()._volatileRegisters[i];
if (regIndex != returnRegIndex)
{
TR_RegisterKinds rk = (i < getProperties()._numberOfVolatileGPRegisters) ? TR_GPR : TR_FPR;
TR::Register *dummy = cg()->allocateRegister(rk);
deps->addPostCondition(dummy, regIndex, cg());
// Note that we don't setPlaceholderReg here. If this volatile reg is also volatile
// in the caller's linkage, then that flag doesn't matter much anyway. If it's preserved
// in the caller's linkage, then we don't want to set that flag because we want this
// use of the register to count as a "real" use, thereby motivating the prologue to
// preserve the register.
// A scratch register is necessary to call the native without a trampoline.
//
if (callNode->getOpCode().isIndirect() || (regIndex != scratchIndex))
cg()->stopUsingRegister(dummy);
}
}
#if defined (PYTHON) && 0
// Evict the preserved registers across the call
//
for (i=0; i<getProperties().getNumberOfPreservedGPRegisters(); i++)
{
TR::RealRegister::RegNum regIndex = getProperties()._preservedRegisters[i];
TR::Register *dummy = cg()->allocateRegister(TR_GPR);
deps->addPostCondition(dummy, regIndex, cg());
// Note that we don't setPlaceholderReg here. If this volatile reg is also volatile
// in the caller's linkage, then that flag doesn't matter much anyway. If it's preserved
// in the caller's linkage, then we don't want to set that flag because we want this
// use of the register to count as a "real" use, thereby motivating the prologue to
// preserve the register.
// A scratch register is necessary to call the native without a trampoline.
//
if (callNode->getOpCode().isIndirect() || (regIndex != scratchIndex))
cg()->stopUsingRegister(dummy);
}
#endif
if (callNode->getOpCode().isIndirect())
{
TR::Node *vftChild = callNode->getFirstChild();
if (vftChild->getRegister() && (vftChild->getReferenceCount() > 1))
{
// VFT child survives the call, so we must include it in the postconditions.
deps->addPostCondition(vftChild->getRegister(), TR::RealRegister::NoReg, cg());
cg()->recursivelyDecReferenceCount(vftChild);
}
}
// Now that everything is dead, we can allocate the return register without
// interference
//
TR::Register *returnRegister;
if (returnRegIndex)
{
TR_ASSERT(returnKind != TR_NoRegister, "assertion failure");
if (callNode->getDataType() == TR::Address)
returnRegister = cg()->allocateCollectedReferenceRegister();
else
{
returnRegister = cg()->allocateRegister(returnKind);
if (callNode->getDataType() == TR::Float)
returnRegister->setIsSinglePrecision();
}
deps->addPostCondition(returnRegister, returnRegIndex, cg());
}
else
returnRegister = NULL;
// The reg dependency is left open intentionally, and need to be closed by
// the caller. The reason is because, child class might call this method, while
// adding more register dependecies; if we close the reg dependency here,
// the child class won't be able to add more register dependencies.
return returnRegister;
}