diff options
| author | Nate Begeman <natebegeman@mac.com> | 2005-04-01 01:08:07 +0000 |
|---|---|---|
| committer | Nate Begeman <natebegeman@mac.com> | 2005-04-01 01:08:07 +0000 |
| commit | 508aac2ca80f3a9849ff4b802674eca00cd88565 (patch) | |
| tree | fc16df56201a39425cdd030de84d56dd6de6990d /llvm/lib | |
| parent | 4f3a9860d3c34e42eb89bf3166708705a6b9bce6 (diff) | |
| download | bcm5719-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.cpp | 14 |
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: |

