don't be a doofus - this fixes storing bools

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25274 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duraid Madina 2006-01-13 10:28:25 +00:00
parent 140d53c99c
commit 544cbbd479

View File

@ -571,9 +571,12 @@ SDOperand IA64DAGToDAGISel::Select(SDOperand Op) {
default: assert(0 && "unknown type in store");
case MVT::i1: { // this is a bool
Opc = IA64::ST1; // we store either 0 or 1 as a byte
// first load zero!
SDOperand Initial = CurDAG->getCopyFromReg(Chain, IA64::r0, MVT::i64);
Chain = Initial.getValue(1);
// then load 1 iff the predicate to store is 1
SDOperand Tmp =
CurDAG->getTargetNode(IA64::PADDS, MVT::i64,
CurDAG->getRegister(IA64::r0, MVT::i64),
CurDAG->getTargetNode(IA64::PADDS, MVT::i64, Initial,
CurDAG->getConstant(1, MVT::i64),
Select(N->getOperand(1)));
return CurDAG->SelectNodeTo(N, Opc, MVT::Other, Address, Tmp, Chain);