本文整理汇总了C++中TypeNode::isFloatingPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ TypeNode::isFloatingPoint方法的具体用法?C++ TypeNode::isFloatingPoint怎么用?C++ TypeNode::isFloatingPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TypeNode
的用法示例。
在下文中一共展示了TypeNode::isFloatingPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeToFPGeneric
Node removeToFPGeneric (TNode node) {
Assert(node.getKind() == kind::FLOATINGPOINT_TO_FP_GENERIC);
FloatingPointToFPGeneric info = node.getOperator().getConst<FloatingPointToFPGeneric>();
size_t children = node.getNumChildren();
Node op;
if (children == 1) {
op = NodeManager::currentNM()->mkConst(FloatingPointToFPIEEEBitVector(info.t.exponent(),
info.t.significand()));
return NodeManager::currentNM()->mkNode(op, node[0]);
} else {
Assert(children == 2);
Assert(node[0].getType().isRoundingMode());
TypeNode t = node[1].getType();
if (t.isFloatingPoint()) {
op = NodeManager::currentNM()->mkConst(FloatingPointToFPFloatingPoint(info.t.exponent(),
info.t.significand()));
} else if (t.isReal()) {
op = NodeManager::currentNM()->mkConst(FloatingPointToFPReal(info.t.exponent(),
info.t.significand()));
} else if (t.isBitVector()) {
op = NodeManager::currentNM()->mkConst(FloatingPointToFPSignedBitVector(info.t.exponent(),
info.t.significand()));
} else {
throw TypeCheckingExceptionPrivate(node, "cannot rewrite to_fp generic due to incorrect type of second argument");
}
return NodeManager::currentNM()->mkNode(op, node[0], node[1]);
}
Unreachable("to_fp generic not rewritten");
}