blob: 7d9f99ce071e86c0a8f2cdd9c18eace69a9fd727 [file] [log] [blame]
Rafael Espindolaa17151a2013-10-08 13:08:17 +00001//===-- MipsTargetStreamer.h - Mips Target Streamer ------------*- C++ -*--===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000010#ifndef LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
11#define LLVM_LIB_TARGET_MIPS_MIPSTARGETSTREAMER_H
Rafael Espindolaa17151a2013-10-08 13:08:17 +000012
Chandler Carruthd9903882015-01-14 11:23:27 +000013#include "MCTargetDesc/MipsABIFlagsSection.h"
Eric Christophera5762812015-01-26 17:33:46 +000014#include "MCTargetDesc/MipsABIInfo.h"
Simon Atanasyan4d45c762015-09-14 11:18:03 +000015#include "llvm/ADT/Optional.h"
Benjamin Kramerd3f4c052016-06-12 16:13:55 +000016#include "llvm/ADT/STLExtras.h"
Jack Carter86ac5c12013-11-18 23:55:27 +000017#include "llvm/MC/MCELFStreamer.h"
Daniel Sandersd97a6342014-08-13 10:07:34 +000018#include "llvm/MC/MCRegisterInfo.h"
Rafael Espindolaa17151a2013-10-08 13:08:17 +000019#include "llvm/MC/MCStreamer.h"
20
21namespace llvm {
Vladimir Medicfb8a2a92014-07-08 08:59:22 +000022
Daniel Sanders324ad952014-07-08 13:13:42 +000023struct MipsABIFlagsSection;
Vladimir Medicfb8a2a92014-07-08 08:59:22 +000024
Rafael Espindolaa17151a2013-10-08 13:08:17 +000025class MipsTargetStreamer : public MCTargetStreamer {
Rafael Espindolaa17151a2013-10-08 13:08:17 +000026public:
Rafael Espindola24ea09e2014-01-26 06:06:37 +000027 MipsTargetStreamer(MCStreamer &S);
Daniel Sanders8de3d3c2016-05-06 14:37:24 +000028
29 virtual void setPic(bool Value) {}
30
Rafael Espindola60890b82014-06-23 19:43:40 +000031 virtual void emitDirectiveSetMicroMips();
32 virtual void emitDirectiveSetNoMicroMips();
Daniel Sanderscda908a2016-05-16 09:10:13 +000033 virtual void setUsesMicroMips();
Rafael Espindola60890b82014-06-23 19:43:40 +000034 virtual void emitDirectiveSetMips16();
35 virtual void emitDirectiveSetNoMips16();
Rafael Espindolaeb0a8af2014-01-26 05:06:48 +000036
Rafael Espindola60890b82014-06-23 19:43:40 +000037 virtual void emitDirectiveSetReorder();
38 virtual void emitDirectiveSetNoReorder();
39 virtual void emitDirectiveSetMacro();
40 virtual void emitDirectiveSetNoMacro();
Daniel Sanders44934432014-08-07 12:03:36 +000041 virtual void emitDirectiveSetMsa();
42 virtual void emitDirectiveSetNoMsa();
Simon Dardis805f1e02017-07-11 21:28:36 +000043 virtual void emitDirectiveSetMt();
44 virtual void emitDirectiveSetNoMt();
Rafael Espindola60890b82014-06-23 19:43:40 +000045 virtual void emitDirectiveSetAt();
Toma Tabacu16a74492015-02-13 10:30:57 +000046 virtual void emitDirectiveSetAtWithArg(unsigned RegNo);
Rafael Espindola60890b82014-06-23 19:43:40 +000047 virtual void emitDirectiveSetNoAt();
48 virtual void emitDirectiveEnd(StringRef Name);
Rafael Espindolaeb0a8af2014-01-26 05:06:48 +000049
Rafael Espindola60890b82014-06-23 19:43:40 +000050 virtual void emitDirectiveEnt(const MCSymbol &Symbol);
51 virtual void emitDirectiveAbiCalls();
52 virtual void emitDirectiveNaN2008();
53 virtual void emitDirectiveNaNLegacy();
54 virtual void emitDirectiveOptionPic0();
55 virtual void emitDirectiveOptionPic2();
Toma Tabacu9ca50962015-04-16 09:53:47 +000056 virtual void emitDirectiveInsn();
Rafael Espindola054234f2014-01-27 03:53:56 +000057 virtual void emitFrame(unsigned StackReg, unsigned StackSize,
Rafael Espindola60890b82014-06-23 19:43:40 +000058 unsigned ReturnReg);
59 virtual void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff);
60 virtual void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff);
Vladimir Medic615b26e2014-03-04 09:54:09 +000061
Toma Tabacu85618b32014-08-19 14:22:52 +000062 virtual void emitDirectiveSetArch(StringRef Arch);
Toma Tabacu26647792014-09-09 12:52:14 +000063 virtual void emitDirectiveSetMips0();
Daniel Sandersf0df2212014-08-04 12:20:00 +000064 virtual void emitDirectiveSetMips1();
65 virtual void emitDirectiveSetMips2();
66 virtual void emitDirectiveSetMips3();
67 virtual void emitDirectiveSetMips4();
68 virtual void emitDirectiveSetMips5();
69 virtual void emitDirectiveSetMips32();
Rafael Espindola60890b82014-06-23 19:43:40 +000070 virtual void emitDirectiveSetMips32R2();
Daniel Sanders17793142015-02-18 16:24:50 +000071 virtual void emitDirectiveSetMips32R3();
72 virtual void emitDirectiveSetMips32R5();
Daniel Sandersf0df2212014-08-04 12:20:00 +000073 virtual void emitDirectiveSetMips32R6();
Rafael Espindola60890b82014-06-23 19:43:40 +000074 virtual void emitDirectiveSetMips64();
75 virtual void emitDirectiveSetMips64R2();
Daniel Sanders17793142015-02-18 16:24:50 +000076 virtual void emitDirectiveSetMips64R3();
77 virtual void emitDirectiveSetMips64R5();
Daniel Sandersf0df2212014-08-04 12:20:00 +000078 virtual void emitDirectiveSetMips64R6();
Rafael Espindola60890b82014-06-23 19:43:40 +000079 virtual void emitDirectiveSetDsp();
Toma Tabacu351b2fe2014-09-17 09:01:54 +000080 virtual void emitDirectiveSetNoDsp();
Toma Tabacu9db22db2014-09-09 10:15:38 +000081 virtual void emitDirectiveSetPop();
82 virtual void emitDirectiveSetPush();
Toma Tabacu29696502015-06-02 09:48:04 +000083 virtual void emitDirectiveSetSoftFloat();
84 virtual void emitDirectiveSetHardFloat();
Matheus Almeida525bc4f2014-04-30 11:28:42 +000085
86 // PIC support
Toma Tabacuc4c202a2014-10-01 14:53:19 +000087 virtual void emitDirectiveCpLoad(unsigned RegNo);
Daniel Sandersdf8510d2016-05-11 12:48:19 +000088 virtual bool emitDirectiveCpRestore(int Offset,
Benjamin Kramerd3f4c052016-06-12 16:13:55 +000089 function_ref<unsigned()> GetATReg,
Daniel Sandersdf8510d2016-05-11 12:48:19 +000090 SMLoc IDLoc, const MCSubtargetInfo *STI);
Matheus Almeidad92a3fa2014-05-01 10:24:46 +000091 virtual void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,
Rafael Espindola60890b82014-06-23 19:43:40 +000092 const MCSymbol &Sym, bool IsReg);
Daniel Sandersf173dda2015-09-22 10:50:09 +000093 virtual void emitDirectiveCpreturn(unsigned SaveLocation,
94 bool SaveLocationIsRegister);
Daniel Sanders7e527422014-07-10 13:38:23 +000095
Toma Tabacua64e5402015-06-25 12:44:38 +000096 // FP abiflags directives
97 virtual void emitDirectiveModuleFP();
Toma Tabacu3c499582015-06-25 10:56:57 +000098 virtual void emitDirectiveModuleOddSPReg();
Toma Tabacu0f093132015-06-30 13:46:03 +000099 virtual void emitDirectiveModuleSoftFloat();
100 virtual void emitDirectiveModuleHardFloat();
Simon Dardis805f1e02017-07-11 21:28:36 +0000101 virtual void emitDirectiveModuleMT();
Toma Tabacu4e0cf8e2015-03-06 12:15:12 +0000102 virtual void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value);
Toma Tabacu32c72aa2015-06-30 09:36:50 +0000103 virtual void emitDirectiveSetOddSPReg();
104 virtual void emitDirectiveSetNoOddSPReg();
Toma Tabacua64e5402015-06-25 12:44:38 +0000105
Daniel Sandersa736b372016-04-29 13:33:12 +0000106 void emitR(unsigned Opcode, unsigned Reg0, SMLoc IDLoc,
107 const MCSubtargetInfo *STI);
108 void emitII(unsigned Opcode, int16_t Imm1, int16_t Imm2, SMLoc IDLoc,
109 const MCSubtargetInfo *STI);
110 void emitRX(unsigned Opcode, unsigned Reg0, MCOperand Op1, SMLoc IDLoc,
111 const MCSubtargetInfo *STI);
112 void emitRI(unsigned Opcode, unsigned Reg0, int32_t Imm, SMLoc IDLoc,
113 const MCSubtargetInfo *STI);
114 void emitRR(unsigned Opcode, unsigned Reg0, unsigned Reg1, SMLoc IDLoc,
115 const MCSubtargetInfo *STI);
116 void emitRRX(unsigned Opcode, unsigned Reg0, unsigned Reg1, MCOperand Op2,
117 SMLoc IDLoc, const MCSubtargetInfo *STI);
118 void emitRRR(unsigned Opcode, unsigned Reg0, unsigned Reg1, unsigned Reg2,
119 SMLoc IDLoc, const MCSubtargetInfo *STI);
120 void emitRRI(unsigned Opcode, unsigned Reg0, unsigned Reg1, int16_t Imm,
121 SMLoc IDLoc, const MCSubtargetInfo *STI);
122 void emitAddu(unsigned DstReg, unsigned SrcReg, unsigned TrgReg, bool Is64Bit,
123 const MCSubtargetInfo *STI);
124 void emitDSLL(unsigned DstReg, unsigned SrcReg, int16_t ShiftAmount,
125 SMLoc IDLoc, const MCSubtargetInfo *STI);
126 void emitEmptyDelaySlot(bool hasShortDelaySlot, SMLoc IDLoc,
127 const MCSubtargetInfo *STI);
128 void emitNop(SMLoc IDLoc, const MCSubtargetInfo *STI);
Daniel Sanders241c6792016-05-12 14:01:50 +0000129
130 /// Emit a store instruction with an offset. If the offset is out of range
131 /// then it will be synthesized using the assembler temporary.
132 ///
133 /// GetATReg() is a callback that can be used to obtain the current assembler
134 /// temporary and is only called when the assembler temporary is required. It
135 /// must handle the case where no assembler temporary is available (typically
136 /// by reporting an error).
Daniel Sandersfba875f2016-04-29 13:43:45 +0000137 void emitStoreWithImmOffset(unsigned Opcode, unsigned SrcReg,
Daniel Sanders241c6792016-05-12 14:01:50 +0000138 unsigned BaseReg, int64_t Offset,
Benjamin Kramerd3f4c052016-06-12 16:13:55 +0000139 function_ref<unsigned()> GetATReg, SMLoc IDLoc,
Daniel Sanders241c6792016-05-12 14:01:50 +0000140 const MCSubtargetInfo *STI);
Daniel Sandersfba875f2016-04-29 13:43:45 +0000141 void emitStoreWithSymOffset(unsigned Opcode, unsigned SrcReg,
142 unsigned BaseReg, MCOperand &HiOperand,
143 MCOperand &LoOperand, unsigned ATReg, SMLoc IDLoc,
144 const MCSubtargetInfo *STI);
145 void emitLoadWithImmOffset(unsigned Opcode, unsigned DstReg, unsigned BaseReg,
146 int64_t Offset, unsigned TmpReg, SMLoc IDLoc,
147 const MCSubtargetInfo *STI);
148 void emitLoadWithSymOffset(unsigned Opcode, unsigned DstReg, unsigned BaseReg,
149 MCOperand &HiOperand, MCOperand &LoOperand,
150 unsigned ATReg, SMLoc IDLoc,
151 const MCSubtargetInfo *STI);
Daniel Sanders7225cd52016-04-29 16:16:49 +0000152 void emitGPRestore(int Offset, SMLoc IDLoc, const MCSubtargetInfo *STI);
Daniel Sandersa736b372016-04-29 13:33:12 +0000153
Daniel Sanderscdb45fa2014-08-14 09:18:14 +0000154 void forbidModuleDirective() { ModuleDirectiveAllowed = false; }
Toma Tabacu4e0cf8e2015-03-06 12:15:12 +0000155 void reallowModuleDirective() { ModuleDirectiveAllowed = true; }
Daniel Sanderscdb45fa2014-08-14 09:18:14 +0000156 bool isModuleDirectiveAllowed() { return ModuleDirectiveAllowed; }
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000157
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000158 // This method enables template classes to set internal abi flags
159 // structure values.
160 template <class PredicateLibrary>
161 void updateABIInfo(const PredicateLibrary &P) {
Simon Atanasyan4d45c762015-09-14 11:18:03 +0000162 ABI = P.getABI();
Daniel Sandersc7dbc632014-07-08 10:11:38 +0000163 ABIFlagsSection.setAllFromPredicates(P);
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000164 }
165
Daniel Sandersc7dbc632014-07-08 10:11:38 +0000166 MipsABIFlagsSection &getABIFlagsSection() { return ABIFlagsSection; }
Eric Christophera5762812015-01-26 17:33:46 +0000167 const MipsABIInfo &getABI() const {
Simon Atanasyan4d45c762015-09-14 11:18:03 +0000168 assert(ABI.hasValue() && "ABI hasn't been set!");
Eric Christophera5762812015-01-26 17:33:46 +0000169 return *ABI;
170 }
Daniel Sandersc7dbc632014-07-08 10:11:38 +0000171
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000172protected:
Simon Atanasyan4d45c762015-09-14 11:18:03 +0000173 llvm::Optional<MipsABIInfo> ABI;
Daniel Sandersc7dbc632014-07-08 10:11:38 +0000174 MipsABIFlagsSection ABIFlagsSection;
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000175
Daniel Sandersd97a6342014-08-13 10:07:34 +0000176 bool GPRInfoSet;
177 unsigned GPRBitMask;
178 int GPROffset;
179
180 bool FPRInfoSet;
181 unsigned FPRBitMask;
182 int FPROffset;
183
184 bool FrameInfoSet;
185 int FrameOffset;
186 unsigned FrameReg;
187 unsigned ReturnReg;
188
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000189private:
Daniel Sanderscdb45fa2014-08-14 09:18:14 +0000190 bool ModuleDirectiveAllowed;
Rafael Espindolaa17151a2013-10-08 13:08:17 +0000191};
Jack Carter86ac5c12013-11-18 23:55:27 +0000192
193// This part is for ascii assembly output
194class MipsTargetAsmStreamer : public MipsTargetStreamer {
Jack Carter6ef6cc52013-11-19 20:53:28 +0000195 formatted_raw_ostream &OS;
196
Jack Carter86ac5c12013-11-18 23:55:27 +0000197public:
Rafael Espindola24ea09e2014-01-26 06:06:37 +0000198 MipsTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS);
Craig Topper56c590a2014-04-29 07:58:02 +0000199 void emitDirectiveSetMicroMips() override;
200 void emitDirectiveSetNoMicroMips() override;
201 void emitDirectiveSetMips16() override;
202 void emitDirectiveSetNoMips16() override;
Rafael Espindolaeb0a8af2014-01-26 05:06:48 +0000203
Craig Topper56c590a2014-04-29 07:58:02 +0000204 void emitDirectiveSetReorder() override;
205 void emitDirectiveSetNoReorder() override;
206 void emitDirectiveSetMacro() override;
207 void emitDirectiveSetNoMacro() override;
Daniel Sanders44934432014-08-07 12:03:36 +0000208 void emitDirectiveSetMsa() override;
209 void emitDirectiveSetNoMsa() override;
Simon Dardis805f1e02017-07-11 21:28:36 +0000210 void emitDirectiveSetMt() override;
211 void emitDirectiveSetNoMt() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000212 void emitDirectiveSetAt() override;
Toma Tabacu16a74492015-02-13 10:30:57 +0000213 void emitDirectiveSetAtWithArg(unsigned RegNo) override;
Craig Topper56c590a2014-04-29 07:58:02 +0000214 void emitDirectiveSetNoAt() override;
215 void emitDirectiveEnd(StringRef Name) override;
Rafael Espindolaeb0a8af2014-01-26 05:06:48 +0000216
Craig Topper56c590a2014-04-29 07:58:02 +0000217 void emitDirectiveEnt(const MCSymbol &Symbol) override;
218 void emitDirectiveAbiCalls() override;
219 void emitDirectiveNaN2008() override;
220 void emitDirectiveNaNLegacy() override;
221 void emitDirectiveOptionPic0() override;
222 void emitDirectiveOptionPic2() override;
Toma Tabacu9ca50962015-04-16 09:53:47 +0000223 void emitDirectiveInsn() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000224 void emitFrame(unsigned StackReg, unsigned StackSize,
225 unsigned ReturnReg) override;
226 void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override;
227 void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override;
Vladimir Medic615b26e2014-03-04 09:54:09 +0000228
Toma Tabacu85618b32014-08-19 14:22:52 +0000229 void emitDirectiveSetArch(StringRef Arch) override;
Toma Tabacu26647792014-09-09 12:52:14 +0000230 void emitDirectiveSetMips0() override;
Daniel Sandersf0df2212014-08-04 12:20:00 +0000231 void emitDirectiveSetMips1() override;
232 void emitDirectiveSetMips2() override;
233 void emitDirectiveSetMips3() override;
234 void emitDirectiveSetMips4() override;
235 void emitDirectiveSetMips5() override;
236 void emitDirectiveSetMips32() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000237 void emitDirectiveSetMips32R2() override;
Daniel Sanders17793142015-02-18 16:24:50 +0000238 void emitDirectiveSetMips32R3() override;
239 void emitDirectiveSetMips32R5() override;
Daniel Sandersf0df2212014-08-04 12:20:00 +0000240 void emitDirectiveSetMips32R6() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000241 void emitDirectiveSetMips64() override;
242 void emitDirectiveSetMips64R2() override;
Daniel Sanders17793142015-02-18 16:24:50 +0000243 void emitDirectiveSetMips64R3() override;
244 void emitDirectiveSetMips64R5() override;
Daniel Sandersf0df2212014-08-04 12:20:00 +0000245 void emitDirectiveSetMips64R6() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000246 void emitDirectiveSetDsp() override;
Toma Tabacu351b2fe2014-09-17 09:01:54 +0000247 void emitDirectiveSetNoDsp() override;
Toma Tabacu9db22db2014-09-09 10:15:38 +0000248 void emitDirectiveSetPop() override;
249 void emitDirectiveSetPush() override;
Toma Tabacu29696502015-06-02 09:48:04 +0000250 void emitDirectiveSetSoftFloat() override;
251 void emitDirectiveSetHardFloat() override;
Matheus Almeida525bc4f2014-04-30 11:28:42 +0000252
253 // PIC support
Toma Tabacuc4c202a2014-10-01 14:53:19 +0000254 void emitDirectiveCpLoad(unsigned RegNo) override;
Daniel Sanders241c6792016-05-12 14:01:50 +0000255
256 /// Emit a .cprestore directive. If the offset is out of range then it will
257 /// be synthesized using the assembler temporary.
258 ///
259 /// GetATReg() is a callback that can be used to obtain the current assembler
260 /// temporary and is only called when the assembler temporary is required. It
261 /// must handle the case where no assembler temporary is available (typically
262 /// by reporting an error).
Benjamin Kramerd3f4c052016-06-12 16:13:55 +0000263 bool emitDirectiveCpRestore(int Offset, function_ref<unsigned()> GetATReg,
Daniel Sandersdf8510d2016-05-11 12:48:19 +0000264 SMLoc IDLoc, const MCSubtargetInfo *STI) override;
Matheus Almeidad92a3fa2014-05-01 10:24:46 +0000265 void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,
266 const MCSymbol &Sym, bool IsReg) override;
Daniel Sandersf173dda2015-09-22 10:50:09 +0000267 void emitDirectiveCpreturn(unsigned SaveLocation,
268 bool SaveLocationIsRegister) override;
Vladimir Medicfb8a2a92014-07-08 08:59:22 +0000269
Toma Tabacua64e5402015-06-25 12:44:38 +0000270 // FP abiflags directives
271 void emitDirectiveModuleFP() override;
Toma Tabacu3c499582015-06-25 10:56:57 +0000272 void emitDirectiveModuleOddSPReg() override;
Toma Tabacu0f093132015-06-30 13:46:03 +0000273 void emitDirectiveModuleSoftFloat() override;
274 void emitDirectiveModuleHardFloat() override;
Simon Dardis805f1e02017-07-11 21:28:36 +0000275 void emitDirectiveModuleMT() override;
Daniel Sanders7e527422014-07-10 13:38:23 +0000276 void emitDirectiveSetFp(MipsABIFlagsSection::FpABIKind Value) override;
Toma Tabacu32c72aa2015-06-30 09:36:50 +0000277 void emitDirectiveSetOddSPReg() override;
278 void emitDirectiveSetNoOddSPReg() override;
Jack Carter86ac5c12013-11-18 23:55:27 +0000279};
280
281// This part is for ELF object output
282class MipsTargetELFStreamer : public MipsTargetStreamer {
Rafael Espindola6d5f7ce2014-01-14 04:25:13 +0000283 bool MicroMipsEnabled;
Rafael Espindola972e71a2014-01-31 23:10:26 +0000284 const MCSubtargetInfo &STI;
Matheus Almeidaf79b2812014-03-26 13:40:29 +0000285 bool Pic;
Jack Carter39536722014-01-22 23:08:42 +0000286
Jack Carter86ac5c12013-11-18 23:55:27 +0000287public:
Rafael Espindola6d5f7ce2014-01-14 04:25:13 +0000288 bool isMicroMipsEnabled() const { return MicroMipsEnabled; }
Jack Carter86ac5c12013-11-18 23:55:27 +0000289 MCELFStreamer &getStreamer();
Rafael Espindolacb1953f2014-01-26 06:57:13 +0000290 MipsTargetELFStreamer(MCStreamer &S, const MCSubtargetInfo &STI);
Rafael Espindola6d5f7ce2014-01-14 04:25:13 +0000291
Daniel Sanders8de3d3c2016-05-06 14:37:24 +0000292 void setPic(bool Value) override { Pic = Value; }
293
Craig Topper56c590a2014-04-29 07:58:02 +0000294 void emitLabel(MCSymbol *Symbol) override;
295 void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override;
Craig Topper73156022014-03-02 09:09:27 +0000296 void finish() override;
Rafael Espindola6d5f7ce2014-01-14 04:25:13 +0000297
Craig Topper56c590a2014-04-29 07:58:02 +0000298 void emitDirectiveSetMicroMips() override;
299 void emitDirectiveSetNoMicroMips() override;
Daniel Sanderscda908a2016-05-16 09:10:13 +0000300 void setUsesMicroMips() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000301 void emitDirectiveSetMips16() override;
Rafael Espindolaeb0a8af2014-01-26 05:06:48 +0000302
Craig Topper56c590a2014-04-29 07:58:02 +0000303 void emitDirectiveSetNoReorder() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000304 void emitDirectiveEnd(StringRef Name) override;
Rafael Espindolaeb0a8af2014-01-26 05:06:48 +0000305
Craig Topper56c590a2014-04-29 07:58:02 +0000306 void emitDirectiveEnt(const MCSymbol &Symbol) override;
307 void emitDirectiveAbiCalls() override;
308 void emitDirectiveNaN2008() override;
309 void emitDirectiveNaNLegacy() override;
310 void emitDirectiveOptionPic0() override;
311 void emitDirectiveOptionPic2() override;
Toma Tabacu9ca50962015-04-16 09:53:47 +0000312 void emitDirectiveInsn() override;
Craig Topper56c590a2014-04-29 07:58:02 +0000313 void emitFrame(unsigned StackReg, unsigned StackSize,
314 unsigned ReturnReg) override;
315 void emitMask(unsigned CPUBitmask, int CPUTopSavedRegOff) override;
316 void emitFMask(unsigned FPUBitmask, int FPUTopSavedRegOff) override;
Vladimir Medic615b26e2014-03-04 09:54:09 +0000317
Matheus Almeida525bc4f2014-04-30 11:28:42 +0000318 // PIC support
Toma Tabacuc4c202a2014-10-01 14:53:19 +0000319 void emitDirectiveCpLoad(unsigned RegNo) override;
Benjamin Kramerd3f4c052016-06-12 16:13:55 +0000320 bool emitDirectiveCpRestore(int Offset, function_ref<unsigned()> GetATReg,
Daniel Sandersdf8510d2016-05-11 12:48:19 +0000321 SMLoc IDLoc, const MCSubtargetInfo *STI) override;
Matheus Almeidad92a3fa2014-05-01 10:24:46 +0000322 void emitDirectiveCpsetup(unsigned RegNo, int RegOrOffset,
323 const MCSymbol &Sym, bool IsReg) override;
Daniel Sandersf173dda2015-09-22 10:50:09 +0000324 void emitDirectiveCpreturn(unsigned SaveLocation,
325 bool SaveLocationIsRegister) override;
Matheus Almeida525bc4f2014-04-30 11:28:42 +0000326
Toma Tabacue95a4912015-03-13 11:40:01 +0000327 void emitMipsAbiFlags();
Jack Carter86ac5c12013-11-18 23:55:27 +0000328};
Alexander Kornienkof00654e2015-06-23 09:49:53 +0000329}
Rafael Espindolaa17151a2013-10-08 13:08:17 +0000330#endif