28 #define GET_REGINFO_TARGET_DESC 29 #include "AVRGenRegisterInfo.inc" 40 ? CSR_Interrupts_SaveList
41 : CSR_Normal_SaveList);
48 ? CSR_Interrupts_RegMask
49 : CSR_Normal_RegMask);
57 Reserved.
set(AVR::R0);
58 Reserved.
set(AVR::R1);
59 Reserved.
set(AVR::R1R0);
62 Reserved.
set(AVR::SPL);
63 Reserved.
set(AVR::SPH);
64 Reserved.
set(AVR::SP);
75 Reserved.
set(AVR::R28);
76 Reserved.
set(AVR::R29);
77 Reserved.
set(AVR::R29R28);
87 return &AVR::DREGSRegClass;
91 return &AVR::GPR8RegClass;
103 if ((Opcode != AVR::SUBIWRdK) && (Opcode != AVR::ADIWRdK)) {
129 int SPAdj,
unsigned FIOperandNum,
131 assert(SPAdj == 0 &&
"Unexpected SPAdj value");
157 assert(Offset > 0 &&
"Invalid offset");
162 assert(DstReg != AVR::R29R28 &&
"Dest reg cannot be the frame pointer");
182 if (isUInt<6>(Offset)) {
183 Opcode = AVR::ADIWRdK;
190 Opcode = AVR::SUBIWRdK;
208 unsigned AddOpc = AVR::ADIWRdK, SubOpc = AVR::SBIWRdK;
209 int AddOffset = Offset - 63 + 1;
212 if ((Offset - 63 + 1) > 63) {
213 AddOpc = AVR::SUBIWRdK;
214 SubOpc = AVR::SUBIWRdK;
215 AddOffset = -AddOffset;
222 BuildMI(MBB, II, dl, TII.
get(AVR::INRdA), AVR::R0).addImm(0x3f);
230 BuildMI(MBB, std::next(II), dl, TII.
get(AVR::OUTARr))
236 BuildMI(MBB, std::next(II), dl, TII.
get(SubOpc), AVR::R29R28)
244 assert(isUInt<6>(Offset) &&
"Offset is out of range");
250 if (TFI->
hasFP(MF)) {
260 unsigned Kind)
const {
264 return &AVR::PTRDISPREGSRegClass;
269 unsigned &HiReg)
const {
270 assert(AVR::DREGSRegClass.
contains(Reg) &&
"can only split 16-bit registers");
272 LoReg = getSubReg(Reg, AVR::sub_lo);
273 HiReg = getSubReg(Reg, AVR::sub_hi);
283 if(this->
getRegClass(AVR::PTRDISPREGSRegClassID)->hasSubClassEq(NewRC)) {
bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC, LiveIntervals &LIS) const override
const AVRInstrInfo * getInstrInfo() const override
This class represents lattice values for constants.
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind=0) const override
virtual const TargetRegisterInfo * getRegisterInfo() const
getRegisterInfo - If register information is available, return it.
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
BitVector getReservedRegs(const MachineFunction &MF) const override
unsigned const TargetRegisterInfo * TRI
void setIsDead(bool Val=true)
int getOffsetOfLocalArea() const
getOffsetOfLocalArea - This method returns the offset of the local area from the stack pointer on ent...
return AArch64::GPR64RegClass contains(Reg)
const AVRSubtarget * getSubtargetImpl() const
const HexagonInstrInfo * TII
const TargetRegisterClass * getLargestLegalSuperClass(const TargetRegisterClass *RC, const MachineFunction &MF) const override
virtual bool hasFP(const MachineFunction &MF) const =0
hasFP - Return true if the specified function should have a dedicated frame pointer register...
void eraseFromParent()
Unlink 'this' from the containing basic block and delete it.
int64_t getObjectOffset(int ObjectIdx) const
Return the assigned stack offset of the specified object from the incoming stack pointer.
static int getRegClass(RegisterKind Is, unsigned RegWidth)
The MachineFrameInfo class represents an abstract stack frame until prolog/epilog code is inserted...
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
A generic AVR implementation.
const uint16_t * getCalleeSavedRegs(const MachineFunction *MF=0) const override
bool isTypeLegalForClass(const TargetRegisterClass &RC, MVT T) const
Return true if the given TargetRegisterClass has the ValueType T.
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID CC) const override
Calling convention used for AVR signal routines.
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
void eliminateFrameIndex(MachineBasicBlock::iterator MI, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=NULL) const override
Stack Frame Processing Methods.
TargetInstrInfo - Interface to description of machine instruction set.
static void foldFrameOffset(MachineBasicBlock::iterator &II, int &Offset, unsigned DstReg)
Fold a frame offset shared between two add instructions into a single one.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
void splitReg(unsigned Reg, unsigned &LoReg, unsigned &HiReg) const
Splits a 16-bit DREGS register into the lo/hi register pair.
MachineFrameInfo & getFrameInfo()
getFrameInfo - Return the frame info object for the current function.
TargetRegisterInfo base class - We assume that the target defines a static array of TargetRegisterDes...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
virtual bool shouldCoalesce(MachineInstr *MI, const TargetRegisterClass *SrcRC, unsigned SubReg, const TargetRegisterClass *DstRC, unsigned DstSubReg, const TargetRegisterClass *NewRC, LiveIntervals &LIS) const
Subtarget Hooks.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
CallingConv::ID getCallingConv() const
getCallingConv()/setCallingConv(CC) - These method get and set the calling convention of this functio...
Information about stack frame layout on the target.
const Function & getFunction() const
Return the LLVM function that this machine code represents.
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Register getFrameRegister(const MachineFunction &MF) const override
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MCInstrDesc & get(unsigned Opcode) const
Return the machine instruction descriptor that corresponds to the specified instruction opcode...
void ChangeToRegister(Register Reg, bool isDef, bool isImp=false, bool isKill=false, bool isDead=false, bool isUndef=false, bool isDebug=false)
ChangeToRegister - Replace this operand with a new register operand of the specified value...
virtual const TargetFrameLowering * getFrameLowering() const
const LLVMTargetMachine & getTarget() const
getTarget - Return the target machine this machine code is compiled with
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
const TargetFrameLowering * getFrameLowering() const override
void RemoveOperand(unsigned OpNo)
Erase an operand from an instruction, leaving it with one fewer operand than it started with...
Register getReg() const
getReg - Returns the register number.
const MachineOperand & getOperand(unsigned i) const
Used for AVR interrupt routines.
uint64_t getStackSize() const
Return the number of bytes that must be allocated to hold all of the fixed size frame objects...
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Wrapper class representing virtual and physical registers.