[llvm-commits] [llvm] r55482 - /llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Owen Anderson
resistor at mac.com
Thu Aug 28 11:26:01 PDT 2008
Author: resistor
Date: Thu Aug 28 13:26:01 2008
New Revision: 55482
URL: http://llvm.org/viewvc/llvm-project?rev=55482&view=rev
Log:
Hook up support for fast-isel of trunc instructions, using the newly working support for EXTRACT_SUBREG.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp?rev=55482&r1=55481&r2=55482&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FastISel.cpp Thu Aug 28 13:26:01 2008
@@ -366,6 +366,9 @@
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 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;
}
More information about the llvm-commits
mailing list