summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2005-04-01 01:08:07 +0000
committerNate Begeman <natebegeman@mac.com>2005-04-01 01:08:07 +0000
commit508aac2ca80f3a9849ff4b802674eca00cd88565 (patch)
treefc16df56201a39425cdd030de84d56dd6de6990d /llvm/lib
parent4f3a9860d3c34e42eb89bf3166708705a6b9bce6 (diff)
downloadbcm5719-llvm-508aac2ca80f3a9849ff4b802674eca00cd88565.tar.gz
bcm5719-llvm-508aac2ca80f3a9849ff4b802674eca00cd88565.zip
Add support for adding 0.0 and -0.0 to the constant pool, since we lie and
say that we support them, for the purposes of generating fsel instructions. llvm-svn: 20970
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
index fd4d89db2f3..558232669e7 100644
--- a/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
+++ b/llvm/lib/Target/PowerPC/PPC32ISelPattern.cpp
@@ -760,9 +760,17 @@ unsigned ISel::SelectExprFP(SDOperand N, unsigned Result)
BuildMI(BB, PPC::FMR, 1, Result).addReg(Tmp1);
return Result;
- case ISD::ConstantFP:
- assert(0 && "ISD::ConstantFP Unimplemented");
- abort();
+ case ISD::ConstantFP: {
+ Tmp1 = MakeReg(MVT::i32);
+ ConstantFPSDNode *CN = cast<ConstantFPSDNode>(N);
+ MachineConstantPool *CP = BB->getParent()->getConstantPool();
+ ConstantFP *CFP = ConstantFP::get(Type::DoubleTy, CN->getValue());
+ unsigned CPI = CP->getConstantPoolIndex(CFP);
+ BuildMI(BB, PPC::LOADHiAddr, 2, Tmp1).addReg(getGlobalBaseReg())
+ .addConstantPoolIndex(CPI);
+ BuildMI(BB, PPC::LFD, 2, Result).addConstantPoolIndex(CPI).addReg(Tmp1);
+ return Result;
+ }
case ISD::MUL:
case ISD::ADD:
OpenPOWER on IntegriCloud