LLVM 24.0.0git
MipsTargetStreamer.h
Go to the documentation of this file.
1//===-- MipsTargetStreamer.h - Mips Target Streamer ------------*- C++ -*--===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
10#define LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
11
15#include "llvm/ADT/STLExtras.h"
19#include "llvm/MC/MCStreamer.h"
20
21namespace llvm {
22
24
25/// Emits the instructions that MipsTargetStreamer creates for the assembler.
26/// The assembler parser uses this to see every instruction it emits, including
27/// the ones that macros expand to, so that it can insert the nops that hazards
28/// need in .set reorder mode.
30public:
32 virtual void emitInstruction(const MCInst &Inst,
33 const MCSubtargetInfo &STI) = 0;
34};
35
37public:
39
40 /// Set the emitter for the instructions that this streamer creates, or
41 /// nullptr to emit them directly.
42 void setInstEmitter(MipsInstEmitter *E) { InstEmitter = E; }
43 MipsInstEmitter *getInstEmitter() const { return InstEmitter; }
44 /// Emit an instruction through the emitter, if one is set.
45 void emitInst(const MCInst &Inst, const MCSubtargetInfo &STI);
46
47 virtual void emitGPRel32Value(const MCExpr *);
48 virtual void emitGPRel64Value(const MCExpr *);
49 virtual void emitDTPRel32Value(const MCExpr *);
50 virtual void emitDTPRel64Value(const MCExpr *);
51 virtual void emitTPRel32Value(const MCExpr *);
52 virtual void emitTPRel64Value(const MCExpr *);
53
54 virtual void setPic(bool Value) {}
55
56 virtual void emitDirectiveSetMicroMips();
57 virtual void emitDirectiveSetNoMicroMips();
58 virtual void setUsesMicroMips();
59 virtual void emitDirectiveSetMips16();
60 virtual void emitDirectiveSetNoMips16();
61
62 virtual void emitDirectiveSetReorder();
63 virtual void emitDirectiveSetNoReorder();
64 virtual void emitDirectiveSetMacro();
65 virtual void emitDirectiveSetNoMacro();
66 virtual void emitDirectiveSetMsa();
67 virtual void emitDirectiveSetNoMsa();
68 virtual void emitDirectiveSetMt();
69 virtual void emitDirectiveSetNoMt();
70 virtual void emitDirectiveSetCRC();
71 virtual void emitDirectiveSetNoCRC();
72 virtual void emitDirectiveSetVirt();
73 virtual void emitDirectiveSetNoVirt();
74 virtual void emitDirectiveSetGINV();
75 virtual void emitDirectiveSetNoGINV();
76 virtual void emitDirectiveSetEVA();
77 virtual void emitDirectiveSetNoEVA();
78 virtual void emitDirectiveSetAt();
79 virtual void emitDirectiveSetAtWithArg(unsigned RegNo);
80 virtual void emitDirectiveSetNoAt();
81 virtual void emitDirectiveEnd(StringRef Name);
82
83 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
84 virtual void emitDirectiveAbiCalls();
85 virtual void emitDirectiveNaN2008();
86 virtual void emitDirectiveNaNLegacy();
87 virtual void emitDirectiveOptionPic0();
88 virtual void emitDirectiveOptionPic2();
89 virtual void emitDirectiveInsn();
90 virtual void emitFrame(MCRegister StackReg, unsigned StackSize,
92 virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff);
93 virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);
94
95 virtual void emitDirectiveSetArch(StringRef Arch);
96 virtual void emitDirectiveSetMips0();
97 virtual void emitDirectiveSetMips1();
98 virtual void emitDirectiveSetMips2();
99 virtual void emitDirectiveSetMips3();
100 virtual void emitDirectiveSetMips4();
101 virtual void emitDirectiveSetMips5();
102 virtual void emitDirectiveSetMips32();
103 virtual void emitDirectiveSetMips32R2();
104 virtual void emitDirectiveSetMips32R3();
105 virtual void emitDirectiveSetMips32R5();
106 virtual void emitDirectiveSetMips32R6();
107 virtual void emitDirectiveSetMips64();
108 virtual void emitDirectiveSetMips64R2();
109 virtual void emitDirectiveSetMips64R3();
110 virtual void emitDirectiveSetMips64R5();
111 virtual void emitDirectiveSetMips64R6();
112 virtual void emitDirectiveSetDsp();
113 virtual void emitDirectiveSetDspr2();
114 virtual void emitDirectiveSetNoDsp();
115 virtual void emitDirectiveSetMips3D();
116 virtual void emitDirectiveSetNoMips3D();
117 virtual void emitDirectiveSetPop();
118 virtual void emitDirectiveSetPush();
119 virtual void emitDirectiveSetSoftFloat();
120 virtual void emitDirectiveSetHardFloat();
121
122 // PIC support
123 virtual void emitDirectiveCpAdd(MCRegister Reg);
124 virtual void emitDirectiveCpLoad(MCRegister Reg);
125 virtual void emitDirectiveCpLocal(MCRegister Reg);
126 virtual bool emitDirectiveCpRestore(int Offset,
127 function_ref<MCRegister()> GetATReg,
128 SMLoc IDLoc, const MCSubtargetInfo *STI);
129 virtual void emitDirectiveCpsetup(MCRegister Reg, int RegOrOffset,
130 const MCSymbol &Sym, bool IsReg);
131 virtual void emitDirectiveCpreturn(unsigned SaveLocation,
132 bool SaveLocationIsRegister);
133
134 // FP abiflags directives
135 virtual void emitDirectiveModuleFP();
136 virtual void emitDirectiveModuleOddSPReg();
137 virtual void emitDirectiveModuleSoftFloat();
138 virtual void emitDirectiveModuleHardFloat();
139 virtual void emitDirectiveModuleMT();
141 virtual void emitDirectiveSetOddSPReg();
142 virtual void emitDirectiveSetNoOddSPReg();
143 virtual void emitDirectiveModuleCRC();
144 virtual void emitDirectiveModuleNoCRC();
145 virtual void emitDirectiveModuleVirt();
146 virtual void emitDirectiveModuleNoVirt();
147 virtual void emitDirectiveModuleGINV();
148 virtual void emitDirectiveModuleNoGINV();
149
150 void emitR(unsigned Opcode, MCRegister Reg0, SMLoc IDLoc,
151 const MCSubtargetInfo *STI);
152 void emitII(unsigned Opcode, int16_t Imm1, int16_t Imm2, SMLoc IDLoc,
153 const MCSubtargetInfo *STI);
154 void emitRX(unsigned Opcode, MCRegister Reg0, MCOperand Op1, SMLoc IDLoc,
155 const MCSubtargetInfo *STI);
156 void emitRI(unsigned Opcode, MCRegister Reg0, int32_t Imm, SMLoc IDLoc,
157 const MCSubtargetInfo *STI);
158 void emitRR(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, SMLoc IDLoc,
159 const MCSubtargetInfo *STI);
160 void emitRRX(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, MCOperand Op2,
161 SMLoc IDLoc, const MCSubtargetInfo *STI);
162 void emitRRR(unsigned Opcode, MCRegister Reg0, MCRegister Reg1,
163 MCRegister Reg2, SMLoc IDLoc, const MCSubtargetInfo *STI);
164 void emitRRRX(unsigned Opcode, MCRegister Reg0, MCRegister Reg1,
165 MCRegister Reg2, MCOperand Op3, SMLoc IDLoc,
166 const MCSubtargetInfo *STI);
167 void emitRRI(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, int16_t Imm,
168 SMLoc IDLoc, const MCSubtargetInfo *STI);
169 void emitRRIII(unsigned Opcode, MCRegister Reg0, MCRegister Reg1,
170 int16_t Imm0, int16_t Imm1, int16_t Imm2, SMLoc IDLoc,
171 const MCSubtargetInfo *STI);
172 void emitAddu(MCRegister DstReg, MCRegister SrcReg, MCRegister TrgReg,
173 bool Is64Bit, const MCSubtargetInfo *STI);
174 void emitDSLL(MCRegister DstReg, MCRegister SrcReg, int16_t ShiftAmount,
175 SMLoc IDLoc, const MCSubtargetInfo *STI);
177 const MCSubtargetInfo *STI);
178 void emitNop(SMLoc IDLoc, const MCSubtargetInfo *STI);
179
180 /// Emit a store instruction with an offset. If the offset is out of range
181 /// then it will be synthesized using the assembler temporary.
182 ///
183 /// GetATReg() is a callback that can be used to obtain the current assembler
184 /// temporary and is only called when the assembler temporary is required. It
185 /// must handle the case where no assembler temporary is available (typically
186 /// by reporting an error).
187 void emitStoreWithImmOffset(unsigned Opcode, MCRegister SrcReg,
188 MCRegister BaseReg, int64_t Offset,
189 function_ref<MCRegister()> GetATReg, SMLoc IDLoc,
190 const MCSubtargetInfo *STI);
191 void emitLoadWithImmOffset(unsigned Opcode, MCRegister DstReg,
192 MCRegister BaseReg, int64_t Offset,
193 MCRegister TmpReg, SMLoc IDLoc,
194 const MCSubtargetInfo *STI);
195 void emitGPRestore(int Offset, SMLoc IDLoc, const MCSubtargetInfo *STI);
196
197 void forbidModuleDirective() { ModuleDirectiveAllowed = false; }
198 void reallowModuleDirective() { ModuleDirectiveAllowed = true; }
199 bool isModuleDirectiveAllowed() { return ModuleDirectiveAllowed; }
200
201 // This method enables template classes to set internal abi flags
202 // structure values.
203 template <class PredicateLibrary>
204 void updateABIInfo(const PredicateLibrary &P) {
205 ABI = P.getABI();
206 ABIFlagsSection.setAllFromPredicates(P);
207 }
208
210 const MipsABIInfo &getABI() const {
211 assert(ABI && "ABI hasn't been set!");
212 return *ABI;
213 }
214
215protected:
216 std::optional<MipsABIInfo> ABI;
218
220 unsigned GPRBitMask;
222
224 unsigned FPRBitMask;
226
229 unsigned FrameReg;
231 unsigned ReturnReg;
232
233private:
234 bool ModuleDirectiveAllowed;
235 MipsInstEmitter *InstEmitter = nullptr;
236};
237
238// This part is for ascii assembly output
241
242public:
244
245 void emitGPRel32Value(const MCExpr *) override;
246 void emitGPRel64Value(const MCExpr *) override;
247 void emitDTPRel32Value(const MCExpr *) override;
248 void emitDTPRel64Value(const MCExpr *) override;
249 void emitTPRel32Value(const MCExpr *) override;
250 void emitTPRel64Value(const MCExpr *) override;
251
252 void emitDirectiveSetMicroMips() override;
253 void emitDirectiveSetNoMicroMips() override;
254 void emitDirectiveSetMips16() override;
255 void emitDirectiveSetNoMips16() override;
256
257 void emitDirectiveSetReorder() override;
258 void emitDirectiveSetNoReorder() override;
259 void emitDirectiveSetMacro() override;
260 void emitDirectiveSetNoMacro() override;
261 void emitDirectiveSetMsa() override;
262 void emitDirectiveSetNoMsa() override;
263 void emitDirectiveSetMt() override;
264 void emitDirectiveSetNoMt() override;
265 void emitDirectiveSetCRC() override;
266 void emitDirectiveSetNoCRC() override;
267 void emitDirectiveSetVirt() override;
268 void emitDirectiveSetNoVirt() override;
269 void emitDirectiveSetGINV() override;
270 void emitDirectiveSetNoGINV() override;
271 void emitDirectiveSetEVA() override;
272 void emitDirectiveSetNoEVA() override;
273 void emitDirectiveSetAt() override;
274 void emitDirectiveSetAtWithArg(unsigned RegNo) override;
275 void emitDirectiveSetNoAt() override;
276 void emitDirectiveEnd(StringRef Name) override;
277
278 void emitDirectiveEnt(const MCSymbol &Symbol) override;
279 void emitDirectiveAbiCalls() override;
280 void emitDirectiveNaN2008() override;
281 void emitDirectiveNaNLegacy() override;
282 void emitDirectiveOptionPic0() override;
283 void emitDirectiveOptionPic2() override;
284 void emitDirectiveInsn() override;
285 void emitFrame(MCRegister StackReg, unsigned StackSize,
286 MCRegister ReturnReg) override;
287 void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override;
288 void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override;
289
290 void emitDirectiveSetArch(StringRef Arch) override;
291 void emitDirectiveSetMips0() override;
292 void emitDirectiveSetMips1() override;
293 void emitDirectiveSetMips2() override;
294 void emitDirectiveSetMips3() override;
295 void emitDirectiveSetMips4() override;
296 void emitDirectiveSetMips5() override;
297 void emitDirectiveSetMips32() override;
298 void emitDirectiveSetMips32R2() override;
299 void emitDirectiveSetMips32R3() override;
300 void emitDirectiveSetMips32R5() override;
301 void emitDirectiveSetMips32R6() override;
302 void emitDirectiveSetMips64() override;
303 void emitDirectiveSetMips64R2() override;
304 void emitDirectiveSetMips64R3() override;
305 void emitDirectiveSetMips64R5() override;
306 void emitDirectiveSetMips64R6() override;
307 void emitDirectiveSetDsp() override;
308 void emitDirectiveSetDspr2() override;
309 void emitDirectiveSetNoDsp() override;
310 void emitDirectiveSetMips3D() override;
311 void emitDirectiveSetNoMips3D() override;
312 void emitDirectiveSetPop() override;
313 void emitDirectiveSetPush() override;
314 void emitDirectiveSetSoftFloat() override;
315 void emitDirectiveSetHardFloat() override;
316
317 // PIC support
318 void emitDirectiveCpAdd(MCRegister Reg) override;
319 void emitDirectiveCpLoad(MCRegister Reg) override;
320 void emitDirectiveCpLocal(MCRegister Reg) override;
321
322 /// Emit a .cprestore directive. If the offset is out of range then it will
323 /// be synthesized using the assembler temporary.
324 ///
325 /// GetATReg() is a callback that can be used to obtain the current assembler
326 /// temporary and is only called when the assembler temporary is required. It
327 /// must handle the case where no assembler temporary is available (typically
328 /// by reporting an error).
330 SMLoc IDLoc, const MCSubtargetInfo *STI) override;
331 void emitDirectiveCpsetup(MCRegister Reg, int RegOrOffset,
332 const MCSymbol &Sym, bool IsReg) override;
333 void emitDirectiveCpreturn(unsigned SaveLocation,
334 bool SaveLocationIsRegister) override;
335
336 // FP abiflags directives
337 void emitDirectiveModuleFP() override;
338 void emitDirectiveModuleOddSPReg() override;
339 void emitDirectiveModuleSoftFloat() override;
340 void emitDirectiveModuleHardFloat() override;
341 void emitDirectiveModuleMT() override;
342 void emitDirectiveModuleCRC() override;
343 void emitDirectiveModuleNoCRC() override;
344 void emitDirectiveModuleVirt() override;
345 void emitDirectiveModuleNoVirt() override;
346 void emitDirectiveModuleGINV() override;
347 void emitDirectiveModuleNoGINV() override;
349 void emitDirectiveSetOddSPReg() override;
350 void emitDirectiveSetNoOddSPReg() override;
351};
352
353// This part is for ELF object output
355 enum class ISAMode { Standard, MicroMips, Mips16, NanoMips };
356 static ISAMode getISAMode(const MCSubtargetInfo &STI);
357
358 const MipsMCOptions &CLOpts;
359 ISAMode Mode;
360 SmallVector<ISAMode, 4> ModeStack;
361 const MCSubtargetInfo &STI;
362 bool Pic;
363
364public:
365 bool isMicroMipsEnabled() const { return Mode == ISAMode::MicroMips; }
366 bool isMips16Enabled() const { return Mode == ISAMode::Mips16; }
367 bool isNanoMipsEnabled() const { return Mode == ISAMode::NanoMips; }
370
371 void setPic(bool Value) override { Pic = Value; }
372
373 void emitLabel(MCSymbol *Symbol) override;
374 void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
375 void finish() override;
376
377 void emitGPRel32Value(const MCExpr *) override;
378 void emitGPRel64Value(const MCExpr *) override;
379 void emitDTPRel32Value(const MCExpr *) override;
380 void emitDTPRel64Value(const MCExpr *) override;
381 void emitTPRel32Value(const MCExpr *) override;
382 void emitTPRel64Value(const MCExpr *) override;
383
384 void emitDirectiveSetMicroMips() override;
385 void emitDirectiveSetNoMicroMips() override;
386 void emitDirectiveSetPush() override;
387 void emitDirectiveSetPop() override;
388 void emitDirectiveSetMips0() override;
389 void setUsesMicroMips() override;
390 void emitDirectiveSetMips16() override;
391 void emitDirectiveSetNoMips16() override;
392
393 void emitDirectiveSetNoReorder() override;
394 void emitDirectiveEnd(StringRef Name) override;
395
396 void emitDirectiveEnt(const MCSymbol &Symbol) override;
397 void emitDirectiveAbiCalls() override;
398 void emitDirectiveNaN2008() override;
399 void emitDirectiveNaNLegacy() override;
400 void emitDirectiveOptionPic0() override;
401 void emitDirectiveOptionPic2() override;
402 void emitDirectiveInsn() override;
403 void emitFrame(MCRegister StackReg, unsigned StackSize,
404 MCRegister ReturnReg) override;
405 void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override;
406 void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override;
407
408 // PIC support
409 void emitDirectiveCpAdd(MCRegister Reg) override;
410 void emitDirectiveCpLoad(MCRegister Reg) override;
411 void emitDirectiveCpLocal(MCRegister Reg) override;
413 SMLoc IDLoc, const MCSubtargetInfo *STI) override;
414 void emitDirectiveCpsetup(MCRegister Reg, int RegOrOffset,
415 const MCSymbol &Sym, bool IsReg) override;
416 void emitDirectiveCpreturn(unsigned SaveLocation,
417 bool SaveLocationIsRegister) override;
418
419 void emitMipsAbiFlags();
420};
421}
422#endif
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
uint64_t Imm
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Register Reg
static bool hasShortDelaySlot(MCInst &Inst)
#define P(N)
This file contains some templates that are useful if you are working with the STL at all.
This file defines the SmallVector class.
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:31
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:187
Instances of this class represent operands of the MCInst class.
Definition MCInst.h:39
Wrapper class representing physical registers and target specific virtual registers.
Definition MCRegister.h:42
Streaming machine code generation interface.
Definition MCStreamer.h:221
Generic base class for all target subtargets.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
MCTargetStreamer(MCStreamer &S)
Emits the instructions that MipsTargetStreamer creates for the assembler.
virtual ~MipsInstEmitter()
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)=0
void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value) override
void emitDirectiveSetArch(StringRef Arch) override
void emitDirectiveCpsetup(MCRegister Reg, int RegOrOffset, const MCSymbol &Sym, bool IsReg) override
MipsTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS)
void emitDirectiveCpLocal(MCRegister Reg) override
void emitDirectiveEnt(const MCSymbol &Symbol) override
void emitDTPRel64Value(const MCExpr *) override
void emitTPRel64Value(const MCExpr *) override
bool emitDirectiveCpRestore(int Offset, function_ref< MCRegister()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI) override
Emit a .cprestore directive.
void emitDirectiveCpAdd(MCRegister Reg) override
void emitDirectiveCpLoad(MCRegister Reg) override
void emitFrame(MCRegister StackReg, unsigned StackSize, MCRegister ReturnReg) override
void emitDirectiveEnd(StringRef Name) override
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister) override
void emitDTPRel32Value(const MCExpr *) override
void emitTPRel32Value(const MCExpr *) override
void emitDirectiveSetAtWithArg(unsigned RegNo) override
void emitGPRel64Value(const MCExpr *) override
void emitGPRel32Value(const MCExpr *) override
bool emitDirectiveCpRestore(int Offset, function_ref< MCRegister()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI) override
void emitDTPRel32Value(const MCExpr *) override
void setPic(bool Value) override
MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
void emitGPRel64Value(const MCExpr *) override
void emitGPRel32Value(const MCExpr *) override
void emitDirectiveEnd(StringRef Name) override
void emitFrame(MCRegister StackReg, unsigned StackSize, MCRegister ReturnReg) override
void emitDirectiveCpsetup(MCRegister Reg, int RegOrOffset, const MCSymbol &Sym, bool IsReg) override
void emitDirectiveCpAdd(MCRegister Reg) override
void emitDirectiveCpLocal(MCRegister Reg) override
void emitTPRel64Value(const MCExpr *) override
void emitLabel(MCSymbol *Symbol) override
void emitTPRel32Value(const MCExpr *) override
void emitDTPRel64Value(const MCExpr *) override
void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override
void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override
void emitDirectiveCpLoad(MCRegister Reg) override
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister) override
void emitDirectiveEnt(const MCSymbol &Symbol) override
std::optional< MipsABIInfo > ABI
void emitRRX(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, MCOperand Op2, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitFrame(MCRegister StackReg, unsigned StackSize, MCRegister ReturnReg)
void emitRRRX(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, MCRegister Reg2, MCOperand Op3, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveCpLoad(MCRegister Reg)
virtual void emitDirectiveCpreturn(unsigned SaveLocation, bool SaveLocationIsRegister)
virtual void emitGPRel32Value(const MCExpr *)
virtual void emitDirectiveSetNoMicroMips()
void emitRX(unsigned Opcode, MCRegister Reg0, MCOperand Op1, SMLoc IDLoc, const MCSubtargetInfo *STI)
void setInstEmitter(MipsInstEmitter *E)
Set the emitter for the instructions that this streamer creates, or nullptr to emit them directly.
virtual void emitDirectiveEnd(StringRef Name)
virtual void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value)
virtual void emitTPRel64Value(const MCExpr *)
void emitR(unsigned Opcode, MCRegister Reg0, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitRRI(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, int16_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveEnt(const MCSymbol &Symbol)
void emitLoadWithImmOffset(unsigned Opcode, MCRegister DstReg, MCRegister BaseReg, int64_t Offset, MCRegister TmpReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit a load instruction with an immediate offset.
void emitEmptyDelaySlot(bool hasShortDelaySlot, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitAddu(MCRegister DstReg, MCRegister SrcReg, MCRegister TrgReg, bool Is64Bit, const MCSubtargetInfo *STI)
void emitRI(unsigned Opcode, MCRegister Reg0, int32_t Imm, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitTPRel32Value(const MCExpr *)
virtual void emitDirectiveSetNoMips16()
virtual void setPic(bool Value)
virtual void emitDirectiveSetNoOddSPReg()
virtual void emitGPRel64Value(const MCExpr *)
void emitII(unsigned Opcode, int16_t Imm1, int16_t Imm2, SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitRR(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual bool emitDirectiveCpRestore(int Offset, function_ref< MCRegister()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
void updateABIInfo(const PredicateLibrary &P)
virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff)
virtual void emitDirectiveCpsetup(MCRegister Reg, int RegOrOffset, const MCSymbol &Sym, bool IsReg)
void emitRRIII(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, int16_t Imm0, int16_t Imm1, int16_t Imm2, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveSetMicroMips()
virtual void emitDTPRel64Value(const MCExpr *)
virtual void emitDirectiveModuleSoftFloat()
virtual void emitDirectiveSetArch(StringRef Arch)
virtual void emitDTPRel32Value(const MCExpr *)
virtual void emitDirectiveCpAdd(MCRegister Reg)
virtual void emitDirectiveSetAtWithArg(unsigned RegNo)
MipsInstEmitter * getInstEmitter() const
void emitDSLL(MCRegister DstReg, MCRegister SrcReg, int16_t ShiftAmount, SMLoc IDLoc, const MCSubtargetInfo *STI)
const MipsABIInfo & getABI() const
virtual void emitDirectiveModuleOddSPReg()
void emitInst(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit an instruction through the emitter, if one is set.
void emitGPRestore(int Offset, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit the $gp restore operation for .cprestore.
virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff)
void emitNop(SMLoc IDLoc, const MCSubtargetInfo *STI)
void emitRRR(unsigned Opcode, MCRegister Reg0, MCRegister Reg1, MCRegister Reg2, SMLoc IDLoc, const MCSubtargetInfo *STI)
virtual void emitDirectiveSetNoReorder()
MipsABIFlagsSection & getABIFlagsSection()
void emitStoreWithImmOffset(unsigned Opcode, MCRegister SrcReg, MCRegister BaseReg, int64_t Offset, function_ref< MCRegister()> GetATReg, SMLoc IDLoc, const MCSubtargetInfo *STI)
Emit a store instruction with an offset.
virtual void emitDirectiveModuleHardFloat()
virtual void emitDirectiveCpLocal(MCRegister Reg)
MipsABIFlagsSection ABIFlagsSection
Represents a location in source code.
Definition SMLoc.h:22
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
LLVM Value Representation.
Definition Value.h:75
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
An efficient, type-erasing, non-owning reference to a callable.
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577