summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-23 00:16:34 +0000
committerChris Lattner <sabre@nondot.org>2005-12-23 00:16:34 +0000
commit36e663d6e1db6d21075d869e82eec12bf2e71cd3 (patch)
treef0a6c7f1d99766cd958e0d1b877f3d7018cb508f /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parentbc1be55abced9039beb20d3ac0e5be1e76b1506d (diff)
downloadbcm5719-llvm-36e663d6e1db6d21075d869e82eec12bf2e71cd3.tar.gz
bcm5719-llvm-36e663d6e1db6d21075d869e82eec12bf2e71cd3.zip
add very simple support for the BIT_CONVERT node
llvm-svn: 24970
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index c17937d05eb..ec75dfee32a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -889,6 +889,12 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT,
return Operand.Val->getOperand(0);
}
break;
+ case ISD::BIT_CONVERT:
+ // Basic sanity checking.
+ assert(MVT::getSizeInBits(VT)==MVT::getSizeInBits(Operand.getValueType()) &&
+ "Cannot BIT_CONVERT between two different types!");
+ if (VT == Operand.getValueType()) return Operand; // noop conversion.
+ break;
case ISD::FNEG:
if (OpOpcode == ISD::FSUB) // -(X-Y) -> (Y-X)
return getNode(ISD::FSUB, VT, Operand.Val->getOperand(1),
@@ -1931,6 +1937,7 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const {
case ISD::UINT_TO_FP: return "uint_to_fp";
case ISD::FP_TO_SINT: return "fp_to_sint";
case ISD::FP_TO_UINT: return "fp_to_uint";
+ case ISD::BIT_CONVERT: return "bit_convert";
// Control flow instructions
case ISD::BR: return "br";
OpenPOWER on IntegriCloud