Go to the documentation of this file.
9 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
10 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
22 class formatted_raw_ostream;
62 virtual void emitFrame(
unsigned StackReg,
unsigned StackSize,
64 virtual void emitMask(
unsigned CPUBitmask,
int CPUTopSavedRegOff);
65 virtual void emitFMask(
unsigned FPUBitmask,
int FPUTopSavedRegOff);
104 bool SaveLocationIsRegister);
122 void emitR(
unsigned Opcode,
unsigned Reg0,
SMLoc IDLoc,
124 void emitII(
unsigned Opcode, int16_t Imm1, int16_t Imm2,
SMLoc IDLoc,
128 void emitRI(
unsigned Opcode,
unsigned Reg0, int32_t Imm,
SMLoc IDLoc,
130 void emitRR(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1,
SMLoc IDLoc,
134 void emitRRR(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1,
unsigned Reg2,
136 void emitRRRX(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1,
unsigned Reg2,
138 void emitRRI(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1, int16_t Imm,
140 void emitRRIII(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1, int16_t Imm0,
141 int16_t Imm1, int16_t Imm2,
SMLoc IDLoc,
143 void emitAddu(
unsigned DstReg,
unsigned SrcReg,
unsigned TrgReg,
bool Is64Bit,
145 void emitDSLL(
unsigned DstReg,
unsigned SrcReg, int16_t ShiftAmount,
159 unsigned BaseReg, int64_t Offset,
163 int64_t Offset,
unsigned TmpReg,
SMLoc IDLoc,
173 template <
class PredicateLibrary>
181 assert(
ABI.hasValue() &&
"ABI hasn't been set!");
204 bool ModuleDirectiveAllowed;
244 void emitFrame(
unsigned StackReg,
unsigned StackSize,
246 void emitMask(
unsigned CPUBitmask,
int CPUTopSavedRegOff)
override;
247 void emitFMask(
unsigned FPUBitmask,
int FPUTopSavedRegOff)
override;
291 const MCSymbol &Sym,
bool IsReg)
override;
293 bool SaveLocationIsRegister)
override;
314 bool MicroMipsEnabled;
344 void emitFrame(
unsigned StackReg,
unsigned StackSize,
346 void emitMask(
unsigned CPUBitmask,
int CPUTopSavedRegOff)
override;
347 void emitFMask(
unsigned FPUBitmask,
int FPUTopSavedRegOff)
override;
356 const MCSymbol &Sym,
bool IsReg)
override;
358 bool SaveLocationIsRegister)
override;
void emitLoadWithImmOffset(unsigned Opcode, unsigned DstReg, unsigned BaseReg, int64_t Offset, unsigned TmpReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit a load instruction with an immediate offset.
bool emitDirectiveCpRestore(int Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI) override
void emitDirectiveSetReorder() override
virtual void emitDirectiveSetMips5()
virtual void emitDirectiveSetVirt()
virtual void emitDirectiveSetNoVirt()
void emitDirectiveModuleFP() override
virtual void emitDirectiveSetMips32R3()
void emitII(unsigned Opcode, int16_t Imm1, int16_t Imm2, SMLoc IDLoc, const MCSubtargetInfo *STI)
This is an optimization pass for GlobalISel generic memory operations.
virtual void emitDirectiveOptionPic0()
void emitDirectiveSetMips64R5() override
void emitRR(unsigned Opcode, unsigned Reg0, unsigned Reg1, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value) override
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void emitDirectiveSetNoReorder() override
void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg) override
void emitRX(unsigned Opcode, unsigned Reg0, MCOperand Op1, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveModuleMT()
void emitGPRestore(int Offset, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit the $gp restore operation for .cprestore.
virtual void emitDirectiveSetNoMips3D()
void emitLabel(MCSymbol *Symbol) override
virtual void emitDirectiveSetNoMt()
MipsTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
virtual void emitDirectiveEnt(const MCSymbol &Symbol)
void emitDirectiveNaNLegacy() override
This currently compiles esp xmm0 movsd esp eax eax esp ret We should use not the dag combiner This is because dagcombine2 needs to be able to see through the X86ISD::Wrapper which DAGCombine can t really do The code for turning x load into a single vector load is target independent and should be moved to the dag combiner The code for turning x load into a vector load can only handle a direct load from a global or a direct load from the stack It should be generalized to handle any load from P
virtual void emitDirectiveSetMips16()
void emitDirectiveSetNoVirt() override
void emitDirectiveSetMips5() override
void emitDirectiveSetNoMicroMips() override
void emitDirectiveEnt(const MCSymbol &Symbol) override
MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
virtual void emitDirectiveSetArch(StringRef Arch)
virtual void emitDirectiveModuleVirt()
virtual void emitDirectiveModuleNoCRC()
void emitRRI(unsigned Opcode, unsigned Reg0, unsigned Reg1, int16_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void setPic(bool Value)
void emitDirectiveModuleNoGINV() override
bool emitDirectiveCpRestore(int Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI) override
Emit a .cprestore directive.
void emitDirectiveSetMips32R3() override
virtual void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg)
virtual void emitDirectiveModuleNoGINV()
void emitDSLL(unsigned DstReg, unsigned SrcReg, int16_t ShiftAmount, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveModuleCRC()
void emitDirectiveCpLoad(unsigned RegNo) override
virtual void emitDirectiveModuleFP()
void setAllFromPredicates(const PredicateLibrary &P)
virtual void emitDirectiveSetMips3D()
virtual void emitDirectiveSetMips32R5()
void emitDirectiveOptionPic0() override
void emitDirectiveSetNoMt() override
virtual void emitDirectiveInsn()
virtual void emitDirectiveModuleNoVirt()
virtual void emitDirectiveSetNoAt()
void emitDirectiveSetMicroMips() override
void emitDirectiveSetNoGINV() override
bool isMicroMipsEnabled() const
virtual void emitDirectiveSetAt()
virtual void emitDirectiveSetNoMacro()
MipsTargetStreamer(MCStreamer &S)
void emitDirectiveSetDsp() override
void emitRRRX(unsigned Opcode, unsigned Reg0, unsigned Reg1, unsigned Reg2, MCOperand Op3, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveCpLoad(unsigned RegNo)
void emitDirectiveSetMips16() override
void emitDirectiveSetPop() override
virtual void emitDirectiveSetNoMips16()
virtual void emitDirectiveSetNoOddSPReg()
virtual void emitDirectiveSetMacro()
MipsABIFlagsSection & getABIFlagsSection()
Streaming machine code generation interface.
void emitDirectiveCpAdd(unsigned RegNo) override
void emitDirectiveNaN2008() override
void emitDirectiveSetArch(StringRef Arch) override
void emitDirectiveSetAt() override
void emitDirectiveSetMips0() override
Represents a location in source code.
virtual void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg)
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff)
void emitDirectiveSetMips16() override
virtual void emitDirectiveSetGINV()
void emitDirectiveCpLocal(unsigned RegNo) override
void emitDirectiveModuleVirt() override
void emitDirectiveModuleHardFloat() override
virtual void emitDirectiveSetMips64R3()
virtual void emitDirectiveModuleGINV()
void emitDirectiveAbiCalls() override
virtual void emitDirectiveSetOddSPReg()
virtual void emitDirectiveSetNoDsp()
virtual void emitDirectiveSetNoReorder()
void emitDirectiveEnd(StringRef Name) override
Target specific streamer interface.
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
virtual void emitDirectiveSetMips3()
void emitDirectiveSetMsa() override
void emitDirectiveSetMips32R5() override
virtual void emitDirectiveModuleSoftFloat()
virtual void emitDirectiveSetDspr2()
virtual void emitDirectiveOptionPic2()
void emitEmptyDelaySlot(bool hasShortDelaySlot, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual bool emitDirectiveCpRestore(int Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveSetMt()
void emitDirectiveSetNoMicroMips() override
void emitDirectiveSetMt() override
void emitDirectiveSetMips64R3() override
virtual void emitDirectiveSetMips64()
An efficient, type-erasing, non-owning reference to a callable.
void emitStoreWithImmOffset(unsigned Opcode, unsigned SrcReg, unsigned BaseReg, int64_t Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit a store instruction with an offset.
virtual void emitDirectiveSetMips64R6()
void emitDirectiveModuleNoCRC() override
virtual void emitDirectiveSetNoCRC()
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
void emitAddu(unsigned DstReg, unsigned SrcReg, unsigned TrgReg, bool Is64Bit, const MCSubtargetInfo *STI)
void emitDirectiveSetNoMsa() override
void emitDirectiveSetCRC() override
void reallowModuleDirective()
void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg) override
void emitDirectiveModuleGINV() override
virtual void emitDirectiveNaN2008()
void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister) override
void emitDirectiveSetVirt() override
virtual void emitDirectiveSetMips64R5()
void emitDirectiveCpAdd(unsigned RegNo) override
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
void emitRRX(unsigned Opcode, unsigned Reg0, unsigned Reg1, MCOperand Op2, SMLoc IDLoc, const MCSubtargetInfo *STI)
void setPic(bool Value) override
void emitDirectiveSetMips64() override
void emitDirectiveSetNoCRC() override
void emitDirectiveModuleSoftFloat() override
virtual void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value)
virtual void emitDirectiveSetMips0()
virtual void emitDirectiveAbiCalls()
virtual void emitDirectiveNaNLegacy()
void emitRI(unsigned Opcode, unsigned Reg0, int32_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveSetAtWithArg(unsigned RegNo) override
void emitDirectiveModuleNoVirt() override
static bool hasShortDelaySlot(MCInst &Inst)
bool isModuleDirectiveAllowed()
void emitDirectiveSetGINV() override
void emitDirectiveOptionPic2() override
StringRef - Represent a constant reference to a string, i.e.
void emitDirectiveSetMips32R6() override
void updateABIInfo(const PredicateLibrary &P)
void setUsesMicroMips() override
void emitDirectiveOptionPic2() override
void emitDirectiveModuleOddSPReg() override
void emitDirectiveAbiCalls() override
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
virtual void emitDirectiveSetMips2()
virtual void emitDirectiveModuleOddSPReg()
virtual void emitDirectiveCpAdd(unsigned RegNo)
virtual void emitDirectiveSetNoMsa()
virtual void emitDirectiveSetNoGINV()
void emitDirectiveSetOddSPReg() override
void emitDirectiveEnd(StringRef Name) override
void emitDirectiveSetMips32R2() override
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff)
virtual void emitDirectiveSetCRC()
void emitDirectiveSetNoMips3D() override
void emitDirectiveSetMacro() override
void emitDirectiveSetNoAt() override
void emitDirectiveCpLocal(unsigned RegNo) override
virtual void emitDirectiveSetMicroMips()
void emitRRR(unsigned Opcode, unsigned Reg0, unsigned Reg1, unsigned Reg2, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
void forbidModuleDirective()
virtual void emitDirectiveCpLocal(unsigned RegNo)
void emitDirectiveSetPush() override
virtual void emitDirectiveSetMips1()
void emitRRIII(unsigned Opcode, unsigned Reg0, unsigned Reg1, int16_t Imm0, int16_t Imm1, int16_t Imm2, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveSetHardFloat()
virtual void emitDirectiveSetMips32R6()
virtual void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister)
virtual void setUsesMicroMips()
void emitDirectiveSetSoftFloat() override
virtual void emitDirectiveSetMips4()
void emitDirectiveEnt(const MCSymbol &Symbol) override
void emitNop(SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveCpLoad(unsigned RegNo) override
void emitDirectiveSetNoReorder() override
void emitDirectiveSetMips64R2() override
void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister) override
void emitDirectiveSetMips32() override
llvm::Optional< MipsABIInfo > ABI
void emitR(unsigned Opcode, unsigned Reg0, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveInsn() override
void emitDirectiveSetNoMips16() override
void emitDirectiveSetMips3D() override
void emitDirectiveSetNoMacro() override
void emitDirectiveSetDspr2() override
void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg) override
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
virtual void emitDirectiveSetPop()
virtual void emitDirectiveEnd(StringRef Name)
void emitDirectiveSetHardFloat() override
virtual void emitDirectiveModuleHardFloat()
MipsABIFlagsSection ABIFlagsSection
void emitDirectiveOptionPic0() override
void emitDirectiveSetMips4() override
virtual void emitDirectiveSetDsp()
void emitDirectiveSetNoOddSPReg() override
void emitDirectiveModuleCRC() override
virtual void emitDirectiveSetMsa()
const MipsABIInfo & getABI() const
void emitDirectiveSetMips64R6() override
void emitDirectiveSetMips3() override
void emitDirectiveSetMicroMips() override
Instances of this class represent operands of the MCInst class.
void emitDirectiveInsn() override
virtual void emitDirectiveSetReorder()
MCELFStreamer & getStreamer()
virtual void emitDirectiveSetSoftFloat()
virtual void emitDirectiveSetMips32R2()
void emitDirectiveSetMips1() override
virtual void emitDirectiveSetMips32()
void emitDirectiveModuleMT() override
virtual void emitDirectiveSetNoMicroMips()
Generic base class for all target subtargets.
virtual void emitDirectiveSetPush()
LLVM Value Representation.
Base class for the full range of assembler expressions which are needed for parsing.
void emitDirectiveSetMips2() override
virtual void emitDirectiveSetMips64R2()
void emitDirectiveNaN2008() override
void emitDirectiveSetNoDsp() override
void emitDirectiveNaNLegacy() override
virtual void emitDirectiveSetAtWithArg(unsigned RegNo)
void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg) override