mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-01 15:11:24 +00:00
Add a helper method that will be used to support EXTRACT_SUBREG for selecting trunc's in fast-isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55439 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1dd0086b06
commit
8970f00def
@ -193,6 +193,11 @@ protected:
|
||||
const TargetRegisterClass *RC,
|
||||
uint64_t Imm);
|
||||
|
||||
/// FastEmitInst_extractsubreg - Emit a MachineInstr for an extract_subreg
|
||||
/// from a specified index of a superregister.
|
||||
unsigned FastEmitInst_extractsubreg(const TargetRegisterClass *RC,
|
||||
unsigned Op0, uint32_t Idx);
|
||||
|
||||
private:
|
||||
unsigned getRegForValue(Value *V,
|
||||
DenseMap<const Value*, unsigned> &ValueMap);
|
||||
|
@ -586,3 +586,14 @@ unsigned FastISel::FastEmitInst_i(unsigned MachineInstOpcode,
|
||||
BuildMI(MBB, II, ResultReg).addImm(Imm);
|
||||
return ResultReg;
|
||||
}
|
||||
|
||||
unsigned FastISel::FastEmitInst_extractsubreg(const TargetRegisterClass *RC,
|
||||
unsigned Op0, uint32_t Idx) {
|
||||
const TargetRegisterClass* SRC = *(RC->subregclasses_begin()+Idx-1);
|
||||
|
||||
unsigned ResultReg = createResultReg(SRC);
|
||||
const TargetInstrDesc &II = TII.get(TargetInstrInfo::EXTRACT_SUBREG);
|
||||
|
||||
BuildMI(MBB, II, ResultReg).addReg(Op0);
|
||||
return ResultReg;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user