diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-20 00:23:20 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-20 00:23:20 +0000 |
commit | b16a7783c5ce292443cbef50cc8deaf97811477f (patch) | |
tree | 82b940d55e3227195cbc61459c3fe5c112e093b1 /llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | |
parent | a3e4d5a5e149e2e222b84f10faed665fbc088119 (diff) | |
download | bcm5719-llvm-b16a7783c5ce292443cbef50cc8deaf97811477f.tar.gz bcm5719-llvm-b16a7783c5ce292443cbef50cc8deaf97811477f.zip |
Add FastISel support for floating-point operations.
llvm-svn: 55021
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index f3fcaec28c3..996cea0155c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -36,6 +36,7 @@ bool FastISel::SelectBinaryOp(Instruction *I, ISD::NodeType ISDOpcode, // the given ISD opcode and type. Halt "fast" selection and bail. return false; + // We successfully emitted code for the given LLVM Instruction. ValueMap[I] = ResultReg; return true; } @@ -53,12 +54,18 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, BasicBlock::iterator En for (; I != End; ++I) { switch (I->getOpcode()) { - case Instruction::Add: - if (!SelectBinaryOp(I, ISD::ADD, ValueMap)) return I; break; - case Instruction::Sub: - if (!SelectBinaryOp(I, ISD::SUB, ValueMap)) return I; break; - case Instruction::Mul: - if (!SelectBinaryOp(I, ISD::MUL, ValueMap)) return I; break; + case Instruction::Add: { + ISD::NodeType Opc = I->getType()->isFPOrFPVector() ? ISD::FADD : ISD::ADD; + if (!SelectBinaryOp(I, Opc, ValueMap)) return I; break; + } + case Instruction::Sub: { + ISD::NodeType Opc = I->getType()->isFPOrFPVector() ? ISD::FSUB : ISD::SUB; + if (!SelectBinaryOp(I, Opc, ValueMap)) return I; break; + } + case Instruction::Mul: { + ISD::NodeType Opc = I->getType()->isFPOrFPVector() ? ISD::FMUL : ISD::MUL; + if (!SelectBinaryOp(I, Opc, ValueMap)) return I; break; + } case Instruction::SDiv: if (!SelectBinaryOp(I, ISD::SDIV, ValueMap)) return I; break; case Instruction::UDiv: |