30 #define GET_REGINFO_TARGET_DESC 31 #include "SparcGenRegisterInfo.inc" 35 cl::desc(
"Reserve application registers (%g2-%g4)"));
80 Reserved.
set(SP::G0_G1);
82 Reserved.
set(SP::G2_G3);
84 Reserved.
set(SP::G4_G5);
86 Reserved.
set(SP::O6_O7);
87 Reserved.
set(SP::I6_I7);
88 Reserved.
set(SP::G6_G7);
91 if (!Subtarget.
isV9()) {
92 for (
unsigned n = 0; n != 16; ++n) {
99 for (
unsigned n = 0; n < 31; n++)
100 Reserved.
set(SP::ASR1 + n);
107 unsigned Kind)
const {
109 return Subtarget.
is64Bit() ? &SP::I64RegsRegClass : &SP::IntRegsRegClass;
114 unsigned FIOperandNum,
int Offset,
unsigned FramePtr) {
116 if (Offset >= -4096 && Offset <= 4095) {
134 .addImm(
HI22(Offset));
152 .addImm(
HIX22(Offset));
166 int SPAdj,
unsigned FIOperandNum,
168 assert(SPAdj == 0 &&
"Unexpected");
179 Offset = TFI->getFrameIndexReference(MF, FrameIndex, FrameReg);
187 unsigned SrcEvenReg = getSubReg(SrcReg, SP::sub_even64);
188 unsigned SrcOddReg = getSubReg(SrcReg, SP::sub_odd64);
192 replaceFI(MF, *StMI, *StMI, dl, 0, Offset, FrameReg);
196 }
else if (MI.
getOpcode() == SP::LDQFri) {
199 unsigned DestEvenReg = getSubReg(DestReg, SP::sub_even64);
200 unsigned DestOddReg = getSubReg(DestReg, SP::sub_odd64);
203 .addReg(FrameReg).
addImm(0);
204 replaceFI(MF, *StMI, *StMI, dl, 1, Offset, FrameReg);
212 replaceFI(MF, II, MI, dl, FIOperandNum, Offset, FrameReg);
234 if (getFrameLowering(MF)->hasReservedCallFrame(MF))
BitVector getReservedRegs(const MachineFunction &MF) const override
This class represents lattice values for constants.
unsigned getFrameRegister(const MachineFunction &MF) const override
void ChangeToRegister(unsigned 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...
bool canRealignStack(const MachineFunction &MF) const override
const DebugLoc & getDebugLoc() const
Returns the debug location id of this MachineInstr.
unsigned getReg() const
getReg - Returns the register number.
static void replaceFI(MachineFunction &MF, MachineBasicBlock::iterator II, MachineInstr &MI, const DebugLoc &dl, unsigned FIOperandNum, int Offset, unsigned FramePtr)
const uint32_t * getRTCallPreservedMask(CallingConv::ID CC) const
const SparcInstrInfo * getInstrInfo() const override
static unsigned LO10(int64_t imm)
const HexagonInstrInfo * TII
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
virtual bool canRealignStack(const MachineFunction &MF) const
True if the stack can be realigned for the target.
static unsigned HIX22(int64_t imm)
static unsigned HI22(int64_t imm)
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID CC) const override
virtual const TargetInstrInfo * getInstrInfo() const
uint16_t MCPhysReg
An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
TargetInstrInfo - Interface to description of machine instruction set.
MachineInstrBuilder BuildMI(MachineFunction &MF, const DebugLoc &DL, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static cl::opt< bool > ReserveAppRegisters("sparc-reserve-app-registers", cl::Hidden, cl::init(false), cl::desc("Reserve application registers (%g2-%g4)"))
initializer< Ty > init(const Ty &Val)
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
static unsigned LOX10(int64_t imm)
MCRegAliasIterator enumerates all registers aliasing Reg.
void setDesc(const MCInstrDesc &tid)
Replace the instruction descriptor (thus opcode) of the current instruction with a new one...
const MachineBasicBlock * getParent() const
Representation of each machine instruction.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
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 setReg(unsigned Reg)
Change the register this operand corresponds to.
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind) const override
const MachineInstrBuilder & addReg(unsigned RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
const MachineOperand & getOperand(unsigned i) const