58 unsigned ReturnReg) {}
118 OS <<
"\t.set\tmicromips\n";
123 OS <<
"\t.set\tnomicromips\n";
128 OS <<
"\t.set\tmips16\n";
133 OS <<
"\t.set\tnomips16\n";
138 OS <<
"\t.set\treorder\n";
143 OS <<
"\t.set\tnoreorder\n";
148 OS <<
"\t.set\tmacro\n";
153 OS <<
"\t.set\tnomacro\n";
158 OS <<
"\t.set\tmsa\n";
163 OS <<
"\t.set\tnomsa\n";
168 OS <<
"\t.set\tat\n";
173 OS <<
"\t.set\tat=$" <<
Twine(RegNo) <<
"\n";
178 OS <<
"\t.set\tnoat\n";
183 OS <<
"\t.end\t" << Name <<
'\n';
187 OS <<
"\t.ent\t" << Symbol.
getName() <<
'\n';
195 OS <<
"\t.nan\tlegacy\n";
199 OS <<
"\t.option\tpic0\n";
203 OS <<
"\t.option\tpic2\n";
212 unsigned ReturnReg) {
220 OS <<
"\t.set arch=" << Arch <<
"\n";
225 OS <<
"\t.set\tmips0\n";
230 OS <<
"\t.set\tmips1\n";
235 OS <<
"\t.set\tmips2\n";
240 OS <<
"\t.set\tmips3\n";
245 OS <<
"\t.set\tmips4\n";
250 OS <<
"\t.set\tmips5\n";
255 OS <<
"\t.set\tmips32\n";
260 OS <<
"\t.set\tmips32r2\n";
265 OS <<
"\t.set\tmips32r3\n";
270 OS <<
"\t.set\tmips32r5\n";
275 OS <<
"\t.set\tmips32r6\n";
280 OS <<
"\t.set\tmips64\n";
285 OS <<
"\t.set\tmips64r2\n";
290 OS <<
"\t.set\tmips64r3\n";
295 OS <<
"\t.set\tmips64r5\n";
300 OS <<
"\t.set\tmips64r6\n";
305 OS <<
"\t.set\tdsp\n";
310 OS <<
"\t.set\tnodsp\n";
315 OS <<
"\t.set\tpop\n";
320 OS <<
"\t.set\tpush\n";
325 OS <<
"\t.set\tsoftfloat\n";
330 OS <<
"\t.set\thardfloat\n";
337 for (
int i = 7; i >= 0; i--)
338 OS.
write_hex((Value & (0xF << (i * 4))) >> (i * 4));
342 int CPUTopSavedRegOff) {
345 OS <<
',' << CPUTopSavedRegOff <<
'\n';
349 int FPUTopSavedRegOff) {
352 OS <<
"," << FPUTopSavedRegOff <<
'\n';
365 OS <<
"\t.cpsetup\t$"
381 OS <<
"\t.module\tfp=";
401 OS <<
"\t.set\toddspreg\n";
406 OS <<
"\t.set\tnooddspreg\n";
410 OS <<
"\t.module\tsoftfloat\n";
414 OS <<
"\t.module\thardfloat\n";
440 if (Features[Mips::FeatureMips64r6])
442 else if (Features[Mips::FeatureMips64r2] ||
443 Features[Mips::FeatureMips64r3] ||
444 Features[Mips::FeatureMips64r5])
446 else if (Features[Mips::FeatureMips64])
448 else if (Features[Mips::FeatureMips5])
450 else if (Features[Mips::FeatureMips4])
452 else if (Features[Mips::FeatureMips3])
454 else if (Features[Mips::FeatureMips32r6])
456 else if (Features[Mips::FeatureMips32r2] ||
457 Features[Mips::FeatureMips32r3] ||
458 Features[Mips::FeatureMips32r5])
460 else if (Features[Mips::FeatureMips32])
462 else if (Features[Mips::FeatureMips2])
468 if (Features[Mips::FeatureNaN2008])
479 auto *
Symbol = cast<MCSymbolELF>(S);
516 else if (
getABI().IsN32())
519 if (Features[Mips::FeatureGP64Bit]) {
522 }
else if (Features[Mips::FeatureMips64r2] || Features[Mips::FeatureMips64])
542 auto *
Symbol = cast<MCSymbolELF>(S);
546 const auto &RhsSym = cast<MCSymbolELF>(
560 MicroMipsEnabled =
true;
570 MicroMipsEnabled =
false;
680 unsigned ReturnReg_) {
691 int CPUTopSavedRegOff) {
698 int FPUTopSavedRegOff) {
void emitDirectiveSetDsp() override
void emitDirectiveEnd(StringRef Name) override
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff)
void emitDirectiveSetMips3() override
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
void setELFHeaderEFlags(unsigned Flags)
Instances of this class represent a uniqued identifier for a section in the current translation unit...
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()
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
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
static MCOperand createExpr(const MCExpr *Val)
MCSectionELF * getELFSection(StringRef Section, unsigned Type, unsigned Flags)
Target specific streamer interface.
void setAlignment(unsigned Value)
void emitDirectiveSetOddSPReg() override
void emitDirectiveNaN2008() override
const FeatureBitset Features
void emitDirectiveOptionPic0() override
virtual void emitDirectiveSetNoReorder()
void emitDirectiveModuleFP() override
virtual void emitDirectiveModuleHardFloat()
void registerSymbol(const MCSymbol &Symbol, bool *Created=nullptr)
void PushSection()
Save the current and previous section on the section stack.
MCSection * getDataSection() const
void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value) override
virtual void EmitValueImpl(const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc())
Emit the expression Value into the output as a native integer of the given Size bytes.
bool registerSection(MCSection &Section)
unsigned getELFHeaderEFlags() const
ELF e_header flags.
unsigned getAlignment() const
void emitDirectiveSetMips32R6() override
MCContext & getContext() const
MipsTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
void emitDirectiveCpLoad(unsigned RegNo) override
LLVM_ATTRIBUTE_NORETURN void report_fatal_error(const char *reason, bool gen_crash_diag=true)
Reports a serious error, calling any installed error handler.
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
static MCOperand createReg(unsigned Reg)
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
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)
Represent a reference to a symbol from inside an expression.
virtual void emitDirectiveSetMips32R6()
void emitDirectiveSetMips1() override
void createPendingLabelRelocs()
Mark labels as microMIPS, if necessary for the subtarget.
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
virtual void emitDirectiveSetMips1()
virtual void emitDirectiveModuleOddSPReg()
Context object for machine code objects.
virtual void emitDirectiveModuleSoftFloat()
MCSection * getBSSSection() const
void emitDirectiveSetSoftFloat() override
MipsABIFlagsSection ABIFlagsSection
raw_ostream & write_hex(unsigned long long N)
Output N in hexadecimal, without any prefix or padding.
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 EmitIntValue(uint64_t Value, unsigned Size)
Special case of EmitValue that avoids the client having to pass in a MCExpr for constant integers...
virtual void emitDirectiveSetNoOddSPReg()
void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg) override
Instances of this class represent a single low-level machine instruction.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
void emitDirectiveSetMips16() override
void emitDirectiveNaNLegacy() override
void emitDirectiveSetHardFloat() override
void emitDirectiveSetMips32R3() override
Streaming machine code generation interface.
void emitDirectiveSetMips64() override
virtual void emitDirectiveSetMips4()
The instances of the Type class are immutable: once they are created, they are never changed...
virtual void emitDirectiveSetNoMicroMips()
virtual void emitDirectiveSetNoDsp()
StringRef getFpABIString(FpABIKind Value)
void emitDirectiveSetNoReorder() override
virtual void emitDirectiveSetMips16()
virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection=nullptr)
Set the current section where code is being emitted to Section.
MCAssembler & getAssembler()
virtual void emitDirectiveSetMacro()
virtual void emitDirectiveNaN2008()
virtual void emitDirectiveCpLoad(unsigned RegNo)
virtual void emitDirectiveSetArch(StringRef Arch)
void emitDirectiveSetMips32() override
virtual void emitDirectiveSetDsp()
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff)
MCSection * getTextSection() const
void emitDirectiveSetMips64R2() override
void emitDirectiveSetMacro() override
virtual void emitDirectiveSetMips32R5()
void emitDirectiveSetNoMsa() override
void emitDirectiveSetMips64R3() override
virtual void emitDirectiveSetMips32R2()
void emitDirectiveSetMips16() override
virtual void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value)
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 setOpcode(unsigned Op)
virtual void emitDirectiveOptionPic0()
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
const MipsABIInfo & getABI() const
virtual void emitDirectiveSetPop()
void emitDirectiveSetMips32R5() override
void emitDirectiveInsn() override
virtual void emitDirectiveSetAt()
virtual void emitDirectiveSetNoMips16()
void emitDirectiveSetNoOddSPReg() override
const FeatureBitset & getFeatureBits() const
getFeatureBits - Return the feature bits.
bool isMicroMipsEnabled() const
void emitDirectiveSetAtWithArg(unsigned RegNo) override
void emitDirectiveEnd(StringRef Name) override
MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
virtual void emitDirectiveInsn()
void EmitMipsOptionRecords()
Emits all the option records stored up until the point it's called.
void emitDirectiveSetNoDsp() override
virtual void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset, const MCSymbol &Sym, bool IsReg)
void emitDirectiveSetMips64R5() override
virtual void emitDirectiveSetMips64R3()
virtual void emitDirectiveSetMips64R5()
const MCRegisterInfo * getRegisterInfo() const
void emitDirectiveCpLoad(unsigned RegNo) override
virtual void emitDirectiveEnt(const MCSymbol &Symbol)
StringRef getName() const
getName - Get the symbol name.
virtual void emitDirectiveSetHardFloat()
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
virtual void emitDirectiveSetMips64()
MCELFStreamer & getStreamer()
virtual void emitDirectiveSetMips5()
void emitDirectiveSetNoMips16() override
void emitDirectiveOptionPic2() override
virtual void emitDirectiveSetMips2()
MCSubtargetInfo - Generic base class for all target subtargets.
MCSectionELF - This represents a section on linux, lots of unix variants and some bare metal systems...
References to labels and assigned expressions.
void emitDirectiveSetNoMacro() override
MipsTargetStreamer(MCStreamer &S)
void emitDirectiveSetNoMicroMips() override
void emitFrame(unsigned StackReg, unsigned StackSize, unsigned ReturnReg) override
void emitDirectiveSetMips64R6() override
void emitDirectiveSetArch(StringRef Arch) override
void emitDirectiveModuleOddSPReg() override
void emitDirectiveAbiCalls() override
Reloc::Model getRelocM() const
bool PopSection()
Restore the current and previous section from the section stack.
virtual void emitDirectiveSetReorder()
static const char * getRegisterName(unsigned RegNo)
uint16_t getEncodingValue(unsigned RegNo) const
Returns the encoding for RegNo.
LLVM Value Representation.
void forbidModuleDirective()
const MCObjectFileInfo * getObjectFileInfo() const
virtual void emitDirectiveNaNLegacy()
void emitDirectiveSetNoReorder() override
This class implements an extremely fast bulk output stream that can only output to a stream...
virtual void emitDirectiveSetMips32()
virtual void emitDirectiveSetNoMsa()
void addOperand(const MCOperand &Op)
StringRef - Represent a constant reference to a string, i.e.
void emitDirectiveNaN2008() override
virtual void emitDirectiveSetMsa()
static void printHex32(unsigned Value, raw_ostream &OS)
virtual void emitDirectiveSetNoAt()
virtual void emitDirectiveSetAtWithArg(unsigned RegNo)
static MCOperand createImm(int64_t Val)
void emitDirectiveInsn() override
void emitDirectiveSetPush() override
std::string lower() const
void emitDirectiveModuleHardFloat() override
void emitDirectiveNaNLegacy() override
void emitDirectiveOptionPic0() override
void emitDirectiveSetMicroMips() override