本文整理汇总了C++中UlamValue::setUlamValueTypeIdx方法的典型用法代码示例。如果您正苦于以下问题:C++ UlamValue::setUlamValueTypeIdx方法的具体用法?C++ UlamValue::setUlamValueTypeIdx怎么用?C++ UlamValue::setUlamValueTypeIdx使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UlamValue
的用法示例。
在下文中一共展示了UlamValue::setUlamValueTypeIdx方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: makeUlamValuePtr
UlamValue NodeInstanceof::makeUlamValuePtr()
{
// (from NodeVarDecl's makeUlamValuePtr)
UlamValue ptr;
UlamValue atomuv;
UTI auti = getOfType();
UlamType * aut = m_state.getUlamTypeByIndex(auti);
ULAMCLASSTYPE aclasstype = aut->getUlamClassType();
u32 atop = 1;
atop = m_state.m_funcCallStack.getAbsoluteStackIndexOfSlot(atop);
if(m_state.isAtom(auti))
atomuv = UlamValue::makeAtom(auti);
else if(aclasstype == UC_ELEMENT)
atomuv = UlamValue::makeDefaultAtom(auti, m_state);
else if(aclasstype == UC_QUARK)
{
u32 dq = 0;
AssertBool isDefinedQuark = m_state.getDefaultQuark(auti, dq); //returns scalar dq
assert(isDefinedQuark);
atomuv = UlamValue::makeImmediateClass(auti, dq, aut->getTotalBitSize());
}
else if(aclasstype == UC_TRANSIENT)
atomuv = UlamValue::makeDefaultAtom(auti, m_state); //size limited to atom for eval
else
m_state.abortUndefinedUlamClassType();
m_state.m_funcCallStack.storeUlamValueAtStackIndex(atomuv, atop); //stackframeslotindex ?
ptr = UlamValue::makePtr(atop, STACK, auti, m_state.determinePackable(auti), m_state, 0);
ptr.setUlamValueTypeIdx(PtrAbs);
return ptr;
} //makeUlamValuePtr
示例2: makeImmediateBinaryOp
UlamValue NodeBinaryOpArithDivide::makeImmediateBinaryOp(UTI type, u32 ldata, u32 rdata, u32 len)
{
UlamValue rtnUV;
if(rdata == 0)
{
MSG(getNodeLocationAsString().c_str(), "Possible Divide By Zero Attempt", ERR);
rtnUV.setUlamValueTypeIdx(Nav);
setNodeType(Nav); //compiler counts
return rtnUV;
}
ULAMTYPE typEnum = m_state.getUlamTypeByIndex(type)->getUlamTypeEnum();
switch(typEnum)
{
case Int:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideInt32(ldata, rdata, len), len);
break;
case Unsigned:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideUnsigned32(ldata, rdata, len), len);
break;
case Bool:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideBool32(ldata, rdata, len), len);
break;
case Unary:
rtnUV = UlamValue::makeImmediate(type, _BinOpDivideUnary32(ldata, rdata, len), len);
break;
case Bits:
default:
m_state.abortUndefinedUlamPrimitiveType();
break;
};
return rtnUV;
} //makeImmediateBinaryOp
示例3: makeImmediateLongBinaryOp
UlamValue NodeBinaryOpArithRemainder::makeImmediateLongBinaryOp(UTI type, u64 ldata, u64 rdata, u32 len)
{
UlamValue rtnUV;
if(rdata == 0)
{
MSG(getNodeLocationAsString().c_str(), "Possible Division By Zero Attempt in Modulus", ERR);
rtnUV.setUlamValueTypeIdx(Nav);
setNodeType(Nav); //compiler counts
return rtnUV;
}
ULAMTYPE typEnum = m_state.getUlamTypeByIndex(type)->getUlamTypeEnum();
switch(typEnum)
{
case Int:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModInt64(ldata, rdata, len), len);
break;
case Unsigned:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModUnsigned64(ldata, rdata, len), len);
break;
case Bool:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModBool64(ldata, rdata, len), len);
break;
case Unary:
rtnUV = UlamValue::makeImmediateLong(type, _BinOpModUnary64(ldata, rdata, len), len);
break;
case Bits:
default:
assert(0);
break;
};
return rtnUV;
} //makeImmediateLongBinaryOp
示例4: appendBinaryOp
void NodeBinaryOpArithDivide::appendBinaryOp(UlamValue& refUV, u32 ldata, u32 rdata, u32 pos, u32 len)
{
if(rdata == 0)
{
MSG(getNodeLocationAsString().c_str(), "Possible Divide By Zero Attempt", ERR);
refUV.setUlamValueTypeIdx(Nav);
setNodeType(Nav); //compiler counts
return;
}
UTI type = refUV.getUlamValueTypeIdx();
ULAMTYPE typEnum = m_state.getUlamTypeByIndex(type)->getUlamTypeEnum();
switch(typEnum)
{
case Int:
refUV.putData(pos, len, _BinOpDivideInt32(ldata, rdata, len));
break;
case Unsigned:
refUV.putData(pos, len, _BinOpDivideUnsigned32(ldata, rdata, len));
break;
case Bool:
refUV.putData(pos, len, _BinOpDivideBool32(ldata, rdata, len));
break;
case Unary:
refUV.putData(pos, len, _BinOpDivideUnary32(ldata, rdata, len));
break;
case Bits:
default:
m_state.abortUndefinedUlamPrimitiveType();
break;
};
return;
} //appendBinaryOp
示例5: makeUlamValuePtr
UlamValue NodeConstantArray::makeUlamValuePtr()
{
UTI nuti = getNodeType();
UlamType * nut = m_state.getUlamTypeByIndex(nuti);
assert(m_constSymbol);
assert(((SymbolConstantValue *) m_constSymbol)->getConstantStackFrameAbsoluteSlotIndex() > 0);
UlamValue absptr = UlamValue::makePtr(((SymbolConstantValue *) m_constSymbol)->getConstantStackFrameAbsoluteSlotIndex(), CNSTSTACK, nuti, nut->getPackable(), m_state, 0, m_constSymbol->getId());
absptr.setUlamValueTypeIdx(PtrAbs);
return absptr;
}