本文整理汇总了C++中SValuePtr::get_width方法的典型用法代码示例。如果您正苦于以下问题:C++ SValuePtr::get_width方法的具体用法?C++ SValuePtr::get_width怎么用?C++ SValuePtr::get_width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SValuePtr
的用法示例。
在下文中一共展示了SValuePtr::get_width方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: undefined_
BaseSemantics::SValuePtr
RiscOperators::concat(const BaseSemantics::SValuePtr &a_, const BaseSemantics::SValuePtr &b_)
{
SValuePtr a = SValue::promote(a_);
SValuePtr b = SValue::promote(b_);
return undefined_(a->get_width() + b->get_width());
}
示例2: if
Sawyer::Optional<BaseSemantics::SValuePtr>
SValue::createOptionalMerge(const BaseSemantics::SValuePtr &other_, const BaseSemantics::MergerPtr &merger,
const SmtSolverPtr &solver) const {
SValuePtr other = SValue::promote(other_);
SValuePtr retval = create_empty(other->get_width());
bool changed = false;
for (size_t i=0; i<subvalues.size(); ++i) {
BaseSemantics::SValuePtr thisValue = subvalues[i];
BaseSemantics::SValuePtr otherValue = other->subvalues[i];
if (otherValue) {
if (thisValue==NULL) {
retval->subvalues.push_back(otherValue);
changed = true;
} else if (BaseSemantics::SValuePtr mergedValue =
thisValue->createOptionalMerge(otherValue, merger, solver).orDefault()) {
changed = true;
retval->subvalues.push_back(mergedValue);
} else {
retval->subvalues.push_back(thisValue);
}
} else {
retval->subvalues.push_back(thisValue);
}
}
return changed ? Sawyer::Optional<BaseSemantics::SValuePtr>(retval) : Sawyer::Nothing();
}
示例3:
SValuePtr
SymbolicMemory::readMemory(const SValuePtr &address_, const SValuePtr &dflt, RiscOperators *addrOps, RiscOperators *valOps) {
using namespace InsnSemanticsExpr;
SymbolicSemantics::SValuePtr address = SymbolicSemantics::SValue::promote(address_);
if (address->get_width() != mem_->domainWidth() || dflt->get_width() != mem_->get_nbits()) {
ASSERT_require2(mem_->isLeafNode() && mem_->isLeafNode()->is_memory(),
"invalid address and/or value size for memory; expecting " +
StringUtility::numberToString(mem_->domainWidth()) + "-bit addresses and " +
StringUtility::numberToString(mem_->get_nbits()) + "-bit values");
// We can finalize the domain and range widths for the memory now that they've been given.
mem_ = LeafNode::create_memory(address->get_width(), dflt->get_width());
}
TreeNodePtr resultExpr = InternalNode::create(8, OP_READ, mem_, address->get_expression());
SymbolicSemantics::SValuePtr retval = SymbolicSemantics::SValue::promote(dflt->copy());
retval->set_expression(resultExpr);
return retval;
}