diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-28 18:26:01 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-28 18:26:01 +0000 |
commit | d8a82b75e2f0ba10acf601505a7db99ee6910fe3 (patch) | |
tree | 16f5fd7b7c028c13c7cbf2be60f2c0312617b17c /llvm/lib/CodeGen | |
parent | 787f100462cb01d3946b0f7edea96ec2e6c8aec3 (diff) | |
download | bcm5719-llvm-d8a82b75e2f0ba10acf601505a7db99ee6910fe3.tar.gz bcm5719-llvm-d8a82b75e2f0ba10acf601505a7db99ee6910fe3.zip |
Hook up support for fast-isel of trunc instructions, using the newly working support for EXTRACT_SUBREG.
llvm-svn: 55482
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index 4dbfadcd160..9fa37b16c4b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -366,6 +366,9 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, case Instruction::SExt: if (!SelectCast(I, ISD::SIGN_EXTEND, ValueMap)) return I; break; + case Instruction::Trunc: + if (!SelectCast(I, ISD::TRUNCATE, ValueMap)) return I; + break; case Instruction::SIToFP: if (!SelectCast(I, ISD::SINT_TO_FP, ValueMap)) return I; break; @@ -594,6 +597,6 @@ unsigned FastISel::FastEmitInst_extractsubreg(unsigned Op0, uint32_t Idx) { unsigned ResultReg = createResultReg(SRC); const TargetInstrDesc &II = TII.get(TargetInstrInfo::EXTRACT_SUBREG); - BuildMI(MBB, II, ResultReg).addReg(Op0); + BuildMI(MBB, II, ResultReg).addReg(Op0).addImm(Idx); return ResultReg; } |