1//=- MicroMips32r6InstrInfo.td - MicroMips r6 Instruction Information -*- tablegen -*-=//
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//
10// This file describes microMIPSr6 instructions.
11//
12//===----------------------------------------------------------------------===//
13
14def brtarget26_mm : Operand<OtherVT> {
15  let EncoderMethod = "getBranchTarget26OpValueMM";
16  let OperandType = "OPERAND_PCREL";
17  let DecoderMethod = "DecodeBranchTarget26MM";
18  let ParserMatchClass = MipsJumpTargetAsmOperand;
19}
20
21//===----------------------------------------------------------------------===//
22//
23// Instruction Encodings
24//
25//===----------------------------------------------------------------------===//
26class ADD_MMR6_ENC : ARITH_FM_MMR6<"add", 0x110>;
27class ADDIU_MMR6_ENC : ADDI_FM_MMR6<"addiu", 0xc>;
28class ADDU_MMR6_ENC : ARITH_FM_MMR6<"addu", 0x150>;
29class ADDIUPC_MMR6_ENC : PCREL19_FM_MMR6<0b00>;
30class ALUIPC_MMR6_ENC : PCREL16_FM_MMR6<0b11111>;
31class AND_MMR6_ENC : ARITH_FM_MMR6<"and", 0x250>;
32class ANDI_MMR6_ENC : ADDI_FM_MMR6<"andi", 0x34>;
33class AUIPC_MMR6_ENC  : PCREL16_FM_MMR6<0b11110>;
34class ALIGN_MMR6_ENC : POOL32A_ALIGN_FM_MMR6<0b011111>;
35class AUI_MMR6_ENC : AUI_FM_MMR6;
36class BALC_MMR6_ENC  : BRANCH_OFF26_FM<0b101101>;
37class BC_MMR6_ENC : BRANCH_OFF26_FM<0b100101>;
38class BC16_MMR6_ENC : BC16_FM_MM16R6;
39class BEQZC16_MMR6_ENC : BEQZC_BNEZC_FM_MM16R6<0x23>;
40class BNEZC16_MMR6_ENC : BEQZC_BNEZC_FM_MM16R6<0x2b>;
41class BITSWAP_MMR6_ENC : POOL32A_BITSWAP_FM_MMR6<0b101100>;
42class BRK_MMR6_ENC : BREAK_MMR6_ENC<"break">;
43class BEQZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b011101>;
44class BNEZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b011111>;
45class BGTZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b111000>;
46class BLTZALC_MMR6_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<0b111000>;
47class BGEZALC_MMR6_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM_MMR6<0b110000>;
48class BLEZALC_MMR6_ENC : CMP_BRANCH_1R_RT_OFF16_FM_MMR6<0b110000>;
49class CACHE_MMR6_ENC : CACHE_PREF_FM_MMR6<0b001000, 0b0110>;
50class CLO_MMR6_ENC : POOL32A_2R_FM_MMR6<0b0100101100>;
51class CLZ_MMR6_ENC : SPECIAL_2R_FM_MMR6<0b010000>;
52class DIV_MMR6_ENC : ARITH_FM_MMR6<"div", 0x118>;
53class DIVU_MMR6_ENC : ARITH_FM_MMR6<"divu", 0x198>;
54class EHB_MMR6_ENC : BARRIER_MMR6_ENC<"ehb", 0x3>;
55class EI_MMR6_ENC : POOL32A_EIDI_MMR6_ENC<"ei", 0x15d>;
56class DI_MMR6_ENC : POOL32A_EIDI_MMR6_ENC<"di", 0b0100011101>;
57class ERET_MMR6_ENC : POOL32A_ERET_FM_MMR6<"eret", 0x3cd>;
58class DERET_MMR6_ENC : POOL32A_ERET_FM_MMR6<"eret", 0b1110001101>;
59class ERETNC_MMR6_ENC : ERETNC_FM_MMR6<"eretnc">;
60class JALRC16_MMR6_ENC : POOL16C_JALRC_FM_MM16R6<0xb>;
61class JIALC_MMR6_ENC : JMP_IDX_COMPACT_FM<0b100000>;
62class JIC_MMR6_ENC   : JMP_IDX_COMPACT_FM<0b101000>;
63class JRC16_MMR6_ENC: POOL16C_JALRC_FM_MM16R6<0x3>;
64class JRCADDIUSP_MMR6_ENC : POOL16C_JRCADDIUSP_FM_MM16R6<0x13>;
65class LSA_MMR6_ENC : POOL32A_LSA_FM<0b001111>;
66class LWPC_MMR6_ENC  : PCREL19_FM_MMR6<0b01>;
67class LWM16_MMR6_ENC : POOL16C_LWM_SWM_FM_MM16R6<0x2>;
68class MOD_MMR6_ENC : ARITH_FM_MMR6<"mod", 0x158>;
69class MODU_MMR6_ENC : ARITH_FM_MMR6<"modu", 0x1d8>;
70class MUL_MMR6_ENC : ARITH_FM_MMR6<"mul", 0x18>;
71class MUH_MMR6_ENC : ARITH_FM_MMR6<"muh", 0x58>;
72class MULU_MMR6_ENC : ARITH_FM_MMR6<"mulu", 0x98>;
73class MUHU_MMR6_ENC : ARITH_FM_MMR6<"muhu", 0xd8>;
74class NOR_MMR6_ENC : ARITH_FM_MMR6<"nor", 0x2d0>;
75class OR_MMR6_ENC : ARITH_FM_MMR6<"or", 0x290>;
76class ORI_MMR6_ENC : ADDI_FM_MMR6<"ori", 0x14>;
77class PREF_MMR6_ENC : CACHE_PREF_FM_MMR6<0b011000, 0b0010>;
78class SB16_MMR6_ENC : LOAD_STORE_FM_MM16<0x22>;
79class SEB_MMR6_ENC : SIGN_EXTEND_FM_MMR6<"seb", 0b0010101100>;
80class SEH_MMR6_ENC : SIGN_EXTEND_FM_MMR6<"seh", 0b0011101100>;
81class SELEQZ_MMR6_ENC : POOL32A_FM_MMR6<0b0101000000>;
82class SELNEZ_MMR6_ENC : POOL32A_FM_MMR6<0b0110000000>;
83class SH16_MMR6_ENC : LOAD_STORE_FM_MM16<0x2a>;
84class SLL_MMR6_ENC : SHIFT_MMR6_ENC<"sll", 0x00, 0b0>;
85class SUB_MMR6_ENC : ARITH_FM_MMR6<"sub", 0x190>;
86class SUBU_MMR6_ENC : ARITH_FM_MMR6<"subu", 0x1d0>;
87class SW_MMR6_ENC : SW32_FM_MMR6<"sw", 0x3e>;
88class SWE_MMR6_ENC : POOL32C_SWE_FM_MMR6<"swe", 0x18, 0xa, 0x7>;
89class SW16_MMR6_ENC : LOAD_STORE_FM_MM16<0x3a>;
90class SWM16_MMR6_ENC : POOL16C_LWM_SWM_FM_MM16R6<0xa>;
91class SWSP_MMR6_ENC : LOAD_STORE_SP_FM_MM16<0x32>;
92class PREFE_MMR6_ENC : POOL32C_ST_EVA_FM_MMR6<0b011000, 0b010>;
93class CACHEE_MMR6_ENC : POOL32C_ST_EVA_FM_MMR6<0b011000, 0b011>;
94class WRPGPR_MMR6_ENC : POOL32A_WRPGPR_WSBH_FM_MMR6<0x3c5>;
95class WSBH_MMR6_ENC : POOL32A_WRPGPR_WSBH_FM_MMR6<0x1ec>;
96class LB_MMR6_ENC : LB32_FM_MMR6;
97class LBU_MMR6_ENC : LBU32_FM_MMR6;
98class LBE_MMR6_ENC : POOL32C_LB_LBU_FM_MMR6<0b100>;
99class LBUE_MMR6_ENC : POOL32C_LB_LBU_FM_MMR6<0b000>;
100class PAUSE_MMR6_ENC : POOL32A_PAUSE_FM_MMR6<"pause", 0b00101>;
101class RDHWR_MMR6_ENC : POOL32A_RDHWR_FM_MMR6;
102class WAIT_MMR6_ENC : WAIT_FM_MM, MMR6Arch<"wait">;
103class SSNOP_MMR6_ENC : BARRIER_FM_MM<0x1>, MMR6Arch<"ssnop">;
104class SYNC_MMR6_ENC : POOL32A_SYNC_FM_MMR6;
105class SYNCI_MMR6_ENC : POOL32I_SYNCI_FM_MMR6, MMR6Arch<"synci">;
106class RDPGPR_MMR6_ENC : POOL32A_RDPGPR_FM_MMR6<0b1110000101>;
107class SDBBP_MMR6_ENC : SDBBP_FM_MM, MMR6Arch<"sdbbp">;
108class XOR_MMR6_ENC : ARITH_FM_MMR6<"xor", 0x310>;
109class XORI_MMR6_ENC : ADDI_FM_MMR6<"xori", 0x1c>;
110class ABS_S_MMR6_ENC : POOL32F_ABS_FM_MMR6<"abs.s", 0, 0b0001101>;
111class ABS_D_MMR6_ENC : POOL32F_ABS_FM_MMR6<"abs.d", 1, 0b0001101>;
112class FLOOR_L_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"floor.l.s", 0, 0b00001100>;
113class FLOOR_L_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"floor.l.d", 1, 0b00001100>;
114class FLOOR_W_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"floor.w.s", 0, 0b00101100>;
115class FLOOR_W_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"floor.w.d", 1, 0b00101100>;
116class CEIL_L_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"ceil.l.s", 0, 0b01001100>;
117class CEIL_L_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"ceil.l.d", 1, 0b01001100>;
118class CEIL_W_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"ceil.w.s", 0, 0b01101100>;
119class CEIL_W_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"ceil.w.d", 1, 0b01101100>;
120class TRUNC_L_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"trunc.l.s", 0, 0b10001100>;
121class TRUNC_L_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"trunc.l.d", 1, 0b10001100>;
122class TRUNC_W_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"trunc.w.s", 0, 0b10101100>;
123class TRUNC_W_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"trunc.w.d", 1, 0b10101100>;
124class SQRT_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"sqrt.s", 0, 0b00101000>;
125class SQRT_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"sqrt.d", 1, 0b00101000>;
126class RSQRT_S_MMR6_ENC : POOL32F_MATH_FM_MMR6<"rsqrt.s", 0, 0b00001000>;
127class RSQRT_D_MMR6_ENC : POOL32F_MATH_FM_MMR6<"rsqrt.d", 1, 0b00001000>;
128class SB_MMR6_ENC : SB32_SH32_STORE_FM_MMR6<0b000110>;
129class SBE_MMR6_ENC : POOL32C_STORE_EVA_FM_MMR6<0b100>;
130class SCE_MMR6_ENC : POOL32C_STORE_EVA_FM_MMR6<0b110>;
131class SH_MMR6_ENC : SB32_SH32_STORE_FM_MMR6<0b001110>;
132class SHE_MMR6_ENC : POOL32C_STORE_EVA_FM_MMR6<0b101>;
133class LLE_MMR6_ENC : LOAD_WORD_EVA_FM_MMR6<0b110>;
134class LWE_MMR6_ENC : LOAD_WORD_EVA_FM_MMR6<0b111>;
135class LW_MMR6_ENC : LOAD_WORD_FM_MMR6;
136class LUI_MMR6_ENC : LOAD_UPPER_IMM_FM_MMR6;
137class RECIP_S_MMR6_ENC : POOL32F_RECIP_ROUND_FM_MMR6<"recip.s", 0, 0b01001000>;
138class RECIP_D_MMR6_ENC : POOL32F_RECIP_ROUND_FM_MMR6<"recip.d", 1, 0b01001000>;
139class RINT_S_MMR6_ENC : POOL32F_RINT_FM_MMR6<"rint.s", 0>;
140class RINT_D_MMR6_ENC : POOL32F_RINT_FM_MMR6<"rint.d", 1>;
141class ROUND_L_S_MMR6_ENC : POOL32F_RECIP_ROUND_FM_MMR6<"round.l.s", 0,
142                                                       0b11001100>;
143class ROUND_L_D_MMR6_ENC : POOL32F_RECIP_ROUND_FM_MMR6<"round.l.d", 1,
144                                                       0b11001100>;
145class ROUND_W_S_MMR6_ENC : POOL32F_RECIP_ROUND_FM_MMR6<"round.w.s", 0,
146                                                       0b11101100>;
147class ROUND_W_D_MMR6_ENC : POOL32F_RECIP_ROUND_FM_MMR6<"round.w.d", 1,
148                                                       0b11101100>;
149class SEL_S_MMR6_ENC : POOL32F_SEL_FM_MMR6<"sel.s", 0, 0b010111000>;
150class SEL_D_MMR6_ENC : POOL32F_SEL_FM_MMR6<"sel.d", 1, 0b010111000>;
151class SELEQZ_S_MMR6_ENC : POOL32F_SEL_FM_MMR6<"seleqz.s", 0, 0b000111000>;
152class SELEQZ_D_MMR6_ENC : POOL32F_SEL_FM_MMR6<"seleqz.d", 1, 0b000111000>;
153class SELENZ_S_MMR6_ENC : POOL32F_SEL_FM_MMR6<"selenz.s", 0, 0b001111000>;
154class SELENZ_D_MMR6_ENC : POOL32F_SEL_FM_MMR6<"selenz.d", 1, 0b001111000>;
155class CLASS_S_MMR6_ENC : POOL32F_CLASS_FM_MMR6<"class.s", 0, 0b001100000>;
156class CLASS_D_MMR6_ENC : POOL32F_CLASS_FM_MMR6<"class.d", 1, 0b001100000>;
157
158class ADDU16_MMR6_ENC : POOL16A_ADDU16_FM_MMR6;
159class AND16_MMR6_ENC : POOL16C_AND16_FM_MMR6;
160class ANDI16_MMR6_ENC : ANDI_FM_MM16<0b001011>, MicroMipsR6Inst16;
161class NOT16_MMR6_ENC : POOL16C_NOT16_FM_MMR6;
162class OR16_MMR6_ENC : POOL16C_OR16_XOR16_FM_MMR6<0b1001>;
163class SLL16_MMR6_ENC : SHIFT_FM_MM16<0>, MicroMipsR6Inst16;
164class SRL16_MMR6_ENC : SHIFT_FM_MM16<1>, MicroMipsR6Inst16;
165class BREAK16_MMR6_ENC : POOL16C_BREAKPOINT_FM_MMR6<0b011011>;
166class LI16_MMR6_ENC : LI_FM_MM16;
167class MOVE16_MMR6_ENC : MOVE_FM_MM16<0b000011>;
168class SDBBP16_MMR6_ENC : POOL16C_BREAKPOINT_FM_MMR6<0b111011>;
169class SUBU16_MMR6_ENC : POOL16A_SUBU16_FM_MMR6;
170class XOR16_MMR6_ENC : POOL16C_OR16_XOR16_FM_MMR6<0b1000>;
171
172class CMP_CBR_RT_Z_MMR6_DESC_BASE<string instr_asm, DAGOperand opnd,
173                                  RegisterOperand GPROpnd>
174    : BRANCH_DESC_BASE, MMR6Arch<instr_asm> {
175  dag InOperandList = (ins GPROpnd:$rt, opnd:$offset);
176  dag OutOperandList = (outs);
177  string AsmString = !strconcat(instr_asm, "\t$rt, $offset");
178  list<Register> Defs = [AT];
179}
180
181class BEQZALC_MMR6_DESC : CMP_CBR_RT_Z_MMR6_DESC_BASE<"beqzalc", brtarget_mm,
182                                                      GPR32Opnd> {
183  list<Register> Defs = [RA];
184}
185
186class BGEZALC_MMR6_DESC : CMP_CBR_RT_Z_MMR6_DESC_BASE<"bgezalc", brtarget_mm,
187                                                      GPR32Opnd> {
188  list<Register> Defs = [RA];
189}
190
191class BGTZALC_MMR6_DESC : CMP_CBR_RT_Z_MMR6_DESC_BASE<"bgtzalc", brtarget_mm,
192                                                      GPR32Opnd> {
193  list<Register> Defs = [RA];
194}
195
196class BLEZALC_MMR6_DESC : CMP_CBR_RT_Z_MMR6_DESC_BASE<"blezalc", brtarget_mm,
197                                                      GPR32Opnd> {
198  list<Register> Defs = [RA];
199}
200
201class BLTZALC_MMR6_DESC : CMP_CBR_RT_Z_MMR6_DESC_BASE<"bltzalc", brtarget_mm,
202                                                      GPR32Opnd> {
203  list<Register> Defs = [RA];
204}
205
206class BNEZALC_MMR6_DESC : CMP_CBR_RT_Z_MMR6_DESC_BASE<"bnezalc", brtarget_mm,
207                                                      GPR32Opnd> {
208  list<Register> Defs = [RA];
209}
210
211/// Floating Point Instructions
212class FADD_S_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"add.s", 0, 0b00110000>;
213class FADD_D_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"add.d", 1, 0b00110000>;
214class FSUB_S_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"sub.s", 0, 0b01110000>;
215class FSUB_D_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"sub.d", 1, 0b01110000>;
216class FMUL_S_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"mul.s", 0, 0b10110000>;
217class FMUL_D_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"mul.d", 1, 0b10110000>;
218class FDIV_S_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"div.s", 0, 0b11110000>;
219class FDIV_D_MMR6_ENC : POOL32F_ARITH_FM_MMR6<"div.d", 1, 0b11110000>;
220class MADDF_S_MMR6_ENC : POOL32F_ARITHF_FM_MMR6<"maddf.s", 0, 0b110111000>;
221class MADDF_D_MMR6_ENC : POOL32F_ARITHF_FM_MMR6<"maddf.d", 1, 0b110111000>;
222class MSUBF_S_MMR6_ENC : POOL32F_ARITHF_FM_MMR6<"msubf.s", 0, 0b111111000>;
223class MSUBF_D_MMR6_ENC : POOL32F_ARITHF_FM_MMR6<"msubf.d", 1, 0b111111000>;
224class FMOV_S_MMR6_ENC : POOL32F_MOV_NEG_FM_MMR6<"mov.s", 0, 0b0000001>;
225class FMOV_D_MMR6_ENC : POOL32F_MOV_NEG_FM_MMR6<"mov.d", 1, 0b0000001>;
226class FNEG_S_MMR6_ENC : POOL32F_MOV_NEG_FM_MMR6<"neg.s", 0, 0b0101101>;
227class FNEG_D_MMR6_ENC : POOL32F_MOV_NEG_FM_MMR6<"neg.d", 1, 0b0101101>;
228class MAX_S_MMR6_ENC : POOL32F_MINMAX_FM<"max.s", 0, 0b000001011>;
229class MAX_D_MMR6_ENC : POOL32F_MINMAX_FM<"max.d", 1, 0b000001011>;
230class MAXA_S_MMR6_ENC : POOL32F_MINMAX_FM<"maxa.s", 0, 0b000101011>;
231class MAXA_D_MMR6_ENC : POOL32F_MINMAX_FM<"maxa.d", 1, 0b000101011>;
232class MIN_S_MMR6_ENC : POOL32F_MINMAX_FM<"min.s", 0, 0b000000011>;
233class MIN_D_MMR6_ENC : POOL32F_MINMAX_FM<"min.d", 1, 0b000000011>;
234class MINA_S_MMR6_ENC : POOL32F_MINMAX_FM<"mina.s", 0, 0b000100011>;
235class MINA_D_MMR6_ENC : POOL32F_MINMAX_FM<"mina.d", 1, 0b000100011>;
236
237class CVT_L_S_MMR6_ENC : POOL32F_CVT_LW_FM<"cvt.l.s", 0, 0b00000100>;
238class CVT_L_D_MMR6_ENC : POOL32F_CVT_LW_FM<"cvt.l.d", 1, 0b00000100>;
239class CVT_W_S_MMR6_ENC : POOL32F_CVT_LW_FM<"cvt.w.s", 0, 0b00100100>;
240class CVT_W_D_MMR6_ENC : POOL32F_CVT_LW_FM<"cvt.w.d", 1, 0b00100100>;
241class CVT_D_S_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.d.s", 0, 0b1001101>;
242class CVT_D_W_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.d.w", 1, 0b1001101>;
243class CVT_D_L_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.d.l", 2, 0b1001101>;
244class CVT_S_D_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.s.d", 0, 0b1101101>;
245class CVT_S_W_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.s.w", 1, 0b1101101>;
246class CVT_S_L_MMR6_ENC : POOL32F_CVT_DS_FM<"cvt.s.l", 2, 0b1101101>;
247
248//===----------------------------------------------------------------------===//
249//
250// Instruction Descriptions
251//
252//===----------------------------------------------------------------------===//
253
254class ADD_MMR6_DESC : ArithLogicR<"add", GPR32Opnd>;
255class ADDIU_MMR6_DESC : ArithLogicI<"addiu", simm16, GPR32Opnd>;
256class ADDU_MMR6_DESC : ArithLogicR<"addu", GPR32Opnd>;
257class MUL_MMR6_DESC : ArithLogicR<"mul", GPR32Opnd>;
258class MUH_MMR6_DESC : ArithLogicR<"muh", GPR32Opnd>;
259class MULU_MMR6_DESC : ArithLogicR<"mulu", GPR32Opnd>;
260class MUHU_MMR6_DESC : ArithLogicR<"muhu", GPR32Opnd>;
261
262class BC_MMR6_DESC_BASE<string instr_asm, DAGOperand opnd>
263    : BRANCH_DESC_BASE, MMR6Arch<instr_asm> {
264  dag InOperandList = (ins opnd:$offset);
265  dag OutOperandList = (outs);
266  string AsmString = !strconcat(instr_asm, "\t$offset");
267  bit isBarrier = 1;
268}
269
270class BALC_MMR6_DESC : BC_MMR6_DESC_BASE<"balc", brtarget26_mm> {
271  bit isCall = 1;
272  list<Register> Defs = [RA];
273}
274class BC_MMR6_DESC : BC_MMR6_DESC_BASE<"bc", brtarget26_mm>;
275
276class BC16_MMR6_DESC : MicroMipsInst16<(outs), (ins brtarget10_mm:$offset),
277                                       !strconcat("bc16", "\t$offset"), [],
278                                       II_BC, FrmI>,
279                       MMR6Arch<"bc16">, MicroMipsR6Inst16 {
280  let isBranch = 1;
281  let isTerminator = 1;
282  let isBarrier = 1;
283  let hasDelaySlot = 0;
284  let AdditionalPredicates = [RelocPIC];
285  let Defs = [AT];
286}
287
288class BEQZC_BNEZC_MM16R6_DESC_BASE<string instr_asm>
289    : CBranchZeroMM<instr_asm, brtarget7_mm, GPRMM16Opnd>, MMR6Arch<instr_asm> {
290  let isBranch = 1;
291  let isTerminator = 1;
292  let hasDelaySlot = 0;
293  let Defs = [AT];
294}
295class BEQZC16_MMR6_DESC : BEQZC_BNEZC_MM16R6_DESC_BASE<"beqzc16">;
296class BNEZC16_MMR6_DESC : BEQZC_BNEZC_MM16R6_DESC_BASE<"bnezc16">;
297
298class SUB_MMR6_DESC : ArithLogicR<"sub", GPR32Opnd>;
299class SUBU_MMR6_DESC : ArithLogicR<"subu", GPR32Opnd>;
300
301class BITSWAP_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
302    : MMR6Arch<instr_asm> {
303  dag OutOperandList = (outs GPROpnd:$rd);
304  dag InOperandList = (ins GPROpnd:$rt);
305  string AsmString = !strconcat(instr_asm, "\t$rd, $rt");
306  list<dag> Pattern = [];
307}
308
309class BITSWAP_MMR6_DESC : BITSWAP_MMR6_DESC_BASE<"bitswap", GPR32Opnd>;
310
311class BRK_MMR6_DESC : BRK_FT<"break">;
312
313class CACHE_HINT_MMR6_DESC<string instr_asm, Operand MemOpnd,
314                           RegisterOperand GPROpnd> : MMR6Arch<instr_asm> {
315  dag OutOperandList = (outs);
316  dag InOperandList = (ins MemOpnd:$addr, uimm5:$hint);
317  string AsmString = !strconcat(instr_asm, "\t$hint, $addr");
318  list<dag> Pattern = [];
319  string DecoderMethod = "DecodeCacheOpMM";
320}
321
322class CACHE_MMR6_DESC : CACHE_HINT_MMR6_DESC<"cache", mem_mm_12, GPR32Opnd>;
323class PREF_MMR6_DESC : CACHE_HINT_MMR6_DESC<"pref", mem_mm_12, GPR32Opnd>;
324
325class PREFE_CACHEE_MMR6_DESC_BASE<string instr_asm, Operand MemOpnd,
326                                  RegisterOperand GPROpnd> :
327                                  CACHE_HINT_MMR6_DESC<instr_asm, MemOpnd,
328                                  GPROpnd> {
329  string DecoderMethod = "DecodePrefeOpMM";
330}
331
332class PREFE_MMR6_DESC : PREFE_CACHEE_MMR6_DESC_BASE<"prefe", mem_mm_9, GPR32Opnd>;
333class CACHEE_MMR6_DESC : PREFE_CACHEE_MMR6_DESC_BASE<"cachee", mem_mm_9, GPR32Opnd>;
334
335class LB_LBU_MMR6_DESC_BASE<string instr_asm, Operand MemOpnd,
336                            RegisterOperand GPROpnd> : MMR6Arch<instr_asm> {
337  dag OutOperandList = (outs GPROpnd:$rt);
338  dag InOperandList = (ins MemOpnd:$addr);
339  string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
340  string DecoderMethod = "DecodeLoadByte15";
341  bit mayLoad = 1;
342}
343class LB_MMR6_DESC : LB_LBU_MMR6_DESC_BASE<"lb", mem_mm_16, GPR32Opnd>;
344class LBU_MMR6_DESC : LB_LBU_MMR6_DESC_BASE<"lbu", mem_mm_16, GPR32Opnd>;
345
346class LBE_LBUE_MMR6_DESC_BASE<string instr_asm, Operand MemOpnd,
347                              RegisterOperand GPROpnd>
348    : LB_LBU_MMR6_DESC_BASE<instr_asm, MemOpnd, GPROpnd> {
349  let DecoderMethod = "DecodeLoadByte9";
350}
351class LBE_MMR6_DESC : LBE_LBUE_MMR6_DESC_BASE<"lbe", mem_mm_9, GPR32Opnd>;
352class LBUE_MMR6_DESC : LBE_LBUE_MMR6_DESC_BASE<"lbue", mem_mm_9, GPR32Opnd>;
353
354class CLO_CLZ_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
355    : MMR6Arch<instr_asm> {
356  dag OutOperandList = (outs GPROpnd:$rt);
357  dag InOperandList = (ins GPROpnd:$rs);
358  string AsmString = !strconcat(instr_asm, "\t$rt, $rs");
359}
360
361class CLO_MMR6_DESC : CLO_CLZ_MMR6_DESC_BASE<"clo", GPR32Opnd>;
362class CLZ_MMR6_DESC : CLO_CLZ_MMR6_DESC_BASE<"clz", GPR32Opnd>;
363
364class EHB_MMR6_DESC : Barrier<"ehb">;
365class EI_MMR6_DESC : DEI_FT<"ei", GPR32Opnd>;
366class DI_MMR6_DESC : DEI_FT<"di", GPR32Opnd>;
367
368class ERET_MMR6_DESC : ER_FT<"eret">;
369class DERET_MMR6_DESC : ER_FT<"deret">;
370class ERETNC_MMR6_DESC : ER_FT<"eretnc">;
371
372class JALRC16_MMR6_DESC_BASE<string opstr, RegisterOperand RO>
373    : MicroMipsInst16<(outs), (ins RO:$rs), !strconcat(opstr, "\t$rs"),
374                      [(MipsJmpLink RO:$rs)], II_JALR, FrmR>,
375      MMR6Arch<opstr>, MicroMipsR6Inst16 {
376  let isCall = 1;
377  let hasDelaySlot = 0;
378  let Defs = [RA];
379}
380class JALRC16_MMR6_DESC : JALRC16_MMR6_DESC_BASE<"jalr", GPR32Opnd>;
381
382class JMP_MMR6_IDX_COMPACT_DESC_BASE<string opstr, DAGOperand opnd,
383                                     RegisterOperand GPROpnd>
384    : MMR6Arch<opstr> {
385  dag InOperandList = (ins GPROpnd:$rt, opnd:$offset);
386  string AsmString = !strconcat(opstr, "\t$rt, $offset");
387  list<dag> Pattern = [];
388  bit isTerminator = 1;
389  bit hasDelaySlot = 0;
390}
391
392class JIALC_MMR6_DESC : JMP_MMR6_IDX_COMPACT_DESC_BASE<"jialc", calloffset16,
393                                                       GPR32Opnd> {
394  bit isCall = 1;
395  list<Register> Defs = [RA];
396}
397
398class JIC_MMR6_DESC : JMP_MMR6_IDX_COMPACT_DESC_BASE<"jic", jmpoffset16,
399                                                     GPR32Opnd> {
400  bit isBarrier = 1;
401  list<Register> Defs = [AT];
402}
403
404class JRC16_MMR6_DESC_BASE<string opstr, RegisterOperand RO>
405    : MicroMipsInst16<(outs), (ins RO:$rs), !strconcat(opstr, "\t$rs"),
406                      [], II_JR, FrmR>,
407      MMR6Arch<opstr>, MicroMipsR6Inst16 {
408  let hasDelaySlot = 0;
409  let isBranch = 1;
410  let isIndirectBranch = 1;
411}
412class JRC16_MMR6_DESC : JRC16_MMR6_DESC_BASE<"jrc16", GPR32Opnd>;
413
414class JRCADDIUSP_MMR6_DESC
415    : MicroMipsInst16<(outs), (ins uimm5_lsl2:$imm), "jrcaddiusp\t$imm",
416                      [], II_JRADDIUSP, FrmR>,
417      MMR6Arch<"jrcaddiusp">, MicroMipsR6Inst16 {
418  let hasDelaySlot = 0;
419  let isTerminator = 1;
420  let isBarrier = 1;
421  let isBranch = 1;
422  let isIndirectBranch = 1;
423}
424
425class ALIGN_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
426                      Operand ImmOpnd>  : MMR6Arch<instr_asm> {
427  dag OutOperandList = (outs GPROpnd:$rd);
428  dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, ImmOpnd:$bp);
429  string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt, $bp");
430  list<dag> Pattern = [];
431}
432
433class ALIGN_MMR6_DESC : ALIGN_MMR6_DESC_BASE<"align", GPR32Opnd, uimm2>;
434
435class AUI_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
436    : MMR6Arch<instr_asm> {
437  dag OutOperandList = (outs GPROpnd:$rt);
438  dag InOperandList = (ins GPROpnd:$rs, simm16:$imm);
439  string AsmString = !strconcat(instr_asm, "\t$rt, $rs, $imm");
440  list<dag> Pattern = [];
441}
442
443class AUI_MMR6_DESC : AUI_MMR6_DESC_BASE<"aui", GPR32Opnd>;
444
445class SEB_MMR6_DESC : SignExtInReg<"seb", i8, GPR32Opnd, II_SEB>;
446class SEH_MMR6_DESC : SignExtInReg<"seh", i16, GPR32Opnd, II_SEH>;
447class ALUIPC_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
448    : MMR6Arch<instr_asm> {
449  dag OutOperandList = (outs GPROpnd:$rt);
450  dag InOperandList = (ins simm16:$imm);
451  string AsmString = !strconcat(instr_asm, "\t$rt, $imm");
452  list<dag> Pattern = [];
453}
454
455class ALUIPC_MMR6_DESC : ALUIPC_MMR6_DESC_BASE<"aluipc", GPR32Opnd>;
456class AUIPC_MMR6_DESC : ALUIPC_MMR6_DESC_BASE<"auipc", GPR32Opnd>;
457
458class LSA_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
459                         Operand ImmOpnd> : MMR6Arch<instr_asm> {
460  dag OutOperandList = (outs GPROpnd:$rd);
461  dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, ImmOpnd:$imm2);
462  string AsmString = !strconcat(instr_asm, "\t$rt, $rs, $rd, $imm2");
463  list<dag> Pattern = [];
464}
465
466class LSA_MMR6_DESC : LSA_MMR6_DESC_BASE<"lsa", GPR32Opnd, uimm2_plus1>;
467
468class PCREL_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
469                           Operand ImmOpnd> : MMR6Arch<instr_asm> {
470  dag OutOperandList = (outs GPROpnd:$rt);
471  dag InOperandList = (ins ImmOpnd:$imm);
472  string AsmString = !strconcat(instr_asm, "\t$rt, $imm");
473  list<dag> Pattern = [];
474}
475
476class ADDIUPC_MMR6_DESC : PCREL_MMR6_DESC_BASE<"addiupc", GPR32Opnd, simm19_lsl2>;
477class LWPC_MMR6_DESC: PCREL_MMR6_DESC_BASE<"lwpc", GPR32Opnd, simm19_lsl2>;
478
479class SELEQNE_Z_MMR6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd>
480    : MMR6Arch<instr_asm> {
481  dag OutOperandList = (outs GPROpnd:$rd);
482  dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt);
483  string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt");
484  list<dag> Pattern = [];
485}
486
487class SELEQZ_MMR6_DESC : SELEQNE_Z_MMR6_DESC_BASE<"seleqz", GPR32Opnd>;
488class SELNEZ_MMR6_DESC : SELEQNE_Z_MMR6_DESC_BASE<"selnez", GPR32Opnd>;
489class PAUSE_MMR6_DESC : Barrier<"pause">;
490class RDHWR_MMR6_DESC : MMR6Arch<"rdhwr">, MipsR6Inst {
491  dag OutOperandList = (outs GPR32Opnd:$rt);
492  dag InOperandList = (ins HWRegsOpnd:$rs, uimm3:$sel);
493  string AsmString = !strconcat("rdhwr", "\t$rt, $rs, $sel");
494  list<dag> Pattern = [];
495  InstrItinClass Itinerary = II_RDHWR;
496  Format Form = FrmR;
497}
498
499class WAIT_MMR6_DESC : WaitMM<"wait">;
500class SSNOP_MMR6_DESC : Barrier<"ssnop">;
501class SLL_MMR6_DESC : shift_rotate_imm<"sll", uimm5, GPR32Opnd, II_SLL>;
502class DIV_MMR6_DESC : ArithLogicR<"div", GPR32Opnd>;
503class DIVU_MMR6_DESC : ArithLogicR<"divu", GPR32Opnd>;
504class MOD_MMR6_DESC : ArithLogicR<"mod", GPR32Opnd>;
505class MODU_MMR6_DESC : ArithLogicR<"modu", GPR32Opnd>;
506class AND_MMR6_DESC : ArithLogicR<"and", GPR32Opnd>;
507class ANDI_MMR6_DESC : ArithLogicI<"andi", simm16, GPR32Opnd>;
508class NOR_MMR6_DESC : ArithLogicR<"nor", GPR32Opnd>;
509class OR_MMR6_DESC : ArithLogicR<"or", GPR32Opnd>;
510class ORI_MMR6_DESC : ArithLogicI<"ori", simm16, GPR32Opnd>;
511class XOR_MMR6_DESC : ArithLogicR<"xor", GPR32Opnd>;
512class XORI_MMR6_DESC : ArithLogicI<"xori", simm16, GPR32Opnd>;
513
514class SWE_MMR6_DESC_BASE<string opstr, DAGOperand RO, DAGOperand MO,
515                  SDPatternOperator OpNode = null_frag,
516                  InstrItinClass Itin = NoItinerary,
517                  ComplexPattern Addr = addr> :
518  InstSE<(outs), (ins RO:$rt, MO:$addr), !strconcat(opstr, "\t$rt, $addr"),
519         [(OpNode RO:$rt, Addr:$addr)], Itin, FrmI, opstr> {
520  let DecoderMethod = "DecodeMem";
521  let mayStore = 1;
522}
523class SW_MMR6_DESC : Store<"sw", GPR32Opnd>;
524class SWE_MMR6_DESC : SWE_MMR6_DESC_BASE<"swe", GPR32Opnd, mem_simm9>;
525
526class WRPGPR_WSBH_MMR6_DESC_BASE<string instr_asm, RegisterOperand RO>
527    : MMR6Arch<instr_asm> {
528  dag InOperandList = (ins RO:$rs);
529  dag OutOperandList = (outs RO:$rt);
530  string AsmString = !strconcat(instr_asm, "\t$rt, $rs");
531  list<dag> Pattern = [];
532  Format f = FrmR;
533  string BaseOpcode = instr_asm;
534  bit hasSideEffects = 0;
535}
536class WRPGPR_MMR6_DESC : WRPGPR_WSBH_MMR6_DESC_BASE<"wrpgpr", GPR32Opnd>;
537class WSBH_MMR6_DESC : WRPGPR_WSBH_MMR6_DESC_BASE<"wsbh", GPR32Opnd>;
538
539/// Floating Point Instructions
540class FARITH_MMR6_DESC_BASE<string instr_asm, RegisterOperand RC,
541                            InstrItinClass Itin, bit isComm,
542                            SDPatternOperator OpNode = null_frag> : HARDFLOAT {
543  dag OutOperandList = (outs RC:$fd);
544  dag InOperandList = (ins RC:$ft, RC:$fs);
545  string AsmString = !strconcat(instr_asm, "\t$fd, $fs, $ft");
546  list<dag> Pattern = [(set RC:$fd, (OpNode RC:$fs, RC:$ft))];
547  InstrItinClass Itinerary = Itin;
548  bit isCommutable = isComm;
549}
550class FADD_S_MMR6_DESC
551  : FARITH_MMR6_DESC_BASE<"add.s", FGR32Opnd, II_ADD_S, 1, fadd>;
552class FADD_D_MMR6_DESC
553  : FARITH_MMR6_DESC_BASE<"add.d", AFGR64Opnd, II_ADD_D, 1, fadd>;
554class FSUB_S_MMR6_DESC
555  : FARITH_MMR6_DESC_BASE<"sub.s", FGR32Opnd, II_SUB_S, 0, fsub>;
556class FSUB_D_MMR6_DESC
557  : FARITH_MMR6_DESC_BASE<"sub.d", AFGR64Opnd, II_SUB_D, 0, fsub>;
558class FMUL_S_MMR6_DESC
559  : FARITH_MMR6_DESC_BASE<"mul.s", FGR32Opnd, II_MUL_S, 1, fmul>;
560class FMUL_D_MMR6_DESC
561  : FARITH_MMR6_DESC_BASE<"mul.d", AFGR64Opnd, II_MUL_D, 1, fmul>;
562class FDIV_S_MMR6_DESC
563  : FARITH_MMR6_DESC_BASE<"div.s", FGR32Opnd, II_DIV_S, 0, fdiv>;
564class FDIV_D_MMR6_DESC
565  : FARITH_MMR6_DESC_BASE<"div.d", AFGR64Opnd, II_DIV_D, 0, fdiv>;
566class MADDF_S_MMR6_DESC : COP1_4R_DESC_BASE<"maddf.s", FGR32Opnd>, HARDFLOAT;
567class MADDF_D_MMR6_DESC : COP1_4R_DESC_BASE<"maddf.d", FGR64Opnd>, HARDFLOAT;
568class MSUBF_S_MMR6_DESC : COP1_4R_DESC_BASE<"msubf.s", FGR32Opnd>, HARDFLOAT;
569class MSUBF_D_MMR6_DESC : COP1_4R_DESC_BASE<"msubf.d", FGR64Opnd>, HARDFLOAT;
570
571class FMOV_FNEG_MMR6_DESC_BASE<string instr_asm, RegisterOperand DstRC,
572                               RegisterOperand SrcRC, InstrItinClass Itin,
573                               SDPatternOperator OpNode = null_frag>
574                               : HARDFLOAT, NeverHasSideEffects {
575  dag OutOperandList = (outs DstRC:$ft);
576  dag InOperandList = (ins SrcRC:$fs);
577  string AsmString = !strconcat(instr_asm, "\t$ft, $fs");
578  list<dag> Pattern = [(set DstRC:$ft, (OpNode SrcRC:$fs))];
579  InstrItinClass Itinerary = Itin;
580  Format Form = FrmFR;
581}
582class FMOV_S_MMR6_DESC
583  : FMOV_FNEG_MMR6_DESC_BASE<"mov.s", FGR32Opnd, FGR32Opnd, II_MOV_S>;
584class FMOV_D_MMR6_DESC
585  : FMOV_FNEG_MMR6_DESC_BASE<"mov.d", AFGR64Opnd, AFGR64Opnd, II_MOV_D>;
586class FNEG_S_MMR6_DESC
587  : FMOV_FNEG_MMR6_DESC_BASE<"neg.s", FGR32Opnd, FGR32Opnd, II_NEG, fneg>;
588class FNEG_D_MMR6_DESC
589  : FMOV_FNEG_MMR6_DESC_BASE<"neg.d", AFGR64Opnd, AFGR64Opnd, II_NEG, fneg>;
590
591class MAX_S_MMR6_DESC : MAX_MIN_DESC_BASE<"max.s", FGR32Opnd>, HARDFLOAT;
592class MAX_D_MMR6_DESC : MAX_MIN_DESC_BASE<"max.d", FGR64Opnd>, HARDFLOAT;
593class MIN_S_MMR6_DESC : MAX_MIN_DESC_BASE<"min.s", FGR32Opnd>, HARDFLOAT;
594class MIN_D_MMR6_DESC : MAX_MIN_DESC_BASE<"min.d", FGR64Opnd>, HARDFLOAT;
595
596class MAXA_S_MMR6_DESC : MAX_MIN_DESC_BASE<"maxa.s", FGR32Opnd>, HARDFLOAT;
597class MAXA_D_MMR6_DESC : MAX_MIN_DESC_BASE<"maxa.d", FGR64Opnd>, HARDFLOAT;
598class MINA_S_MMR6_DESC : MAX_MIN_DESC_BASE<"mina.s", FGR32Opnd>, HARDFLOAT;
599class MINA_D_MMR6_DESC : MAX_MIN_DESC_BASE<"mina.d", FGR64Opnd>, HARDFLOAT;
600
601class CVT_MMR6_DESC_BASE<
602    string instr_asm, RegisterOperand DstRC, RegisterOperand SrcRC,
603    InstrItinClass Itin, SDPatternOperator OpNode = null_frag>
604    : HARDFLOAT, NeverHasSideEffects {
605  dag OutOperandList = (outs DstRC:$ft);
606  dag InOperandList = (ins SrcRC:$fs);
607  string AsmString = !strconcat(instr_asm, "\t$ft, $fs");
608  list<dag> Pattern = [(set DstRC:$ft, (OpNode SrcRC:$fs))];
609  InstrItinClass Itinerary = Itin;
610  Format Form = FrmFR;
611}
612
613class CVT_L_S_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.l.s", FGR64Opnd, FGR32Opnd,
614                                             II_CVT>;
615class CVT_L_D_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.l.d", FGR64Opnd, FGR64Opnd,
616                                             II_CVT>;
617class CVT_W_S_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.w.s", FGR32Opnd, FGR32Opnd,
618                                             II_CVT>;
619class CVT_W_D_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.w.d", FGR32Opnd, AFGR64Opnd,
620                                             II_CVT>;
621class CVT_D_S_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.d.s", FGR32Opnd, AFGR64Opnd,
622                                             II_CVT>;
623class CVT_D_W_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.d.w", FGR32Opnd, AFGR64Opnd,
624                                             II_CVT>;
625class CVT_D_L_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.d.l", FGR64Opnd, FGR64Opnd,
626                                             II_CVT>, FGR_64;
627class CVT_S_D_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.s.d", AFGR64Opnd, FGR32Opnd,
628                                             II_CVT>;
629class CVT_S_W_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.s.w", FGR32Opnd, FGR32Opnd,
630                                             II_CVT>;
631class CVT_S_L_MMR6_DESC : CVT_MMR6_DESC_BASE<"cvt.s.l", FGR64Opnd, FGR32Opnd,
632                                             II_CVT>, FGR_64;
633
634multiclass CMP_CC_MMR6<bits<6> format, string Typestr,
635                       RegisterOperand FGROpnd> {
636  def CMP_AF_#NAME : POOL32F_CMP_FM<
637      !strconcat("cmp.af.", Typestr), format, FIELD_CMP_COND_AF>,
638      CMP_CONDN_DESC_BASE<"af", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
639      ISA_MICROMIPS32R6;
640  def CMP_UN_#NAME : POOL32F_CMP_FM<
641      !strconcat("cmp.un.", Typestr), format, FIELD_CMP_COND_UN>,
642      CMP_CONDN_DESC_BASE<"un", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
643      ISA_MICROMIPS32R6;
644  def CMP_EQ_#NAME : POOL32F_CMP_FM<
645      !strconcat("cmp.eq.", Typestr), format, FIELD_CMP_COND_EQ>,
646      CMP_CONDN_DESC_BASE<"eq", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
647      ISA_MICROMIPS32R6;
648  def CMP_UEQ_#NAME : POOL32F_CMP_FM<
649      !strconcat("cmp.ueq.", Typestr), format, FIELD_CMP_COND_UEQ>,
650      CMP_CONDN_DESC_BASE<"ueq", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
651      ISA_MICROMIPS32R6;
652  def CMP_LT_#NAME : POOL32F_CMP_FM<
653      !strconcat("cmp.lt.", Typestr), format, FIELD_CMP_COND_LT>,
654      CMP_CONDN_DESC_BASE<"lt", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
655      ISA_MICROMIPS32R6;
656  def CMP_ULT_#NAME : POOL32F_CMP_FM<
657      !strconcat("cmp.ult.", Typestr), format, FIELD_CMP_COND_ULT>,
658      CMP_CONDN_DESC_BASE<"ult", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
659      ISA_MICROMIPS32R6;
660  def CMP_LE_#NAME : POOL32F_CMP_FM<
661      !strconcat("cmp.le.", Typestr), format, FIELD_CMP_COND_LE>,
662      CMP_CONDN_DESC_BASE<"le", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
663      ISA_MICROMIPS32R6;
664  def CMP_ULE_#NAME : POOL32F_CMP_FM<
665      !strconcat("cmp.ule.", Typestr), format, FIELD_CMP_COND_ULE>,
666      CMP_CONDN_DESC_BASE<"ule", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
667      ISA_MICROMIPS32R6;
668  def CMP_SAF_#NAME : POOL32F_CMP_FM<
669      !strconcat("cmp.saf.", Typestr), format, FIELD_CMP_COND_SAF>,
670      CMP_CONDN_DESC_BASE<"saf", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
671      ISA_MICROMIPS32R6;
672  def CMP_SUN_#NAME : POOL32F_CMP_FM<
673      !strconcat("cmp.sun.", Typestr), format, FIELD_CMP_COND_SUN>,
674      CMP_CONDN_DESC_BASE<"sun", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
675      ISA_MICROMIPS32R6;
676  def CMP_SEQ_#NAME : POOL32F_CMP_FM<
677      !strconcat("cmp.seq.", Typestr), format, FIELD_CMP_COND_SEQ>,
678      CMP_CONDN_DESC_BASE<"seq", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
679      ISA_MICROMIPS32R6;
680  def CMP_SUEQ_#NAME : POOL32F_CMP_FM<
681      !strconcat("cmp.sueq.", Typestr), format, FIELD_CMP_COND_SUEQ>,
682      CMP_CONDN_DESC_BASE<"sueq", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
683      ISA_MICROMIPS32R6;
684  def CMP_SLT_#NAME : POOL32F_CMP_FM<
685      !strconcat("cmp.slt.", Typestr), format, FIELD_CMP_COND_SLT>,
686      CMP_CONDN_DESC_BASE<"slt", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
687      ISA_MICROMIPS32R6;
688  def CMP_SULT_#NAME : POOL32F_CMP_FM<
689      !strconcat("cmp.sult.", Typestr), format, FIELD_CMP_COND_SULT>,
690      CMP_CONDN_DESC_BASE<"sult", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
691      ISA_MICROMIPS32R6;
692  def CMP_SLE_#NAME : POOL32F_CMP_FM<
693      !strconcat("cmp.sle.", Typestr), format, FIELD_CMP_COND_SLE>,
694      CMP_CONDN_DESC_BASE<"sle", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
695      ISA_MICROMIPS32R6;
696  def CMP_SULE_#NAME : POOL32F_CMP_FM<
697      !strconcat("cmp.sule.", Typestr), format, FIELD_CMP_COND_SULE>,
698      CMP_CONDN_DESC_BASE<"sule", Typestr, FGROpnd>, HARDFLOAT, R6MMR6Rel,
699      ISA_MICROMIPS32R6;
700}
701
702class ABSS_FT_MMR6_DESC_BASE<string instr_asm, RegisterOperand DstRC,
703                             RegisterOperand SrcRC, InstrItinClass Itin,
704                             SDPatternOperator OpNode = null_frag>
705    : HARDFLOAT, NeverHasSideEffects {
706  dag OutOperandList = (outs DstRC:$ft);
707  dag InOperandList  = (ins SrcRC:$fs);
708  string AsmString   = !strconcat(instr_asm, "\t$ft, $fs");
709  list<dag>  Pattern = [(set DstRC:$ft, (OpNode SrcRC:$fs))];
710  InstrItinClass Itinerary = Itin;
711  Format Form = FrmFR;
712  list<Predicate> EncodingPredicates = [HasStdEnc];
713}
714
715class ABS_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"abs.s", FGR32Opnd, FGR32Opnd,
716                                                II_ABS, fabs>;
717class ABS_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"abs.d", AFGR64Opnd, AFGR64Opnd,
718                                                II_ABS, fabs>;
719class FLOOR_L_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"floor.l.s", FGR64Opnd,
720                                                    FGR32Opnd, II_FLOOR>;
721class FLOOR_L_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"floor.l.d", FGR64Opnd,
722                                                    FGR64Opnd, II_FLOOR>;
723class FLOOR_W_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"floor.w.s", FGR32Opnd,
724                                                    FGR32Opnd, II_FLOOR>;
725class FLOOR_W_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"floor.w.d", FGR32Opnd,
726                                                    AFGR64Opnd, II_FLOOR>;
727class CEIL_L_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"ceil.l.s", FGR64Opnd,
728                                                   FGR32Opnd, II_CEIL>;
729class CEIL_L_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"ceil.l.d", FGR64Opnd,
730                                                   FGR64Opnd, II_CEIL>;
731class CEIL_W_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"ceil.w.s", FGR32Opnd,
732                                                   FGR32Opnd, II_CEIL>;
733class CEIL_W_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"ceil.w.d", FGR32Opnd,
734                                                   AFGR64Opnd, II_CEIL>;
735class TRUNC_L_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"trunc.l.s", FGR64Opnd,
736                                                    FGR32Opnd, II_TRUNC>;
737class TRUNC_L_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"trunc.l.d", FGR64Opnd,
738                                                    FGR64Opnd, II_TRUNC>;
739class TRUNC_W_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"trunc.w.s", FGR32Opnd,
740                                                    FGR32Opnd, II_TRUNC>;
741class TRUNC_W_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"trunc.w.d", FGR32Opnd,
742                                                    AFGR64Opnd, II_TRUNC>;
743class SQRT_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"sqrt.s", FGR32Opnd, FGR32Opnd,
744                                                 II_SQRT_S, fsqrt>;
745class SQRT_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"sqrt.d", AFGR64Opnd, AFGR64Opnd,
746                                                 II_SQRT_D, fsqrt>;
747class RSQRT_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"rsqrt.s", FGR32Opnd,
748                                                  FGR32Opnd, II_TRUNC>;
749class RSQRT_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"rsqrt.d", FGR32Opnd,
750                                                  AFGR64Opnd, II_TRUNC>;
751class RECIP_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"recip.s", FGR32Opnd,
752                                                 FGR32Opnd, II_ROUND>;
753class RECIP_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"recip.d", FGR32Opnd, FGR32Opnd,
754                                                 II_ROUND>;
755class ROUND_L_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"round.l.s", FGR64Opnd,
756                                                   FGR32Opnd, II_ROUND>;
757class ROUND_L_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"round.l.d", FGR64Opnd,
758                                                   FGR64Opnd, II_ROUND>;
759class ROUND_W_S_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"round.w.s", FGR32Opnd,
760                                                   FGR32Opnd, II_ROUND>;
761class ROUND_W_D_MMR6_DESC : ABSS_FT_MMR6_DESC_BASE<"round.w.d", FGR64Opnd,
762                                                   FGR64Opnd, II_ROUND>;
763
764class SEL_S_MMR6_DESC : COP1_SEL_DESC_BASE<"sel.s", FGR32Opnd>;
765class SEL_D_MMR6_DESC : COP1_SEL_DESC_BASE<"sel.d", FGR64Opnd> {
766  // We must insert a SUBREG_TO_REG around $fd_in
767  bit usesCustomInserter = 1;
768}
769
770class SELEQZ_S_MMR6_DESC : SELEQNEZ_DESC_BASE<"seleqz.s", FGR32Opnd>;
771class SELEQZ_D_MMR6_DESC : SELEQNEZ_DESC_BASE<"seleqz.d", FGR64Opnd>;
772class SELENZ_S_MMR6_DESC : SELEQNEZ_DESC_BASE<"selnez.s", FGR32Opnd>;
773class SELENZ_D_MMR6_DESC : SELEQNEZ_DESC_BASE<"selnez.d", FGR64Opnd>;
774class RINT_S_MMR6_DESC : CLASS_RINT_DESC_BASE<"rint.s", FGR32Opnd>;
775class RINT_D_MMR6_DESC : CLASS_RINT_DESC_BASE<"rint.d", FGR64Opnd>;
776class CLASS_S_MMR6_DESC  : CLASS_RINT_DESC_BASE<"class.s", FGR32Opnd>;
777class CLASS_D_MMR6_DESC  : CLASS_RINT_DESC_BASE<"class.d", FGR64Opnd>;
778
779class STORE_MMR6_DESC_BASE<string opstr, DAGOperand RO>
780    : Store<opstr, RO>, MMR6Arch<opstr> {
781  let DecoderMethod = "DecodeMemMMImm16";
782}
783class SB_MMR6_DESC : STORE_MMR6_DESC_BASE<"sb", GPR32Opnd>;
784
785class STORE_EVA_MMR6_DESC_BASE<string instr_asm, RegisterOperand RO>
786    : MMR6Arch<instr_asm>, MipsR6Inst {
787  dag OutOperandList = (outs);
788  dag InOperandList = (ins RO:$rt, mem_mm_9:$addr);
789  string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
790  string DecoderMethod = "DecodeStoreEvaOpMM";
791  bit mayStore = 1;
792}
793class SBE_MMR6_DESC : STORE_EVA_MMR6_DESC_BASE<"sbe", GPR32Opnd>;
794class SCE_MMR6_DESC : STORE_EVA_MMR6_DESC_BASE<"sce", GPR32Opnd>;
795class SH_MMR6_DESC : STORE_MMR6_DESC_BASE<"sh", GPR32Opnd>;
796class SHE_MMR6_DESC : STORE_EVA_MMR6_DESC_BASE<"she", GPR32Opnd>;
797class LOAD_WORD_EVA_MMR6_DESC_BASE<string instr_asm, RegisterOperand RO> :
798            MMR6Arch<instr_asm>, MipsR6Inst {
799  dag OutOperandList = (outs RO:$rt);
800  dag InOperandList = (ins mem_mm_12:$addr);
801  string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
802  string DecoderMethod = "DecodeMemMMImm9";
803  bit mayLoad = 1;
804}
805class LLE_MMR6_DESC : LOAD_WORD_EVA_MMR6_DESC_BASE<"lle", GPR32Opnd>;
806class LWE_MMR6_DESC : LOAD_WORD_EVA_MMR6_DESC_BASE<"lwe", GPR32Opnd>;
807class ADDU16_MMR6_DESC : ArithRMM16<"addu16", GPRMM16Opnd, 1, II_ADDU, add>,
808      MMR6Arch<"addu16">;
809class AND16_MMR6_DESC : LogicRMM16<"and16", GPRMM16Opnd, II_AND, and>,
810      MMR6Arch<"and16">;
811class ANDI16_MMR6_DESC : AndImmMM16<"andi16", GPRMM16Opnd, II_AND>,
812      MMR6Arch<"andi16">;
813class NOT16_MMR6_DESC : NotMM16<"not16", GPRMM16Opnd>, MMR6Arch<"not16">;
814class OR16_MMR6_DESC : LogicRMM16<"or16", GPRMM16Opnd, II_OR, or>,
815      MMR6Arch<"or16">;
816class SLL16_MMR6_DESC : ShiftIMM16<"sll16", uimm3_shift, GPRMM16Opnd, II_SLL>,
817      MMR6Arch<"sll16">;
818class SRL16_MMR6_DESC : ShiftIMM16<"srl16", uimm3_shift, GPRMM16Opnd, II_SRL>,
819      MMR6Arch<"srl16">;
820class BREAK16_MMR6_DESC : BrkSdbbp16MM<"break16">, MMR6Arch<"srl16">,
821      MicroMipsR6Inst16;
822class LI16_MMR6_DESC : LoadImmMM16<"li16", li_simm7, GPRMM16Opnd>,
823      MMR6Arch<"srl16">, MicroMipsR6Inst16, IsAsCheapAsAMove;
824class MOVE16_MMR6_DESC : MoveMM16<"move16", GPR32Opnd>, MMR6Arch<"srl16">,
825      MicroMipsR6Inst16;
826class SDBBP16_MMR6_DESC : BrkSdbbp16MM<"sdbbp16">, MMR6Arch<"sdbbp16">,
827      MicroMipsR6Inst16;
828class SUBU16_MMR6_DESC : ArithRMM16<"subu16", GPRMM16Opnd, 0, II_SUBU, sub>,
829      MMR6Arch<"sdbbp16">, MicroMipsR6Inst16;
830class XOR16_MMR6_DESC : LogicRMM16<"xor16", GPRMM16Opnd, II_XOR, xor>,
831      MMR6Arch<"sdbbp16">, MicroMipsR6Inst16;
832
833class LW_MMR6_DESC : MMR6Arch<"lw">, MipsR6Inst {
834  dag OutOperandList = (outs GPR32Opnd:$rt);
835  dag InOperandList = (ins mem:$addr);
836  string AsmString = "lw\t$rt, $addr";
837  let DecoderMethod = "DecodeMemMMImm16";
838  let canFoldAsLoad = 1;
839  let mayLoad = 1;
840  list<dag> Pattern = [(set GPR32Opnd:$rt, (load addrDefault:$addr))];
841  InstrItinClass Itinerary = II_LW;
842}
843
844class LUI_MMR6_DESC : IsAsCheapAsAMove, MMR6Arch<"lui">, MipsR6Inst{
845  dag OutOperandList = (outs GPR32Opnd:$rt);
846  dag InOperandList = (ins uimm16:$imm16);
847  string AsmString = "lui\t$rt, $imm16";
848  list<dag> Pattern = [];
849  bit hasSideEffects = 0;
850  bit isReMaterializable = 1;
851  InstrItinClass Itinerary = II_LUI;
852  Format Form = FrmI;
853}
854
855class SYNC_MMR6_DESC : MMR6Arch<"sync">, MipsR6Inst {
856  dag OutOperandList = (outs);
857  dag InOperandList = (ins i32imm:$stype);
858  string AsmString = !strconcat("sync", "\t$stype");
859  list<dag> Pattern = [(MipsSync imm:$stype)];
860  InstrItinClass Itinerary = NoItinerary;
861  bit HasSideEffects = 1;
862}
863
864class SYNCI_MMR6_DESC : SYNCI_FT<"synci"> {
865  let DecoderMethod = "DecodeSynciR6";
866}
867
868class RDPGPR_MMR6_DESC : MMR6Arch<"rdpgpr">, MipsR6Inst {
869  dag OutOperandList = (outs GPR32Opnd:$rt);
870  dag InOperandList = (ins GPR32Opnd:$rd);
871  string AsmString = !strconcat("rdpgpr", "\t$rt, $rd");
872}
873
874class SDBBP_MMR6_DESC : MipsR6Inst {
875  dag OutOperandList = (outs);
876  dag InOperandList = (ins uimm20:$code_);
877  string AsmString = !strconcat("sdbbp", "\t$code_");
878  list<dag> Pattern = [];
879}
880
881class LWM16_MMR6_DESC
882    : MicroMipsInst16<(outs reglist16:$rt), (ins mem_mm_4sp:$addr),
883                      !strconcat("lwm16", "\t$rt, $addr"), [],
884                      NoItinerary, FrmI>,
885      MMR6Arch<"lwm16">, MicroMipsR6Inst16 {
886  let DecoderMethod = "DecodeMemMMReglistImm4Lsl2";
887  let mayLoad = 1;
888  InstrItinClass Itin = NoItinerary;
889  ComplexPattern Addr = addr;
890}
891
892class SWM16_MMR6_DESC
893    : MicroMipsInst16<(outs), (ins reglist16:$rt, mem_mm_4sp:$addr),
894                      !strconcat("swm16", "\t$rt, $addr"), [],
895                      NoItinerary, FrmI>,
896      MMR6Arch<"swm16">, MicroMipsR6Inst16 {
897  let DecoderMethod = "DecodeMemMMReglistImm4Lsl2";
898  let mayStore = 1;
899  InstrItinClass Itin = NoItinerary;
900  ComplexPattern Addr = addr;
901}
902
903class SB16_MMR6_DESC_BASE<string opstr, DAGOperand RTOpnd, DAGOperand RO,
904                          SDPatternOperator OpNode, InstrItinClass Itin,
905                          Operand MemOpnd>
906    : MicroMipsInst16<(outs), (ins RTOpnd:$rt, MemOpnd:$addr),
907                      !strconcat(opstr, "\t$rt, $addr"), [], Itin, FrmI>,
908      MMR6Arch<opstr>, MicroMipsR6Inst16 {
909  let DecoderMethod = "DecodeMemMMImm4";
910  let mayStore = 1;
911}
912class SB16_MMR6_DESC : SB16_MMR6_DESC_BASE<"sb16", GPRMM16OpndZero, GPRMM16Opnd,
913                                           truncstorei8, II_SB, mem_mm_4>;
914class SH16_MMR6_DESC : SB16_MMR6_DESC_BASE<"sh16", GPRMM16OpndZero, GPRMM16Opnd,
915                                           truncstorei16, II_SH, mem_mm_4_lsl1>;
916class SW16_MMR6_DESC : SB16_MMR6_DESC_BASE<"sw16", GPRMM16OpndZero, GPRMM16Opnd,
917                                           store, II_SW, mem_mm_4_lsl2>;
918
919class SWSP_MMR6_DESC
920    : MicroMipsInst16<(outs), (ins GPR32Opnd:$rt, mem_mm_sp_imm5_lsl2:$offset),
921                      !strconcat("sw", "\t$rt, $offset"), [], II_SW, FrmI>,
922      MMR6Arch<"sw">, MicroMipsR6Inst16 {
923  let DecoderMethod = "DecodeMemMMSPImm5Lsl2";
924  let mayStore = 1;
925}
926
927//===----------------------------------------------------------------------===//
928//
929// Instruction Definitions
930//
931//===----------------------------------------------------------------------===//
932
933let DecoderNamespace = "MicroMipsR6" in {
934def ADD_MMR6 : StdMMR6Rel, ADD_MMR6_DESC, ADD_MMR6_ENC, ISA_MICROMIPS32R6;
935def ADDIU_MMR6 : StdMMR6Rel, ADDIU_MMR6_DESC, ADDIU_MMR6_ENC, ISA_MICROMIPS32R6;
936def ADDU_MMR6 : StdMMR6Rel, ADDU_MMR6_DESC, ADDU_MMR6_ENC, ISA_MICROMIPS32R6;
937def ADDIUPC_MMR6 : R6MMR6Rel, ADDIUPC_MMR6_ENC, ADDIUPC_MMR6_DESC,
938                   ISA_MICROMIPS32R6;
939def ALUIPC_MMR6 : R6MMR6Rel, ALUIPC_MMR6_ENC, ALUIPC_MMR6_DESC,
940                  ISA_MICROMIPS32R6;
941def AND_MMR6 : StdMMR6Rel, AND_MMR6_DESC, AND_MMR6_ENC, ISA_MICROMIPS32R6;
942def ANDI_MMR6 : StdMMR6Rel, ANDI_MMR6_DESC, ANDI_MMR6_ENC, ISA_MICROMIPS32R6;
943def AUIPC_MMR6 : R6MMR6Rel, AUIPC_MMR6_ENC, AUIPC_MMR6_DESC, ISA_MICROMIPS32R6;
944def ALIGN_MMR6 : R6MMR6Rel, ALIGN_MMR6_ENC, ALIGN_MMR6_DESC, ISA_MICROMIPS32R6;
945def AUI_MMR6 : R6MMR6Rel, AUI_MMR6_ENC, AUI_MMR6_DESC, ISA_MICROMIPS32R6;
946def BALC_MMR6 : R6MMR6Rel, BALC_MMR6_ENC, BALC_MMR6_DESC, ISA_MICROMIPS32R6;
947def BC_MMR6 : R6MMR6Rel, BC_MMR6_ENC, BC_MMR6_DESC, ISA_MICROMIPS32R6;
948def BC16_MMR6 : StdMMR6Rel, BC16_MMR6_DESC, BC16_MMR6_ENC, ISA_MICROMIPS32R6;
949def BEQZC16_MMR6 : StdMMR6Rel, BEQZC16_MMR6_DESC, BEQZC16_MMR6_ENC,
950                   ISA_MICROMIPS32R6;
951def BNEZC16_MMR6 : StdMMR6Rel, BNEZC16_MMR6_DESC, BNEZC16_MMR6_ENC,
952                   ISA_MICROMIPS32R6;
953def BITSWAP_MMR6 : R6MMR6Rel, BITSWAP_MMR6_ENC, BITSWAP_MMR6_DESC,
954                   ISA_MICROMIPS32R6;
955def BEQZALC_MMR6 : R6MMR6Rel, BEQZALC_MMR6_ENC, BEQZALC_MMR6_DESC,
956                   ISA_MICROMIPS32R6;
957def BGEZALC_MMR6 : R6MMR6Rel, BGEZALC_MMR6_ENC, BGEZALC_MMR6_DESC,
958                   ISA_MICROMIPS32R6;
959def BGTZALC_MMR6 : R6MMR6Rel, BGTZALC_MMR6_ENC, BGTZALC_MMR6_DESC,
960                   ISA_MICROMIPS32R6;
961def BLEZALC_MMR6 : R6MMR6Rel, BLEZALC_MMR6_ENC, BLEZALC_MMR6_DESC,
962                   ISA_MICROMIPS32R6;
963def BLTZALC_MMR6 : R6MMR6Rel, BLTZALC_MMR6_ENC, BLTZALC_MMR6_DESC,
964                   ISA_MICROMIPS32R6;
965def BNEZALC_MMR6 : R6MMR6Rel, BNEZALC_MMR6_ENC, BNEZALC_MMR6_DESC,
966                   ISA_MICROMIPS32R6;
967def BREAK_MMR6 : StdMMR6Rel, BRK_MMR6_DESC, BRK_MMR6_ENC, ISA_MICROMIPS32R6;
968def CACHE_MMR6 : R6MMR6Rel, CACHE_MMR6_ENC, CACHE_MMR6_DESC, ISA_MICROMIPS32R6;
969def CLO_MMR6 : R6MMR6Rel, CLO_MMR6_ENC, CLO_MMR6_DESC, ISA_MICROMIPS32R6;
970def CLZ_MMR6 : R6MMR6Rel, CLZ_MMR6_ENC, CLZ_MMR6_DESC, ISA_MICROMIPS32R6;
971def DIV_MMR6 : R6MMR6Rel, DIV_MMR6_DESC, DIV_MMR6_ENC, ISA_MICROMIPS32R6;
972def DIVU_MMR6 : R6MMR6Rel, DIVU_MMR6_DESC, DIVU_MMR6_ENC, ISA_MICROMIPS32R6;
973def EHB_MMR6 : StdMMR6Rel, EHB_MMR6_DESC, EHB_MMR6_ENC, ISA_MICROMIPS32R6;
974def EI_MMR6 : StdMMR6Rel, EI_MMR6_DESC, EI_MMR6_ENC, ISA_MICROMIPS32R6;
975def DI_MMR6 : StdMMR6Rel, DI_MMR6_DESC, DI_MMR6_ENC, ISA_MICROMIPS32R6;
976def ERET_MMR6 : StdMMR6Rel, ERET_MMR6_DESC, ERET_MMR6_ENC, ISA_MICROMIPS32R6;
977def DERET_MMR6 : StdMMR6Rel, DERET_MMR6_DESC, DERET_MMR6_ENC, ISA_MICROMIPS32R6;
978def ERETNC_MMR6 : R6MMR6Rel, ERETNC_MMR6_DESC, ERETNC_MMR6_ENC,
979                  ISA_MICROMIPS32R6;
980def JALRC16_MMR6 : R6MMR6Rel, JALRC16_MMR6_DESC, JALRC16_MMR6_ENC,
981                   ISA_MICROMIPS32R6;
982def JIALC_MMR6 : R6MMR6Rel, JIALC_MMR6_ENC, JIALC_MMR6_DESC, ISA_MICROMIPS32R6;
983def JIC_MMR6 : R6MMR6Rel, JIC_MMR6_ENC, JIC_MMR6_DESC, ISA_MICROMIPS32R6;
984def JRC16_MMR6 : R6MMR6Rel, JRC16_MMR6_DESC, JRC16_MMR6_ENC, ISA_MICROMIPS32R6;
985def JRCADDIUSP_MMR6 : R6MMR6Rel, JRCADDIUSP_MMR6_DESC, JRCADDIUSP_MMR6_ENC,
986                      ISA_MICROMIPS32R6;
987def LSA_MMR6 : R6MMR6Rel, LSA_MMR6_ENC, LSA_MMR6_DESC, ISA_MICROMIPS32R6;
988def LWPC_MMR6 : R6MMR6Rel, LWPC_MMR6_ENC, LWPC_MMR6_DESC, ISA_MICROMIPS32R6;
989def LWM16_MMR6 : StdMMR6Rel, LWM16_MMR6_DESC, LWM16_MMR6_ENC, ISA_MICROMIPS32R6;
990def MOD_MMR6 : R6MMR6Rel, MOD_MMR6_DESC, MOD_MMR6_ENC, ISA_MICROMIPS32R6;
991def MODU_MMR6 : R6MMR6Rel, MODU_MMR6_DESC, MODU_MMR6_ENC, ISA_MICROMIPS32R6;
992def MUL_MMR6 : R6MMR6Rel, MUL_MMR6_DESC, MUL_MMR6_ENC, ISA_MICROMIPS32R6;
993def MUH_MMR6 : R6MMR6Rel, MUH_MMR6_DESC, MUH_MMR6_ENC, ISA_MICROMIPS32R6;
994def MULU_MMR6 : R6MMR6Rel, MULU_MMR6_DESC, MULU_MMR6_ENC, ISA_MICROMIPS32R6;
995def MUHU_MMR6 : R6MMR6Rel, MUHU_MMR6_DESC, MUHU_MMR6_ENC, ISA_MICROMIPS32R6;
996def NOR_MMR6 : StdMMR6Rel, NOR_MMR6_DESC, NOR_MMR6_ENC, ISA_MICROMIPS32R6;
997def OR_MMR6 : StdMMR6Rel, OR_MMR6_DESC, OR_MMR6_ENC, ISA_MICROMIPS32R6;
998def ORI_MMR6 : StdMMR6Rel, ORI_MMR6_DESC, ORI_MMR6_ENC, ISA_MICROMIPS32R6;
999def PREF_MMR6 : R6MMR6Rel, PREF_MMR6_ENC, PREF_MMR6_DESC, ISA_MICROMIPS32R6;
1000def SB16_MMR6 : StdMMR6Rel, SB16_MMR6_DESC, SB16_MMR6_ENC, ISA_MICROMIPS32R6;
1001def SEB_MMR6 : StdMMR6Rel, SEB_MMR6_DESC, SEB_MMR6_ENC, ISA_MICROMIPS32R6;
1002def SEH_MMR6 : StdMMR6Rel, SEH_MMR6_DESC, SEH_MMR6_ENC, ISA_MICROMIPS32R6;
1003def SELEQZ_MMR6 : R6MMR6Rel, SELEQZ_MMR6_ENC, SELEQZ_MMR6_DESC,
1004                  ISA_MICROMIPS32R6;
1005def SELNEZ_MMR6 : R6MMR6Rel, SELNEZ_MMR6_ENC, SELNEZ_MMR6_DESC,
1006                  ISA_MICROMIPS32R6;
1007def SH16_MMR6 : StdMMR6Rel, SH16_MMR6_DESC, SH16_MMR6_ENC, ISA_MICROMIPS32R6;
1008def SLL_MMR6 : StdMMR6Rel, SLL_MMR6_DESC, SLL_MMR6_ENC, ISA_MICROMIPS32R6;
1009def SUB_MMR6 : StdMMR6Rel, SUB_MMR6_DESC, SUB_MMR6_ENC, ISA_MICROMIPS32R6;
1010def SUBU_MMR6 : StdMMR6Rel, SUBU_MMR6_DESC, SUBU_MMR6_ENC, ISA_MICROMIPS32R6;
1011def SW16_MMR6 : StdMMR6Rel, SW16_MMR6_DESC, SW16_MMR6_ENC, ISA_MICROMIPS32R6;
1012def SWM16_MMR6 : StdMMR6Rel, SWM16_MMR6_DESC, SWM16_MMR6_ENC, ISA_MICROMIPS32R6;
1013def SWSP_MMR6 : StdMMR6Rel, SWSP_MMR6_DESC, SWSP_MMR6_ENC, ISA_MICROMIPS32R6;
1014def PREFE_MMR6 : StdMMR6Rel, PREFE_MMR6_ENC, PREFE_MMR6_DESC, ISA_MICROMIPS32R6;
1015def CACHEE_MMR6 : StdMMR6Rel, CACHEE_MMR6_ENC, CACHEE_MMR6_DESC,
1016                  ISA_MICROMIPS32R6;
1017def WRPGPR_MMR6 : StdMMR6Rel, WRPGPR_MMR6_ENC, WRPGPR_MMR6_DESC,
1018                  ISA_MICROMIPS32R6;
1019def WSBH_MMR6 : StdMMR6Rel, WSBH_MMR6_ENC, WSBH_MMR6_DESC, ISA_MICROMIPS32R6;
1020def LB_MMR6 : R6MMR6Rel, LB_MMR6_ENC, LB_MMR6_DESC, ISA_MICROMIPS32R6;
1021def LBU_MMR6 : R6MMR6Rel, LBU_MMR6_ENC, LBU_MMR6_DESC, ISA_MICROMIPS32R6;
1022def LBE_MMR6 : R6MMR6Rel, LBE_MMR6_ENC, LBE_MMR6_DESC, ISA_MICROMIPS32R6;
1023def LBUE_MMR6 : R6MMR6Rel, LBUE_MMR6_ENC, LBUE_MMR6_DESC, ISA_MICROMIPS32R6;
1024def PAUSE_MMR6 : StdMMR6Rel, PAUSE_MMR6_DESC, PAUSE_MMR6_ENC, ISA_MICROMIPS32R6;
1025def RDHWR_MMR6 : R6MMR6Rel, RDHWR_MMR6_DESC, RDHWR_MMR6_ENC, ISA_MICROMIPS32R6;
1026def WAIT_MMR6 : StdMMR6Rel, WAIT_MMR6_DESC, WAIT_MMR6_ENC, ISA_MICROMIPS32R6;
1027def SSNOP_MMR6 : StdMMR6Rel, SSNOP_MMR6_DESC, SSNOP_MMR6_ENC, ISA_MICROMIPS32R6;
1028def SYNC_MMR6 : StdMMR6Rel, SYNC_MMR6_DESC, SYNC_MMR6_ENC, ISA_MICROMIPS32R6;
1029def SYNCI_MMR6 : StdMMR6Rel, SYNCI_MMR6_DESC, SYNCI_MMR6_ENC, ISA_MICROMIPS32R6;
1030def RDPGPR_MMR6 : R6MMR6Rel, RDPGPR_MMR6_DESC, RDPGPR_MMR6_ENC,
1031                  ISA_MICROMIPS32R6;
1032def SDBBP_MMR6 : R6MMR6Rel, SDBBP_MMR6_DESC, SDBBP_MMR6_ENC, ISA_MICROMIPS32R6;
1033def XOR_MMR6 : StdMMR6Rel, XOR_MMR6_DESC, XOR_MMR6_ENC, ISA_MICROMIPS32R6;
1034def XORI_MMR6 : StdMMR6Rel, XORI_MMR6_DESC, XORI_MMR6_ENC, ISA_MICROMIPS32R6;
1035let DecoderMethod = "DecodeMemMMImm16" in {
1036  def SW_MMR6 : StdMMR6Rel, SW_MMR6_DESC, SW_MMR6_ENC, ISA_MICROMIPS32R6;
1037}
1038let DecoderMethod = "DecodeMemMMImm9" in {
1039  def SWE_MMR6 : StdMMR6Rel, SWE_MMR6_DESC, SWE_MMR6_ENC, ISA_MICROMIPS32R6;
1040}
1041/// Floating Point Instructions
1042def FADD_S_MMR6 : StdMMR6Rel, FADD_S_MMR6_ENC, FADD_S_MMR6_DESC,
1043                  ISA_MICROMIPS32R6;
1044def FADD_D_MMR6 : StdMMR6Rel, FADD_D_MMR6_ENC, FADD_D_MMR6_DESC,
1045                  ISA_MICROMIPS32R6;
1046def FSUB_S_MMR6 : StdMMR6Rel, FSUB_S_MMR6_ENC, FSUB_S_MMR6_DESC,
1047                  ISA_MICROMIPS32R6;
1048def FSUB_D_MMR6 : StdMMR6Rel, FSUB_D_MMR6_ENC, FSUB_D_MMR6_DESC,
1049                  ISA_MICROMIPS32R6;
1050def FMUL_S_MMR6 : StdMMR6Rel, FMUL_S_MMR6_ENC, FMUL_S_MMR6_DESC,
1051                  ISA_MICROMIPS32R6;
1052def FMUL_D_MMR6 : StdMMR6Rel, FMUL_D_MMR6_ENC, FMUL_D_MMR6_DESC,
1053                  ISA_MICROMIPS32R6;
1054def FDIV_S_MMR6 : StdMMR6Rel, FDIV_S_MMR6_ENC, FDIV_S_MMR6_DESC,
1055                  ISA_MICROMIPS32R6;
1056def FDIV_D_MMR6 : StdMMR6Rel, FDIV_D_MMR6_ENC, FDIV_D_MMR6_DESC,
1057                  ISA_MICROMIPS32R6;
1058def MADDF_S_MMR6 : R6MMR6Rel, MADDF_S_MMR6_ENC, MADDF_S_MMR6_DESC,
1059                   ISA_MICROMIPS32R6;
1060def MADDF_D_MMR6 : R6MMR6Rel, MADDF_D_MMR6_ENC, MADDF_D_MMR6_DESC,
1061                   ISA_MICROMIPS32R6;
1062def MSUBF_S_MMR6 : R6MMR6Rel, MSUBF_S_MMR6_ENC, MSUBF_S_MMR6_DESC,
1063                   ISA_MICROMIPS32R6;
1064def MSUBF_D_MMR6 : R6MMR6Rel, MSUBF_D_MMR6_ENC, MSUBF_D_MMR6_DESC,
1065                   ISA_MICROMIPS32R6;
1066def FMOV_S_MMR6 : StdMMR6Rel, FMOV_S_MMR6_ENC, FMOV_S_MMR6_DESC,
1067                  ISA_MICROMIPS32R6;
1068def FMOV_D_MMR6 : StdMMR6Rel, FMOV_D_MMR6_ENC, FMOV_D_MMR6_DESC,
1069                  ISA_MICROMIPS32R6;
1070def FNEG_S_MMR6 : StdMMR6Rel, FNEG_S_MMR6_ENC, FNEG_S_MMR6_DESC,
1071                  ISA_MICROMIPS32R6;
1072def FNEG_D_MMR6 : StdMMR6Rel, FNEG_D_MMR6_ENC, FNEG_D_MMR6_DESC,
1073                  ISA_MICROMIPS32R6;
1074def MAX_S_MMR6 : R6MMR6Rel, MAX_S_MMR6_ENC, MAX_S_MMR6_DESC, ISA_MICROMIPS32R6;
1075def MAX_D_MMR6 : R6MMR6Rel, MAX_D_MMR6_ENC, MAX_D_MMR6_DESC, ISA_MICROMIPS32R6;
1076def MIN_S_MMR6 : R6MMR6Rel, MIN_S_MMR6_ENC, MIN_S_MMR6_DESC, ISA_MICROMIPS32R6;
1077def MIN_D_MMR6 : R6MMR6Rel, MIN_D_MMR6_ENC, MIN_D_MMR6_DESC, ISA_MICROMIPS32R6;
1078def MAXA_S_MMR6 : R6MMR6Rel, MAXA_S_MMR6_ENC, MAXA_S_MMR6_DESC,
1079                  ISA_MICROMIPS32R6;
1080def MAXA_D_MMR6 : R6MMR6Rel, MAXA_D_MMR6_ENC, MAXA_D_MMR6_DESC,
1081                  ISA_MICROMIPS32R6;
1082def MINA_S_MMR6 : R6MMR6Rel, MINA_S_MMR6_ENC, MINA_S_MMR6_DESC,
1083                  ISA_MICROMIPS32R6;
1084def MINA_D_MMR6 : R6MMR6Rel, MINA_D_MMR6_ENC, MINA_D_MMR6_DESC,
1085                  ISA_MICROMIPS32R6;
1086def CVT_L_S_MMR6 : StdMMR6Rel, CVT_L_S_MMR6_ENC, CVT_L_S_MMR6_DESC,
1087                   ISA_MICROMIPS32R6;
1088def CVT_L_D_MMR6 : StdMMR6Rel, CVT_L_D_MMR6_ENC, CVT_L_D_MMR6_DESC,
1089                   ISA_MICROMIPS32R6;
1090def CVT_W_S_MMR6 : StdMMR6Rel, CVT_W_S_MMR6_ENC, CVT_W_S_MMR6_DESC,
1091                   ISA_MICROMIPS32R6;
1092def CVT_W_D_MMR6 : StdMMR6Rel, CVT_W_D_MMR6_ENC, CVT_W_D_MMR6_DESC,
1093                   ISA_MICROMIPS32R6;
1094def CVT_D_S_MMR6 : StdMMR6Rel, CVT_D_S_MMR6_ENC, CVT_D_S_MMR6_DESC,
1095                   ISA_MICROMIPS32R6;
1096def CVT_D_W_MMR6 : StdMMR6Rel, CVT_D_W_MMR6_ENC, CVT_D_W_MMR6_DESC,
1097                   ISA_MICROMIPS32R6;
1098def CVT_D_L_MMR6 : StdMMR6Rel, CVT_D_L_MMR6_ENC, CVT_D_L_MMR6_DESC,
1099                   ISA_MICROMIPS32R6;
1100def CVT_S_D_MMR6 : StdMMR6Rel, CVT_S_D_MMR6_ENC, CVT_S_D_MMR6_DESC,
1101                   ISA_MICROMIPS32R6;
1102def CVT_S_W_MMR6 : StdMMR6Rel, CVT_S_W_MMR6_ENC, CVT_S_W_MMR6_DESC,
1103                   ISA_MICROMIPS32R6;
1104def CVT_S_L_MMR6 : StdMMR6Rel, CVT_S_L_MMR6_ENC, CVT_S_L_MMR6_DESC,
1105                   ISA_MICROMIPS32R6;
1106defm S_MMR6 : CMP_CC_MMR6<0b000101, "s", FGR32Opnd>;
1107defm D_MMR6 : CMP_CC_MMR6<0b010101, "d", FGR64Opnd>;
1108def ABS_S_MMR6 : StdMMR6Rel, ABS_S_MMR6_ENC, ABS_S_MMR6_DESC, ISA_MICROMIPS32R6;
1109def ABS_D_MMR6 : StdMMR6Rel, ABS_D_MMR6_ENC, ABS_D_MMR6_DESC, ISA_MICROMIPS32R6;
1110def FLOOR_L_S_MMR6 : StdMMR6Rel, FLOOR_L_S_MMR6_ENC, FLOOR_L_S_MMR6_DESC,
1111                     ISA_MICROMIPS32R6;
1112def FLOOR_L_D_MMR6 : StdMMR6Rel, FLOOR_L_D_MMR6_ENC, FLOOR_L_D_MMR6_DESC,
1113                     ISA_MICROMIPS32R6;
1114def FLOOR_W_S_MMR6 : StdMMR6Rel, FLOOR_W_S_MMR6_ENC, FLOOR_W_S_MMR6_DESC,
1115                     ISA_MICROMIPS32R6;
1116def FLOOR_W_D_MMR6 : StdMMR6Rel, FLOOR_W_D_MMR6_ENC, FLOOR_W_D_MMR6_DESC,
1117                     ISA_MICROMIPS32R6;
1118def CEIL_L_S_MMR6 : StdMMR6Rel, CEIL_L_S_MMR6_ENC, CEIL_L_S_MMR6_DESC,
1119                    ISA_MICROMIPS32R6;
1120def CEIL_L_D_MMR6 : StdMMR6Rel, CEIL_L_D_MMR6_ENC, CEIL_L_D_MMR6_DESC,
1121                    ISA_MICROMIPS32R6;
1122def CEIL_W_S_MMR6 : StdMMR6Rel, CEIL_W_S_MMR6_ENC, CEIL_W_S_MMR6_DESC,
1123                    ISA_MICROMIPS32R6;
1124def CEIL_W_D_MMR6 : StdMMR6Rel, CEIL_W_D_MMR6_ENC, CEIL_W_D_MMR6_DESC,
1125                    ISA_MICROMIPS32R6;
1126def TRUNC_L_S_MMR6 : StdMMR6Rel, TRUNC_L_S_MMR6_ENC, TRUNC_L_S_MMR6_DESC,
1127                     ISA_MICROMIPS32R6;
1128def TRUNC_L_D_MMR6 : StdMMR6Rel, TRUNC_L_D_MMR6_ENC, TRUNC_L_D_MMR6_DESC,
1129                     ISA_MICROMIPS32R6;
1130def TRUNC_W_S_MMR6 : StdMMR6Rel, TRUNC_W_S_MMR6_ENC, TRUNC_W_S_MMR6_DESC,
1131                     ISA_MICROMIPS32R6;
1132def TRUNC_W_D_MMR6 : StdMMR6Rel, TRUNC_W_D_MMR6_ENC, TRUNC_W_D_MMR6_DESC,
1133                     ISA_MICROMIPS32R6;
1134def SQRT_S_MMR6 : StdMMR6Rel, SQRT_S_MMR6_ENC, SQRT_S_MMR6_DESC,
1135                  ISA_MICROMIPS32R6;
1136def SQRT_D_MMR6 : StdMMR6Rel, SQRT_D_MMR6_ENC, SQRT_D_MMR6_DESC,
1137                  ISA_MICROMIPS32R6;
1138def RSQRT_S_MMR6 : StdMMR6Rel, RSQRT_S_MMR6_ENC, RSQRT_S_MMR6_DESC,
1139                   ISA_MICROMIPS32R6;
1140def RSQRT_D_MMR6 : StdMMR6Rel, RSQRT_D_MMR6_ENC, RSQRT_D_MMR6_DESC,
1141                   ISA_MICROMIPS32R6;
1142def SB_MMR6 : StdMMR6Rel, SB_MMR6_DESC, SB_MMR6_ENC, ISA_MICROMIPS32R6;
1143def SBE_MMR6 : StdMMR6Rel, SBE_MMR6_DESC, SBE_MMR6_ENC, ISA_MICROMIPS32R6;
1144def SCE_MMR6 : StdMMR6Rel, SCE_MMR6_DESC, SCE_MMR6_ENC, ISA_MICROMIPS32R6;
1145def SH_MMR6 : StdMMR6Rel, SH_MMR6_DESC, SH_MMR6_ENC, ISA_MICROMIPS32R6;
1146def SHE_MMR6 : StdMMR6Rel, SHE_MMR6_DESC, SHE_MMR6_ENC, ISA_MICROMIPS32R6;
1147def LLE_MMR6 : StdMMR6Rel, LLE_MMR6_DESC, LLE_MMR6_ENC, ISA_MICROMIPS32R6;
1148def LWE_MMR6 : StdMMR6Rel, LWE_MMR6_DESC, LWE_MMR6_ENC, ISA_MICROMIPS32R6;
1149def LW_MMR6 : StdMMR6Rel, LW_MMR6_DESC, LW_MMR6_ENC, ISA_MICROMIPS32R6;
1150def LUI_MMR6 : R6MMR6Rel, LUI_MMR6_DESC, LUI_MMR6_ENC, ISA_MICROMIPS32R6;
1151def ADDU16_MMR6 : StdMMR6Rel, ADDU16_MMR6_DESC, ADDU16_MMR6_ENC,
1152                  ISA_MICROMIPS32R6;
1153def AND16_MMR6 : StdMMR6Rel, AND16_MMR6_DESC, AND16_MMR6_ENC,
1154                  ISA_MICROMIPS32R6;
1155def ANDI16_MMR6 : StdMMR6Rel, ANDI16_MMR6_DESC, ANDI16_MMR6_ENC,
1156                  ISA_MICROMIPS32R6;
1157def NOT16_MMR6 : StdMMR6Rel, NOT16_MMR6_DESC, NOT16_MMR6_ENC,
1158                  ISA_MICROMIPS32R6;
1159def OR16_MMR6 : StdMMR6Rel, OR16_MMR6_DESC, OR16_MMR6_ENC,
1160                  ISA_MICROMIPS32R6;
1161def SLL16_MMR6 : StdMMR6Rel, SLL16_MMR6_DESC, SLL16_MMR6_ENC,
1162                  ISA_MICROMIPS32R6;
1163def SRL16_MMR6 : StdMMR6Rel, SRL16_MMR6_DESC, SRL16_MMR6_ENC,
1164                  ISA_MICROMIPS32R6;
1165def BREAK16_MMR6 : StdMMR6Rel, BREAK16_MMR6_DESC, BREAK16_MMR6_ENC,
1166                   ISA_MICROMIPS32R6;
1167def LI16_MMR6 : StdMMR6Rel, LI16_MMR6_DESC, LI16_MMR6_ENC,
1168                ISA_MICROMIPS32R6;
1169def MOVE16_MMR6 : StdMMR6Rel, MOVE16_MMR6_DESC, MOVE16_MMR6_ENC,
1170                  ISA_MICROMIPS32R6;
1171def SDBBP16_MMR6 : StdMMR6Rel, SDBBP16_MMR6_DESC, SDBBP16_MMR6_ENC,
1172                   ISA_MICROMIPS32R6;
1173def SUBU16_MMR6 : StdMMR6Rel, SUBU16_MMR6_DESC, SUBU16_MMR6_ENC,
1174                  ISA_MICROMIPS32R6;
1175def XOR16_MMR6 : StdMMR6Rel, XOR16_MMR6_DESC, XOR16_MMR6_ENC,
1176                 ISA_MICROMIPS32R6;
1177def RECIP_S_MMR6 : StdMMR6Rel, RECIP_S_MMR6_ENC, RECIP_S_MMR6_DESC,
1178                   ISA_MICROMIPS32R6;
1179def RECIP_D_MMR6 : StdMMR6Rel, RECIP_D_MMR6_ENC, RECIP_D_MMR6_DESC, ISA_MICROMIPS32R6;
1180def RINT_S_MMR6 : StdMMR6Rel, RINT_S_MMR6_ENC, RINT_S_MMR6_DESC,
1181                  ISA_MICROMIPS32R6;
1182def RINT_D_MMR6 : StdMMR6Rel, RINT_D_MMR6_ENC, RINT_D_MMR6_DESC, ISA_MICROMIPS32R6;
1183def ROUND_L_S_MMR6 : StdMMR6Rel, ROUND_L_S_MMR6_ENC, ROUND_L_S_MMR6_DESC,
1184                     ISA_MICROMIPS32R6;
1185def ROUND_L_D_MMR6 : StdMMR6Rel, ROUND_L_D_MMR6_ENC, ROUND_L_D_MMR6_DESC,
1186                     ISA_MICROMIPS32R6;
1187def ROUND_W_S_MMR6 : StdMMR6Rel, ROUND_W_S_MMR6_ENC, ROUND_W_S_MMR6_DESC,
1188                     ISA_MICROMIPS32R6;
1189def ROUND_W_D_MMR6 : StdMMR6Rel, ROUND_W_D_MMR6_ENC, ROUND_W_D_MMR6_DESC,
1190                     ISA_MICROMIPS32R6;
1191def SEL_S_MMR6 : StdMMR6Rel, SEL_S_MMR6_ENC, SEL_S_MMR6_DESC, ISA_MICROMIPS32R6;
1192def SEL_D_MMR6 : StdMMR6Rel, SEL_D_MMR6_ENC, SEL_D_MMR6_DESC, ISA_MICROMIPS32R6;
1193def SELEQZ_S_MMR6 : StdMMR6Rel, SELEQZ_S_MMR6_ENC, SELEQZ_S_MMR6_DESC,
1194                    ISA_MICROMIPS32R6;
1195def SELEQZ_D_MMR6 : StdMMR6Rel, SELEQZ_D_MMR6_ENC, SELEQZ_D_MMR6_DESC,
1196                    ISA_MICROMIPS32R6;
1197def SELENZ_S_MMR6 : StdMMR6Rel, SELENZ_S_MMR6_ENC, SELENZ_S_MMR6_DESC,
1198                    ISA_MICROMIPS32R6;
1199def SELENZ_D_MMR6 : StdMMR6Rel, SELENZ_D_MMR6_ENC, SELENZ_D_MMR6_DESC,
1200                    ISA_MICROMIPS32R6;
1201def CLASS_S_MMR6 : StdMMR6Rel, CLASS_S_MMR6_ENC, CLASS_S_MMR6_DESC,
1202                   ISA_MICROMIPS32R6;
1203def CLASS_D_MMR6 : StdMMR6Rel, CLASS_D_MMR6_ENC, CLASS_D_MMR6_DESC,
1204                   ISA_MICROMIPS32R6;
1205}
1206
1207//===----------------------------------------------------------------------===//
1208//
1209// MicroMips instruction aliases
1210//
1211//===----------------------------------------------------------------------===//
1212
1213def : MipsInstAlias<"ei", (EI_MMR6 ZERO), 1>, ISA_MICROMIPS32R6;
1214def : MipsInstAlias<"di", (DI_MMR6 ZERO), 1>, ISA_MICROMIPS32R6;
1215def : MipsInstAlias<"nop", (SLL_MMR6 ZERO, ZERO, 0), 1>, ISA_MICROMIPS32R6;
1216def B_MMR6_Pseudo : MipsAsmPseudoInst<(outs), (ins brtarget_mm:$offset),
1217                                      !strconcat("b", "\t$offset")> {
1218  string DecoderNamespace = "MicroMipsR6";
1219}
1220def : MipsInstAlias<"sync", (SYNC_MMR6 0), 1>, ISA_MICROMIPS32R6;
1221def : MipsInstAlias<"sdbbp", (SDBBP_MMR6 0), 1>, ISA_MICROMIPS32R6;
1222def : MipsInstAlias<"rdhwr $rt, $rs",
1223                    (RDHWR_MMR6 GPR32Opnd:$rt, HWRegsOpnd:$rs, 0), 1>,
1224                    ISA_MICROMIPS32R6;
1225
1226//===----------------------------------------------------------------------===//
1227//
1228// MicroMips arbitrary patterns that map to one or more instructions
1229//
1230//===----------------------------------------------------------------------===//
1231
1232def : MipsPat<(store GPRMM16:$src, addrimm4lsl2:$addr),
1233              (SW16_MMR6 GPRMM16:$src, addrimm4lsl2:$addr)>, ISA_MICROMIPS32R6;
1234