10 #ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
11 #define LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
23 struct MipsABIFlagsSection;
55 virtual void emitFrame(
unsigned StackReg,
unsigned StackSize,
57 virtual void emitMask(
unsigned CPUBitmask,
int CPUTopSavedRegOff);
58 virtual void emitFMask(
unsigned FPUBitmask,
int FPUTopSavedRegOff);
92 bool SaveLocationIsRegister);
103 void emitR(
unsigned Opcode,
unsigned Reg0,
SMLoc IDLoc,
105 void emitII(
unsigned Opcode, int16_t Imm1, int16_t Imm2,
SMLoc IDLoc,
109 void emitRI(
unsigned Opcode,
unsigned Reg0, int32_t Imm,
SMLoc IDLoc,
111 void emitRR(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1,
SMLoc IDLoc,
115 void emitRRR(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1,
unsigned Reg2,
117 void emitRRI(
unsigned Opcode,
unsigned Reg0,
unsigned Reg1, int16_t Imm,
119 void emitAddu(
unsigned DstReg,
unsigned SrcReg,
unsigned TrgReg,
bool Is64Bit,
121 void emitDSLL(
unsigned DstReg,
unsigned SrcReg, int16_t ShiftAmount,
135 unsigned BaseReg, int64_t Offset,
143 int64_t Offset,
unsigned TmpReg,
SMLoc IDLoc,
147 unsigned ATReg,
SMLoc IDLoc,
157 template <
class PredicateLibrary>
165 assert(
ABI.hasValue() &&
"ABI hasn't been set!");
187 bool ModuleDirectiveAllowed;
219 void emitFrame(
unsigned StackReg,
unsigned StackSize,
221 void emitMask(
unsigned CPUBitmask,
int CPUTopSavedRegOff)
override;
222 void emitFMask(
unsigned FPUBitmask,
int FPUTopSavedRegOff)
override;
261 const MCSymbol &Sym,
bool IsReg)
override;
263 bool SaveLocationIsRegister)
override;
277 bool MicroMipsEnabled;
307 void emitFrame(
unsigned StackReg,
unsigned StackSize,
309 void emitMask(
unsigned CPUBitmask,
int CPUTopSavedRegOff)
override;
310 void emitFMask(
unsigned FPUBitmask,
int FPUTopSavedRegOff)
override;
317 const MCSymbol &Sym,
bool IsReg)
override;
319 bool SaveLocationIsRegister)
override;
void emitDirectiveSetDsp() override
void emitDirectiveEnd(StringRef Name) override
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff)
void emitRR(unsigned Opcode, unsigned Reg0, unsigned Reg1, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveSetMips3() override
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
void emitDirectiveModuleSoftFloat() override
void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg) override
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
virtual void emitDirectiveOptionPic2()
void emitDirectiveOptionPic2() override
void emitDirectiveSetMips2() override
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void emitDirectiveSetReorder() override
void emitDirectiveSetNoMicroMips() override
void emitAddu(unsigned DstReg, unsigned SrcReg, unsigned TrgReg, bool Is64Bit, const MCSubtargetInfo *STI)
Target specific streamer interface.
void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister) override
void emitDirectiveSetOddSPReg() override
void emitDirectiveNaN2008() override
An efficient, type-erasing, non-owning reference to a callable.
void emitDirectiveOptionPic0() override
virtual void emitDirectiveSetNoReorder()
void emitDirectiveModuleFP() override
virtual void emitDirectiveModuleHardFloat()
void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value) override
void emitGPRestore(int Offset, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit the $gp restore operation for .cprestore.
void emitDirectiveSetMips32R6() override
MipsTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
bool emitDirectiveCpRestore(int Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI) override
Emit a .cprestore directive.
void emitDirectiveCpLoad(unsigned RegNo) override
virtual void emitDirectiveSetMips32R3()
virtual void emitDirectiveSetMicroMips()
virtual void emitDirectiveSetMips3()
void emitDirectiveSetAt() override
void emitDirectiveSetPop() override
void emitDirectiveSetMips4() override
void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg) 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.
void emitDirectiveAbiCalls() override
void emitDirectiveSetMicroMips() override
virtual void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg)
virtual void emitDirectiveSetMips0()
void emitDirectiveSetNoAt() override
virtual void emitDirectiveSetSoftFloat()
virtual void emitDirectiveSetNoMacro()
void emitDirectiveSetMsa() override
Base class for the full range of assembler expressions which are needed for parsing.
virtual void emitDirectiveSetPush()
virtual void emitDirectiveEnd(StringRef Name)
virtual void emitDirectiveSetMips32R6()
void emitDirectiveSetMips1() override
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
virtual void emitDirectiveSetMips1()
virtual void emitDirectiveModuleOddSPReg()
void emitNop(SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveModuleSoftFloat()
void emitDirectiveSetSoftFloat() override
MipsABIFlagsSection ABIFlagsSection
void emitDirectiveSetMips32R2() override
virtual void emitDirectiveModuleFP()
void emitDirectiveSetMips5() override
void emitDirectiveSetMips0() override
void emitLabel(MCSymbol *Symbol) override
virtual void emitDirectiveSetOddSPReg()
virtual void emitDirectiveSetMips64R2()
virtual void emitDirectiveSetNoOddSPReg()
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 setUsesMicroMips()
void emitDirectiveSetMips16() override
void emitDirectiveNaNLegacy() override
void emitDirectiveSetHardFloat() override
void emitDirectiveSetMips32R3() override
Streaming machine code generation interface.
void emitDirectiveSetMips64() override
virtual void emitDirectiveSetMips4()
virtual void emitDirectiveSetNoMicroMips()
virtual void emitDirectiveSetNoDsp()
void emitDirectiveSetNoReorder() override
virtual void emitDirectiveSetMips16()
virtual void emitDirectiveSetMacro()
void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister) override
virtual void emitDirectiveNaN2008()
void emitRI(unsigned Opcode, unsigned Reg0, int32_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveCpLoad(unsigned RegNo)
void emitR(unsigned Opcode, unsigned Reg0, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveSetArch(StringRef Arch)
void emitDirectiveSetMips32() override
virtual void emitDirectiveSetDsp()
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff)
void emitDirectiveSetMips64R2() override
void emitDirectiveSetMacro() override
virtual void emitDirectiveSetMips32R5()
void emitDirectiveSetNoMsa() override
void emitDirectiveSetMips64R3() override
virtual void emitDirectiveSetMips32R2()
void emitLoadWithSymOffset(unsigned Opcode, unsigned DstReg, unsigned BaseReg, MCOperand &HiOperand, MCOperand &LoOperand, unsigned ATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit a load instruction with an symbol offset.
void emitDirectiveSetMips16() override
virtual void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value)
void emitRRR(unsigned Opcode, unsigned Reg0, unsigned Reg1, unsigned Reg2, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveAbiCalls()
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
virtual void emitDirectiveSetMips64R6()
void emitDirectiveEnt(const MCSymbol &Symbol) override
void emitDirectiveEnt(const MCSymbol &Symbol) override
void setAllFromPredicates(const PredicateLibrary &P)
virtual void emitDirectiveOptionPic0()
void emitDSLL(unsigned DstReg, unsigned SrcReg, int16_t ShiftAmount, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
const MipsABIInfo & getABI() const
virtual void emitDirectiveSetPop()
void emitDirectiveSetMips32R5() override
void emitEmptyDelaySlot(bool hasShortDelaySlot, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveInsn() override
virtual void emitDirectiveSetAt()
virtual void emitDirectiveSetNoMips16()
void emitDirectiveSetNoOddSPReg() override
bool isMicroMipsEnabled() const
void emitDirectiveSetAtWithArg(unsigned RegNo) override
void emitDirectiveEnd(StringRef Name) override
MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
virtual void emitDirectiveInsn()
void setUsesMicroMips() override
void emitDirectiveSetNoDsp() override
virtual void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg)
bool isModuleDirectiveAllowed()
void emitDirectiveSetMips64R5() override
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 emitDirectiveSetMips64R3()
virtual void emitDirectiveSetMips64R5()
virtual void setPic(bool Value)
void emitDirectiveCpLoad(unsigned RegNo) override
void updateABIInfo(const PredicateLibrary &P)
virtual void emitDirectiveEnt(const MCSymbol &Symbol)
virtual void emitDirectiveSetHardFloat()
virtual void emitDirectiveSetMips64()
MCELFStreamer & getStreamer()
virtual bool emitDirectiveCpRestore(int Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveSetMips5()
void emitDirectiveSetNoMips16() override
void emitDirectiveOptionPic2() override
virtual void emitDirectiveSetMips2()
MCSubtargetInfo - Generic base class for all target subtargets.
void emitDirectiveSetNoMacro() override
MipsTargetStreamer(MCStreamer &S)
void emitDirectiveSetNoMicroMips() override
void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg) override
void emitDirectiveSetMips64R6() override
static bool hasShortDelaySlot(unsigned Opcode)
void emitDirectiveSetArch(StringRef Arch) override
void emitDirectiveModuleOddSPReg() override
void emitDirectiveAbiCalls() override
void emitRRI(unsigned Opcode, unsigned Reg0, unsigned Reg1, int16_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitRRX(unsigned Opcode, unsigned Reg0, unsigned Reg1, MCOperand Op2, SMLoc IDLoc, const MCSubtargetInfo *STI)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
virtual void emitDirectiveSetReorder()
LLVM Value Representation.
void forbidModuleDirective()
virtual void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister)
llvm::Optional< MipsABIInfo > ABI
virtual void emitDirectiveNaNLegacy()
void emitII(unsigned Opcode, int16_t Imm1, int16_t Imm2, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitDirectiveSetNoReorder() override
virtual void emitDirectiveSetMips32()
virtual void emitDirectiveSetNoMsa()
StringRef - Represent a constant reference to a string, i.e.
void emitDirectiveNaN2008() override
MipsABIFlagsSection & getABIFlagsSection()
virtual void emitDirectiveSetMsa()
virtual void emitDirectiveSetNoAt()
Represents a location in source code.
Instances of this class represent operands of the MCInst class.
bool emitDirectiveCpRestore(int Offset, function_ref< unsigned()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI) override
virtual void emitDirectiveSetAtWithArg(unsigned RegNo)
void emitDirectiveInsn() override
void emitDirectiveSetPush() override
void emitDirectiveModuleHardFloat() override
void reallowModuleDirective()
void emitDirectiveNaNLegacy() override
void emitStoreWithSymOffset(unsigned Opcode, unsigned SrcReg, unsigned BaseReg, MCOperand &HiOperand, MCOperand &LoOperand, unsigned ATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit a store instruction with an symbol offset.
void emitDirectiveOptionPic0() override
void emitDirectiveSetMicroMips() override
void setPic(bool Value) override