27#define GET_REGINFO_TARGET_DESC
28#include "SparcGenRegisterInfo.inc"
32 cl::desc(
"Reserve application registers (%g2-%g4)"));
88 if (!Subtarget.isV9()) {
89 for (
unsigned n = 0; n != 16; ++n) {
96 for (
unsigned n = 0; n < 31; n++)
100 i != SP::IntRegsRegClass.
end(); ++i) {
116 unsigned Kind)
const {
118 return Subtarget.
is64Bit() ? &SP::I64RegsRegClass : &SP::IntRegsRegClass;
128 MI.getOperand(FIOperandNum).ChangeToRegister(
FramePtr,
false);
129 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
Offset);
150 MI.getOperand(FIOperandNum).ChangeToRegister(SP::G1,
false);
151 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(
LO10(
Offset));
168 MI.getOperand(FIOperandNum).ChangeToRegister(SP::G1,
false);
169 MI.getOperand(FIOperandNum + 1).ChangeToImmediate(0);
175 int SPAdj,
unsigned FIOperandNum,
177 assert(SPAdj == 0 &&
"Unexpected");
181 int FrameIndex =
MI.getOperand(FIOperandNum).getIndex();
188 Offset = TFI->getFrameIndexReference(MF, FrameIndex, FrameReg).getFixed();
190 Offset +=
MI.getOperand(FIOperandNum + 1).getImm();
192 if (!Subtarget.isV9() || !Subtarget.hasHardQuad()) {
193 if (
MI.getOpcode() == SP::STQFri) {
196 Register SrcEvenReg = getSubReg(SrcReg, SP::sub_even64);
197 Register SrcOddReg = getSubReg(SrcReg, SP::sub_odd64);
202 MI.setDesc(
TII.get(SP::STDFri));
203 MI.getOperand(2).setReg(SrcOddReg);
205 }
else if (
MI.getOpcode() == SP::LDQFri) {
208 Register DestEvenReg = getSubReg(DestReg, SP::sub_even64);
209 Register DestOddReg = getSubReg(DestReg, SP::sub_odd64);
211 BuildMI(*
MI.getParent(),
II, dl,
TII.get(SP::LDDFri), DestEvenReg)
215 MI.setDesc(
TII.get(SP::LDDFri));
216 MI.getOperand(0).setReg(DestOddReg);
This file implements the BitVector class.
const HexagonInstrInfo * TII
uint64_t IntrinsicInst * II
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static void replaceFI(MachineFunction &MF, MachineBasicBlock::iterator II, MachineInstr &MI, const DebugLoc &dl, unsigned FIOperandNum, int Offset, unsigned FramePtr)
static cl::opt< bool > ReserveAppRegisters("sparc-reserve-app-registers", cl::Hidden, cl::init(false), cl::desc("Reserve application registers (%g2-%g4)"))
static const unsigned FramePtr
MCRegAliasIterator enumerates all registers aliasing Reg.
Wrapper class representing physical registers. Should be passed by value.
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
const MachineInstrBuilder & addImm(int64_t Val) const
Add a new immediate operand.
const MachineInstrBuilder & addReg(Register RegNo, unsigned flags=0, unsigned SubReg=0) const
Add a new virtual register operand.
Representation of each machine instruction.
Wrapper class representing virtual and physical registers.
bool isRegisterReserved(MCPhysReg PhysReg) const
const SparcInstrInfo * getInstrInfo() const override
TargetInstrInfo - Interface to description of machine instruction set.
virtual const TargetInstrInfo * getInstrInfo() const
friend const_iterator end(StringRef path)
Get end iterator over path.
initializer< Ty > init(const Ty &Val)
This is an optimization pass for GlobalISel generic memory operations.
MachineInstrBuilder BuildMI(MachineFunction &MF, const MIMetadata &MIMD, const MCInstrDesc &MCID)
Builder interface. Specify how to create the initial instruction itself.
static unsigned HI22(int64_t imm)
static unsigned HIX22(int64_t imm)
static unsigned LOX10(int64_t imm)
static unsigned LO10(int64_t imm)
const MCPhysReg * getCalleeSavedRegs(const MachineFunction *MF) const override
Code Generation virtual methods...
bool eliminateFrameIndex(MachineBasicBlock::iterator II, int SPAdj, unsigned FIOperandNum, RegScavenger *RS=nullptr) const override
const TargetRegisterClass * getPointerRegClass(const MachineFunction &MF, unsigned Kind) const override
BitVector getReservedRegs(const MachineFunction &MF) const override
bool isReservedReg(const MachineFunction &MF, MCRegister Reg) const
const uint32_t * getCallPreservedMask(const MachineFunction &MF, CallingConv::ID CC) const override
Register getFrameRegister(const MachineFunction &MF) const override
const uint32_t * getRTCallPreservedMask(CallingConv::ID CC) const