1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

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
This commit is contained in:
Nate Begeman 2005-04-01 01:08:07 +00:00
parent 18b3394f4d
commit 552f6f5f4e

View File

@ -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: