add support for loading bools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24182 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/lib/Target/IA64/IA64ISelDAGToDAG.cpp
index 9b26a25..129d381 100644
--- a/lib/Target/IA64/IA64ISelDAGToDAG.cpp
+++ b/lib/Target/IA64/IA64ISelDAGToDAG.cpp
@@ -369,7 +369,13 @@
unsigned Opc;
switch (TypeBeingLoaded) {
default: N->dump(); assert(0 && "Cannot load this type!");
- // FIXME: bools? case MVT::i1:
+ case MVT::i1: { // this is a bool
+ Opc = IA64::LD1; // first we load a byte, then compare for != 0
+ CurDAG->SelectNodeTo(N, IA64::CMPNE, MVT::i1, MVT::Other,
+ CurDAG->getTargetNode(Opc, MVT::i64, Address),
+ CurDAG->getRegister(IA64::r0, MVT::i64), Chain);
+ return SDOperand(N, Op.ResNo); // XXX: early exit
+ }
case MVT::i8: Opc = IA64::LD1; break;
case MVT::i16: Opc = IA64::LD2; break;
case MVT::i32: Opc = IA64::LD4; break;