1 //=- Mips32r6InstrInfo.td - Mips32r6 Instruction Information -*- tablegen -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file describes Mips32r6 instructions.
12 //===----------------------------------------------------------------------===//
14 include "Mips32r6InstrFormats.td"
16 // Notes about removals/changes from MIPS32r6:
17 // Reencoded: jr -> jalr
18 // Reencoded: jr.hb -> jalr.hb
21 def brtarget21 : Operand<OtherVT> {
22 let EncoderMethod = "getBranchTarget21OpValue";
23 let OperandType = "OPERAND_PCREL";
24 let DecoderMethod = "DecodeBranchTarget21";
25 let ParserMatchClass = MipsJumpTargetAsmOperand;
28 def brtarget26 : Operand<OtherVT> {
29 let EncoderMethod = "getBranchTarget26OpValue";
30 let OperandType = "OPERAND_PCREL";
31 let DecoderMethod = "DecodeBranchTarget26";
32 let ParserMatchClass = MipsJumpTargetAsmOperand;
35 def jmpoffset16 : Operand<OtherVT> {
36 let EncoderMethod = "getJumpOffset16OpValue";
37 let ParserMatchClass = MipsJumpTargetAsmOperand;
40 def calloffset16 : Operand<iPTR> {
41 let EncoderMethod = "getJumpOffset16OpValue";
42 let ParserMatchClass = MipsJumpTargetAsmOperand;
45 //===----------------------------------------------------------------------===//
47 // Instruction Encodings
49 //===----------------------------------------------------------------------===//
51 class ADDIUPC_ENC : PCREL19_FM<OPCODE2_ADDIUPC>;
52 class ALIGN_ENC : SPECIAL3_ALIGN_FM<OPCODE6_ALIGN>;
53 class ALUIPC_ENC : PCREL16_FM<OPCODE5_ALUIPC>;
54 class AUI_ENC : AUI_FM;
55 class AUIPC_ENC : PCREL16_FM<OPCODE5_AUIPC>;
57 class BAL_ENC : BAL_FM;
58 class BALC_ENC : BRANCH_OFF26_FM<0b111010>;
59 class BC_ENC : BRANCH_OFF26_FM<0b110010>;
60 class BEQC_ENC : CMP_BRANCH_2R_OFF16_FM<OPGROUP_ADDI>,
61 DecodeDisambiguates<"AddiGroupBranch">;
62 class BEQZALC_ENC : CMP_BRANCH_1R_RT_OFF16_FM<OPGROUP_ADDI>,
63 DecodeDisambiguatedBy<"DaddiGroupBranch">;
64 class BNEC_ENC : CMP_BRANCH_2R_OFF16_FM<OPGROUP_DADDI>,
65 DecodeDisambiguates<"DaddiGroupBranch">;
66 class BNEZALC_ENC : CMP_BRANCH_1R_RT_OFF16_FM<OPGROUP_DADDI>,
67 DecodeDisambiguatedBy<"DaddiGroupBranch">;
69 class BLTZC_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM<OPGROUP_BGTZL>,
70 DecodeDisambiguates<"BgtzlGroupBranch">;
71 class BGEC_ENC : CMP_BRANCH_2R_OFF16_FM<OPGROUP_BLEZL>,
72 DecodeDisambiguatedBy<"BlezlGroupBranch">;
73 class BGEUC_ENC : CMP_BRANCH_2R_OFF16_FM<OPGROUP_BLEZ>,
74 DecodeDisambiguatedBy<"BlezGroupBranch">;
75 class BGEZC_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM<OPGROUP_BLEZL>,
76 DecodeDisambiguates<"BlezlGroupBranch">;
77 class BGTZALC_ENC : CMP_BRANCH_1R_RT_OFF16_FM<OPGROUP_BGTZ>,
78 DecodeDisambiguatedBy<"BgtzGroupBranch">;
80 class BLEZC_ENC : CMP_BRANCH_1R_RT_OFF16_FM<OPGROUP_BLEZL>,
81 DecodeDisambiguatedBy<"BlezlGroupBranch">;
82 class BLTZALC_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM<OPGROUP_BGTZ>,
83 DecodeDisambiguates<"BgtzGroupBranch">;
84 class BGTZC_ENC : CMP_BRANCH_1R_RT_OFF16_FM<OPGROUP_BGTZL>,
85 DecodeDisambiguatedBy<"BgtzlGroupBranch">;
87 class BEQZC_ENC : CMP_BRANCH_OFF21_FM<0b110110>;
88 class BGEZALC_ENC : CMP_BRANCH_1R_BOTH_OFF16_FM<OPGROUP_BLEZ>,
89 DecodeDisambiguates<"BlezGroupBranch">;
90 class BNEZC_ENC : CMP_BRANCH_OFF21_FM<0b111110>;
92 class BC1EQZ_ENC : COP1_BCCZ_FM<OPCODE5_BC1EQZ>;
93 class BC1NEZ_ENC : COP1_BCCZ_FM<OPCODE5_BC1NEZ>;
94 class BC2EQZ_ENC : COP2_BCCZ_FM<OPCODE5_BC2EQZ>;
95 class BC2NEZ_ENC : COP2_BCCZ_FM<OPCODE5_BC2NEZ>;
97 class JIALC_ENC : JMP_IDX_COMPACT_FM<0b111110>;
98 class JIC_ENC : JMP_IDX_COMPACT_FM<0b110110>;
99 class JR_HB_R6_ENC : JR_HB_R6_FM<OPCODE6_JALR>;
100 class BITSWAP_ENC : SPECIAL3_2R_FM<OPCODE6_BITSWAP>;
101 class BLEZALC_ENC : CMP_BRANCH_1R_RT_OFF16_FM<OPGROUP_BLEZ>,
102 DecodeDisambiguatedBy<"BlezGroupBranch">;
103 class BNVC_ENC : CMP_BRANCH_2R_OFF16_FM<OPGROUP_DADDI>,
104 DecodeDisambiguatedBy<"DaddiGroupBranch">;
105 class BOVC_ENC : CMP_BRANCH_2R_OFF16_FM<OPGROUP_ADDI>,
106 DecodeDisambiguatedBy<"AddiGroupBranch">;
107 class DIV_ENC : SPECIAL_3R_FM<0b00010, 0b011010>;
108 class DIVU_ENC : SPECIAL_3R_FM<0b00010, 0b011011>;
109 class MOD_ENC : SPECIAL_3R_FM<0b00011, 0b011010>;
110 class MODU_ENC : SPECIAL_3R_FM<0b00011, 0b011011>;
111 class MUH_ENC : SPECIAL_3R_FM<0b00011, 0b011000>;
112 class MUHU_ENC : SPECIAL_3R_FM<0b00011, 0b011001>;
113 class MUL_R6_ENC : SPECIAL_3R_FM<0b00010, 0b011000>;
114 class MULU_ENC : SPECIAL_3R_FM<0b00010, 0b011001>;
116 class MADDF_S_ENC : COP1_3R_FM<0b011000, FIELD_FMT_S>;
117 class MADDF_D_ENC : COP1_3R_FM<0b011000, FIELD_FMT_D>;
118 class MSUBF_S_ENC : COP1_3R_FM<0b011001, FIELD_FMT_S>;
119 class MSUBF_D_ENC : COP1_3R_FM<0b011001, FIELD_FMT_D>;
121 class SEL_D_ENC : COP1_3R_FM<0b010000, FIELD_FMT_D>;
122 class SEL_S_ENC : COP1_3R_FM<0b010000, FIELD_FMT_S>;
124 class SELEQZ_ENC : SPECIAL_3R_FM<0b00000, 0b110101>;
125 class SELNEZ_ENC : SPECIAL_3R_FM<0b00000, 0b110111>;
127 class LWPC_ENC : PCREL19_FM<OPCODE2_LWPC>;
128 class LWUPC_ENC : PCREL19_FM<OPCODE2_LWUPC>;
130 class MAX_S_ENC : COP1_3R_FM<0b011101, FIELD_FMT_S>;
131 class MAX_D_ENC : COP1_3R_FM<0b011101, FIELD_FMT_D>;
132 class MIN_S_ENC : COP1_3R_FM<0b011100, FIELD_FMT_S>;
133 class MIN_D_ENC : COP1_3R_FM<0b011100, FIELD_FMT_D>;
135 class MAXA_S_ENC : COP1_3R_FM<0b011111, FIELD_FMT_S>;
136 class MAXA_D_ENC : COP1_3R_FM<0b011111, FIELD_FMT_D>;
137 class MINA_S_ENC : COP1_3R_FM<0b011110, FIELD_FMT_S>;
138 class MINA_D_ENC : COP1_3R_FM<0b011110, FIELD_FMT_D>;
140 class SELEQZ_S_ENC : COP1_3R_FM<0b010100, FIELD_FMT_S>;
141 class SELEQZ_D_ENC : COP1_3R_FM<0b010100, FIELD_FMT_D>;
142 class SELNEZ_S_ENC : COP1_3R_FM<0b010111, FIELD_FMT_S>;
143 class SELNEZ_D_ENC : COP1_3R_FM<0b010111, FIELD_FMT_D>;
145 class RINT_S_ENC : COP1_2R_FM<0b011010, FIELD_FMT_S>;
146 class RINT_D_ENC : COP1_2R_FM<0b011010, FIELD_FMT_D>;
147 class CLASS_S_ENC : COP1_2R_FM<0b011011, FIELD_FMT_S>;
148 class CLASS_D_ENC : COP1_2R_FM<0b011011, FIELD_FMT_D>;
150 class CACHE_ENC : SPECIAL3_MEM_FM<OPCODE6_CACHE>;
151 class PREF_ENC : SPECIAL3_MEM_FM<OPCODE6_PREF>;
153 class LDC2_R6_ENC : COP2LDST_FM<OPCODE5_LDC2>;
154 class LWC2_R6_ENC : COP2LDST_FM<OPCODE5_LWC2>;
155 class SDC2_R6_ENC : COP2LDST_FM<OPCODE5_SDC2>;
156 class SWC2_R6_ENC : COP2LDST_FM<OPCODE5_SWC2>;
158 class LL_R6_ENC : SPECIAL3_LL_SC_FM<OPCODE6_LL>;
159 class SC_R6_ENC : SPECIAL3_LL_SC_FM<OPCODE6_SC>;
161 class CLO_R6_ENC : SPECIAL_2R_FM<OPCODE6_CLO>;
162 class CLZ_R6_ENC : SPECIAL_2R_FM<OPCODE6_CLZ>;
164 class CMP_CONDN_DESC_BASE<string CondStr, string Typestr,
165 RegisterOperand FGROpnd,
166 SDPatternOperator Op = null_frag> {
167 dag OutOperandList = (outs FGRCCOpnd:$fd);
168 dag InOperandList = (ins FGROpnd:$fs, FGROpnd:$ft);
169 string AsmString = !strconcat("cmp.", CondStr, ".", Typestr, "\t$fd, $fs, $ft");
170 list<dag> Pattern = [(set FGRCCOpnd:$fd, (Op FGROpnd:$fs, FGROpnd:$ft))];
173 //===----------------------------------------------------------------------===//
175 // Instruction Multiclasses
177 //===----------------------------------------------------------------------===//
179 multiclass CMP_CC_M <FIELD_CMP_FORMAT Format, string Typestr,
180 RegisterOperand FGROpnd>{
181 def CMP_F_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_F>,
182 CMP_CONDN_DESC_BASE<"f", Typestr, FGROpnd>,
184 def CMP_UN_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_UN>,
185 CMP_CONDN_DESC_BASE<"un", Typestr, FGROpnd, setuo>,
187 def CMP_EQ_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_EQ>,
188 CMP_CONDN_DESC_BASE<"eq", Typestr, FGROpnd, setoeq>,
190 def CMP_UEQ_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_UEQ>,
191 CMP_CONDN_DESC_BASE<"ueq", Typestr, FGROpnd, setueq>,
193 def CMP_OLT_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_OLT>,
194 CMP_CONDN_DESC_BASE<"olt", Typestr, FGROpnd, setolt>,
196 def CMP_ULT_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_ULT>,
197 CMP_CONDN_DESC_BASE<"ult", Typestr, FGROpnd, setult>,
199 def CMP_OLE_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_OLE>,
200 CMP_CONDN_DESC_BASE<"ole", Typestr, FGROpnd, setole>,
202 def CMP_ULE_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_ULE>,
203 CMP_CONDN_DESC_BASE<"ule", Typestr, FGROpnd, setule>,
205 def CMP_SF_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_SF>,
206 CMP_CONDN_DESC_BASE<"sf", Typestr, FGROpnd>,
208 def CMP_NGLE_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_NGLE>,
209 CMP_CONDN_DESC_BASE<"ngle", Typestr, FGROpnd>,
211 def CMP_SEQ_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_SEQ>,
212 CMP_CONDN_DESC_BASE<"seq", Typestr, FGROpnd>,
214 def CMP_NGL_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_NGL>,
215 CMP_CONDN_DESC_BASE<"ngl", Typestr, FGROpnd>,
217 def CMP_LT_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_LT>,
218 CMP_CONDN_DESC_BASE<"lt", Typestr, FGROpnd>,
220 def CMP_NGE_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_NGE>,
221 CMP_CONDN_DESC_BASE<"nge", Typestr, FGROpnd>,
223 def CMP_LE_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_LE>,
224 CMP_CONDN_DESC_BASE<"le", Typestr, FGROpnd>,
226 def CMP_NGT_#NAME : COP1_CMP_CONDN_FM<Format, FIELD_CMP_COND_NGT>,
227 CMP_CONDN_DESC_BASE<"ngt", Typestr, FGROpnd>,
231 //===----------------------------------------------------------------------===//
233 // Instruction Descriptions
235 //===----------------------------------------------------------------------===//
237 class PCREL_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
239 dag OutOperandList = (outs GPROpnd:$rs);
240 dag InOperandList = (ins ImmOpnd:$imm);
241 string AsmString = !strconcat(instr_asm, "\t$rs, $imm");
242 list<dag> Pattern = [];
245 class ADDIUPC_DESC : PCREL_DESC_BASE<"addiupc", GPR32Opnd, simm19_lsl2>;
246 class LWPC_DESC: PCREL_DESC_BASE<"lwpc", GPR32Opnd, simm19_lsl2>;
247 class LWUPC_DESC: PCREL_DESC_BASE<"lwupc", GPR32Opnd, simm19_lsl2>;
249 class ALIGN_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
251 dag OutOperandList = (outs GPROpnd:$rd);
252 dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, ImmOpnd:$bp);
253 string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt, $bp");
254 list<dag> Pattern = [];
257 class ALIGN_DESC : ALIGN_DESC_BASE<"align", GPR32Opnd, uimm2>;
259 class ALUIPC_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
260 dag OutOperandList = (outs GPROpnd:$rs);
261 dag InOperandList = (ins simm16:$imm);
262 string AsmString = !strconcat(instr_asm, "\t$rs, $imm");
263 list<dag> Pattern = [];
266 class ALUIPC_DESC : ALUIPC_DESC_BASE<"aluipc", GPR32Opnd>;
267 class AUIPC_DESC : ALUIPC_DESC_BASE<"auipc", GPR32Opnd>;
269 class AUI_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
270 dag OutOperandList = (outs GPROpnd:$rs);
271 dag InOperandList = (ins GPROpnd:$rt, simm16:$imm);
272 string AsmString = !strconcat(instr_asm, "\t$rs, $rt, $imm");
273 list<dag> Pattern = [];
276 class AUI_DESC : AUI_DESC_BASE<"aui", GPR32Opnd>;
278 class BRANCH_DESC_BASE {
280 bit isTerminator = 1;
281 bit hasDelaySlot = 0;
284 class BC_DESC_BASE<string instr_asm, DAGOperand opnd> : BRANCH_DESC_BASE {
285 dag InOperandList = (ins opnd:$offset);
286 dag OutOperandList = (outs);
287 string AsmString = !strconcat(instr_asm, "\t$offset");
291 class CMP_BC_DESC_BASE<string instr_asm, DAGOperand opnd,
292 RegisterOperand GPROpnd> : BRANCH_DESC_BASE {
293 dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt, opnd:$offset);
294 dag OutOperandList = (outs);
295 string AsmString = !strconcat(instr_asm, "\t$rs, $rt, $offset");
296 list<Register> Defs = [AT];
299 class CMP_CBR_EQNE_Z_DESC_BASE<string instr_asm, DAGOperand opnd,
300 RegisterOperand GPROpnd> : BRANCH_DESC_BASE {
301 dag InOperandList = (ins GPROpnd:$rs, opnd:$offset);
302 dag OutOperandList = (outs);
303 string AsmString = !strconcat(instr_asm, "\t$rs, $offset");
304 list<Register> Defs = [AT];
307 class CMP_CBR_RT_Z_DESC_BASE<string instr_asm, DAGOperand opnd,
308 RegisterOperand GPROpnd> : BRANCH_DESC_BASE {
309 dag InOperandList = (ins GPROpnd:$rt, opnd:$offset);
310 dag OutOperandList = (outs);
311 string AsmString = !strconcat(instr_asm, "\t$rt, $offset");
312 list<Register> Defs = [AT];
315 class BAL_DESC : BC_DESC_BASE<"bal", brtarget> {
317 bit hasDelaySlot = 1;
318 list<Register> Defs = [RA];
321 class BALC_DESC : BC_DESC_BASE<"balc", brtarget26> {
323 list<Register> Defs = [RA];
326 class BC_DESC : BC_DESC_BASE<"bc", brtarget26>;
327 class BGEC_DESC : CMP_BC_DESC_BASE<"bgec", brtarget, GPR32Opnd>;
328 class BGEUC_DESC : CMP_BC_DESC_BASE<"bgeuc", brtarget, GPR32Opnd>;
329 class BEQC_DESC : CMP_BC_DESC_BASE<"beqc", brtarget, GPR32Opnd>;
330 class BNEC_DESC : CMP_BC_DESC_BASE<"bnec", brtarget, GPR32Opnd>;
332 class BLTZC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bltzc", brtarget, GPR32Opnd>;
333 class BGEZC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bgezc", brtarget, GPR32Opnd>;
335 class BLEZC_DESC : CMP_CBR_RT_Z_DESC_BASE<"blezc", brtarget, GPR32Opnd>;
336 class BGTZC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bgtzc", brtarget, GPR32Opnd>;
338 class BEQZC_DESC : CMP_CBR_EQNE_Z_DESC_BASE<"beqzc", brtarget21, GPR32Opnd>;
339 class BNEZC_DESC : CMP_CBR_EQNE_Z_DESC_BASE<"bnezc", brtarget21, GPR32Opnd>;
341 class COP1_BCCZ_DESC_BASE<string instr_asm> : BRANCH_DESC_BASE {
342 dag InOperandList = (ins FGR64Opnd:$ft, brtarget:$offset);
343 dag OutOperandList = (outs);
344 string AsmString = instr_asm;
345 bit hasDelaySlot = 1;
348 class BC1EQZ_DESC : COP1_BCCZ_DESC_BASE<"bc1eqz $ft, $offset">;
349 class BC1NEZ_DESC : COP1_BCCZ_DESC_BASE<"bc1nez $ft, $offset">;
351 class COP2_BCCZ_DESC_BASE<string instr_asm> : BRANCH_DESC_BASE {
352 dag InOperandList = (ins COP2Opnd:$ct, brtarget:$offset);
353 dag OutOperandList = (outs);
354 string AsmString = instr_asm;
355 bit hasDelaySlot = 1;
358 class BC2EQZ_DESC : COP2_BCCZ_DESC_BASE<"bc2eqz $ct, $offset">;
359 class BC2NEZ_DESC : COP2_BCCZ_DESC_BASE<"bc2nez $ct, $offset">;
361 class BOVC_DESC : CMP_BC_DESC_BASE<"bovc", brtarget, GPR32Opnd>;
362 class BNVC_DESC : CMP_BC_DESC_BASE<"bnvc", brtarget, GPR32Opnd>;
364 class JMP_IDX_COMPACT_DESC_BASE<string opstr, DAGOperand opnd,
365 RegisterOperand GPROpnd> {
366 dag InOperandList = (ins GPROpnd:$rt, opnd:$offset);
367 string AsmString = !strconcat(opstr, "\t$rt, $offset");
368 list<dag> Pattern = [];
369 bit isTerminator = 1;
370 bit hasDelaySlot = 0;
371 string DecoderMethod = "DecodeSimm16";
374 class JIALC_DESC : JMP_IDX_COMPACT_DESC_BASE<"jialc", calloffset16,
377 list<Register> Defs = [RA];
380 class JIC_DESC : JMP_IDX_COMPACT_DESC_BASE<"jic", jmpoffset16, GPR32Opnd> {
382 list<Register> Defs = [AT];
385 class JR_HB_R6_DESC : JR_HB_DESC_BASE<"jr.hb", GPR32Opnd> {
387 bit isIndirectBranch = 1;
388 bit hasDelaySlot = 1;
393 class BITSWAP_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
394 dag OutOperandList = (outs GPROpnd:$rd);
395 dag InOperandList = (ins GPROpnd:$rt);
396 string AsmString = !strconcat(instr_asm, "\t$rd, $rt");
397 list<dag> Pattern = [];
400 class BITSWAP_DESC : BITSWAP_DESC_BASE<"bitswap", GPR32Opnd>;
402 class DIVMOD_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
403 SDPatternOperator Op=null_frag> {
404 dag OutOperandList = (outs GPROpnd:$rd);
405 dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt);
406 string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt");
407 list<dag> Pattern = [(set GPROpnd:$rd, (Op GPROpnd:$rs, GPROpnd:$rt))];
409 // This instruction doesn't trap division by zero itself. We must insert
410 // teq instructions as well.
411 bit usesCustomInserter = 1;
414 class DIV_DESC : DIVMOD_DESC_BASE<"div", GPR32Opnd, sdiv>;
415 class DIVU_DESC : DIVMOD_DESC_BASE<"divu", GPR32Opnd, udiv>;
416 class MOD_DESC : DIVMOD_DESC_BASE<"mod", GPR32Opnd, srem>;
417 class MODU_DESC : DIVMOD_DESC_BASE<"modu", GPR32Opnd, urem>;
419 class BEQZALC_DESC : CMP_CBR_RT_Z_DESC_BASE<"beqzalc", brtarget, GPR32Opnd> {
420 list<Register> Defs = [RA];
423 class BGEZALC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bgezalc", brtarget, GPR32Opnd> {
424 list<Register> Defs = [RA];
427 class BGTZALC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bgtzalc", brtarget, GPR32Opnd> {
428 list<Register> Defs = [RA];
431 class BLEZALC_DESC : CMP_CBR_RT_Z_DESC_BASE<"blezalc", brtarget, GPR32Opnd> {
432 list<Register> Defs = [RA];
435 class BLTZALC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bltzalc", brtarget, GPR32Opnd> {
436 list<Register> Defs = [RA];
439 class BNEZALC_DESC : CMP_CBR_RT_Z_DESC_BASE<"bnezalc", brtarget, GPR32Opnd> {
440 list<Register> Defs = [RA];
443 class MUL_R6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd,
444 SDPatternOperator Op=null_frag> {
445 dag OutOperandList = (outs GPROpnd:$rd);
446 dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt);
447 string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt");
448 list<dag> Pattern = [(set GPROpnd:$rd, (Op GPROpnd:$rs, GPROpnd:$rt))];
451 class MUH_DESC : MUL_R6_DESC_BASE<"muh", GPR32Opnd, mulhs>;
452 class MUHU_DESC : MUL_R6_DESC_BASE<"muhu", GPR32Opnd, mulhu>;
453 class MUL_R6_DESC : MUL_R6_DESC_BASE<"mul", GPR32Opnd, mul>;
454 class MULU_DESC : MUL_R6_DESC_BASE<"mulu", GPR32Opnd>;
456 class COP1_SEL_DESC_BASE<string instr_asm, RegisterOperand FGROpnd> {
457 dag OutOperandList = (outs FGROpnd:$fd);
458 dag InOperandList = (ins FGRCCOpnd:$fd_in, FGROpnd:$fs, FGROpnd:$ft);
459 string AsmString = !strconcat(instr_asm, "\t$fd, $fs, $ft");
460 list<dag> Pattern = [(set FGROpnd:$fd, (select FGRCCOpnd:$fd_in,
463 string Constraints = "$fd_in = $fd";
466 class SEL_D_DESC : COP1_SEL_DESC_BASE<"sel.d", FGR64Opnd> {
467 // We must insert a SUBREG_TO_REG around $fd_in
468 bit usesCustomInserter = 1;
470 class SEL_S_DESC : COP1_SEL_DESC_BASE<"sel.s", FGR32Opnd>;
472 class SELEQNE_Z_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
473 dag OutOperandList = (outs GPROpnd:$rd);
474 dag InOperandList = (ins GPROpnd:$rs, GPROpnd:$rt);
475 string AsmString = !strconcat(instr_asm, "\t$rd, $rs, $rt");
476 list<dag> Pattern = [];
479 class SELEQZ_DESC : SELEQNE_Z_DESC_BASE<"seleqz", GPR32Opnd>;
480 class SELNEZ_DESC : SELEQNE_Z_DESC_BASE<"selnez", GPR32Opnd>;
482 class COP1_4R_DESC_BASE<string instr_asm, RegisterOperand FGROpnd> {
483 dag OutOperandList = (outs FGROpnd:$fd);
484 dag InOperandList = (ins FGROpnd:$fd_in, FGROpnd:$fs, FGROpnd:$ft);
485 string AsmString = !strconcat(instr_asm, "\t$fd, $fs, $ft");
486 list<dag> Pattern = [];
487 string Constraints = "$fd_in = $fd";
490 class MADDF_S_DESC : COP1_4R_DESC_BASE<"maddf.s", FGR32Opnd>;
491 class MADDF_D_DESC : COP1_4R_DESC_BASE<"maddf.d", FGR64Opnd>;
492 class MSUBF_S_DESC : COP1_4R_DESC_BASE<"msubf.s", FGR32Opnd>;
493 class MSUBF_D_DESC : COP1_4R_DESC_BASE<"msubf.d", FGR64Opnd>;
495 class MAX_MIN_DESC_BASE<string instr_asm, RegisterOperand FGROpnd> {
496 dag OutOperandList = (outs FGROpnd:$fd);
497 dag InOperandList = (ins FGROpnd:$fs, FGROpnd:$ft);
498 string AsmString = !strconcat(instr_asm, "\t$fd, $fs, $ft");
499 list<dag> Pattern = [];
502 class MAX_S_DESC : MAX_MIN_DESC_BASE<"max.s", FGR32Opnd>;
503 class MAX_D_DESC : MAX_MIN_DESC_BASE<"max.d", FGR64Opnd>;
504 class MIN_S_DESC : MAX_MIN_DESC_BASE<"min.s", FGR32Opnd>;
505 class MIN_D_DESC : MAX_MIN_DESC_BASE<"min.d", FGR64Opnd>;
507 class MAXA_S_DESC : MAX_MIN_DESC_BASE<"maxa.s", FGR32Opnd>;
508 class MAXA_D_DESC : MAX_MIN_DESC_BASE<"maxa.d", FGR64Opnd>;
509 class MINA_S_DESC : MAX_MIN_DESC_BASE<"mina.s", FGR32Opnd>;
510 class MINA_D_DESC : MAX_MIN_DESC_BASE<"mina.d", FGR64Opnd>;
512 class SELEQNEZ_DESC_BASE<string instr_asm, RegisterOperand FGROpnd> {
513 dag OutOperandList = (outs FGROpnd:$fd);
514 dag InOperandList = (ins FGROpnd:$fs, FGROpnd:$ft);
515 string AsmString = !strconcat(instr_asm, "\t$fd, $fs, $ft");
516 list<dag> Pattern = [];
519 class SELEQZ_S_DESC : SELEQNEZ_DESC_BASE<"seleqz.s", FGR32Opnd>;
520 class SELEQZ_D_DESC : SELEQNEZ_DESC_BASE<"seleqz.d", FGR64Opnd>;
521 class SELNEZ_S_DESC : SELEQNEZ_DESC_BASE<"selnez.s", FGR32Opnd>;
522 class SELNEZ_D_DESC : SELEQNEZ_DESC_BASE<"selnez.d", FGR64Opnd>;
524 class CLASS_RINT_DESC_BASE<string instr_asm, RegisterOperand FGROpnd> {
525 dag OutOperandList = (outs FGROpnd:$fd);
526 dag InOperandList = (ins FGROpnd:$fs);
527 string AsmString = !strconcat(instr_asm, "\t$fd, $fs");
528 list<dag> Pattern = [];
531 class RINT_S_DESC : CLASS_RINT_DESC_BASE<"rint.s", FGR32Opnd>;
532 class RINT_D_DESC : CLASS_RINT_DESC_BASE<"rint.d", FGR64Opnd>;
533 class CLASS_S_DESC : CLASS_RINT_DESC_BASE<"class.s", FGR32Opnd>;
534 class CLASS_D_DESC : CLASS_RINT_DESC_BASE<"class.d", FGR64Opnd>;
536 class CACHE_HINT_DESC<string instr_asm, Operand MemOpnd,
537 RegisterOperand GPROpnd> {
538 dag OutOperandList = (outs);
539 dag InOperandList = (ins MemOpnd:$addr, uimm5:$hint);
540 string AsmString = !strconcat(instr_asm, "\t$hint, $addr");
541 list<dag> Pattern = [];
544 class CACHE_DESC : CACHE_HINT_DESC<"cache", mem_simm9, GPR32Opnd>;
545 class PREF_DESC : CACHE_HINT_DESC<"pref", mem_simm9, GPR32Opnd>;
547 class COP2LD_DESC_BASE<string instr_asm, RegisterOperand COPOpnd> {
548 dag OutOperandList = (outs COPOpnd:$rt);
549 dag InOperandList = (ins mem_simm11:$addr);
550 string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
551 list<dag> Pattern = [];
555 class LDC2_R6_DESC : COP2LD_DESC_BASE<"ldc2", COP2Opnd>;
556 class LWC2_R6_DESC : COP2LD_DESC_BASE<"lwc2", COP2Opnd>;
558 class COP2ST_DESC_BASE<string instr_asm, RegisterOperand COPOpnd> {
559 dag OutOperandList = (outs);
560 dag InOperandList = (ins COPOpnd:$rt, mem_simm11:$addr);
561 string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
562 list<dag> Pattern = [];
566 class SDC2_R6_DESC : COP2ST_DESC_BASE<"sdc2", COP2Opnd>;
567 class SWC2_R6_DESC : COP2ST_DESC_BASE<"swc2", COP2Opnd>;
569 class LL_R6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
570 dag OutOperandList = (outs GPROpnd:$rt);
571 dag InOperandList = (ins mem_simm9:$addr);
572 string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
573 list<dag> Pattern = [];
577 class LL_R6_DESC : LL_R6_DESC_BASE<"ll", GPR32Opnd>;
579 class SC_R6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
580 dag OutOperandList = (outs GPROpnd:$dst);
581 dag InOperandList = (ins GPROpnd:$rt, mem_simm9:$addr);
582 string AsmString = !strconcat(instr_asm, "\t$rt, $addr");
583 list<dag> Pattern = [];
585 string Constraints = "$rt = $dst";
588 class SC_R6_DESC : SC_R6_DESC_BASE<"sc", GPR32Opnd>;
590 class CLO_CLZ_R6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> {
591 dag OutOperandList = (outs GPROpnd:$rd);
592 dag InOperandList = (ins GPROpnd:$rs);
593 string AsmString = !strconcat(instr_asm, "\t$rd, $rs");
596 class CLO_R6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> :
597 CLO_CLZ_R6_DESC_BASE<instr_asm, GPROpnd> {
598 list<dag> Pattern = [(set GPROpnd:$rd, (ctlz (not GPROpnd:$rs)))];
601 class CLZ_R6_DESC_BASE<string instr_asm, RegisterOperand GPROpnd> :
602 CLO_CLZ_R6_DESC_BASE<instr_asm, GPROpnd> {
603 list<dag> Pattern = [(set GPROpnd:$rd, (ctlz GPROpnd:$rs))];
606 class CLO_R6_DESC : CLO_R6_DESC_BASE<"clo", GPR32Opnd>;
607 class CLZ_R6_DESC : CLZ_R6_DESC_BASE<"clz", GPR32Opnd>;
609 //===----------------------------------------------------------------------===//
611 // Instruction Definitions
613 //===----------------------------------------------------------------------===//
615 def ADDIUPC : ADDIUPC_ENC, ADDIUPC_DESC, ISA_MIPS32R6;
616 def ALIGN : ALIGN_ENC, ALIGN_DESC, ISA_MIPS32R6;
617 def ALUIPC : ALUIPC_ENC, ALUIPC_DESC, ISA_MIPS32R6;
618 def AUI : AUI_ENC, AUI_DESC, ISA_MIPS32R6;
619 def AUIPC : AUIPC_ENC, AUIPC_DESC, ISA_MIPS32R6;
620 def BAL : BAL_ENC, BAL_DESC, ISA_MIPS32R6;
621 def BALC : BALC_ENC, BALC_DESC, ISA_MIPS32R6;
622 def BC1EQZ : BC1EQZ_ENC, BC1EQZ_DESC, ISA_MIPS32R6;
623 def BC1NEZ : BC1NEZ_ENC, BC1NEZ_DESC, ISA_MIPS32R6;
624 def BC2EQZ : BC2EQZ_ENC, BC2EQZ_DESC, ISA_MIPS32R6;
625 def BC2NEZ : BC2NEZ_ENC, BC2NEZ_DESC, ISA_MIPS32R6;
626 def BC : BC_ENC, BC_DESC, ISA_MIPS32R6;
627 def BEQC : BEQC_ENC, BEQC_DESC, ISA_MIPS32R6;
628 def BEQZALC : BEQZALC_ENC, BEQZALC_DESC, ISA_MIPS32R6;
629 def BEQZC : BEQZC_ENC, BEQZC_DESC, ISA_MIPS32R6;
630 def BGEC : BGEC_ENC, BGEC_DESC, ISA_MIPS32R6;
631 def BGEUC : BGEUC_ENC, BGEUC_DESC, ISA_MIPS32R6;
632 def BGEZALC : BGEZALC_ENC, BGEZALC_DESC, ISA_MIPS32R6;
633 def BGEZC : BGEZC_ENC, BGEZC_DESC, ISA_MIPS32R6;
634 def BGTZALC : BGTZALC_ENC, BGTZALC_DESC, ISA_MIPS32R6;
635 def BGTZC : BGTZC_ENC, BGTZC_DESC, ISA_MIPS32R6;
636 def BITSWAP : BITSWAP_ENC, BITSWAP_DESC, ISA_MIPS32R6;
637 def BLEZALC : BLEZALC_ENC, BLEZALC_DESC, ISA_MIPS32R6;
638 def BLEZC : BLEZC_ENC, BLEZC_DESC, ISA_MIPS32R6;
639 def BLTC; // Also aliased to bgtc with operands swapped
640 def BLTUC; // Also aliased to bgtuc with operands swapped
641 def BLTZALC : BLTZALC_ENC, BLTZALC_DESC, ISA_MIPS32R6;
642 def BLTZC : BLTZC_ENC, BLTZC_DESC, ISA_MIPS32R6;
643 def BNEC : BNEC_ENC, BNEC_DESC, ISA_MIPS32R6;
644 def BNEZALC : BNEZALC_ENC, BNEZALC_DESC, ISA_MIPS32R6;
645 def BNEZC : BNEZC_ENC, BNEZC_DESC, ISA_MIPS32R6;
646 def BNVC : BNVC_ENC, BNVC_DESC, ISA_MIPS32R6;
647 def BOVC : BOVC_ENC, BOVC_DESC, ISA_MIPS32R6;
648 def CACHE_R6 : CACHE_ENC, CACHE_DESC, ISA_MIPS32R6;
649 def CLASS_D : CLASS_D_ENC, CLASS_D_DESC, ISA_MIPS32R6;
650 def CLASS_S : CLASS_S_ENC, CLASS_S_DESC, ISA_MIPS32R6;
651 def CLO_R6 : CLO_R6_ENC, CLO_R6_DESC, ISA_MIPS32R6;
652 def CLZ_R6 : CLZ_R6_ENC, CLZ_R6_DESC, ISA_MIPS32R6;
653 defm S : CMP_CC_M<FIELD_CMP_FORMAT_S, "s", FGR32Opnd>;
654 defm D : CMP_CC_M<FIELD_CMP_FORMAT_D, "d", FGR64Opnd>;
655 def DIV : DIV_ENC, DIV_DESC, ISA_MIPS32R6;
656 def DIVU : DIVU_ENC, DIVU_DESC, ISA_MIPS32R6;
657 def JIALC : JIALC_ENC, JIALC_DESC, ISA_MIPS32R6;
658 def JIC : JIC_ENC, JIC_DESC, ISA_MIPS32R6;
659 def JR_HB_R6 : JR_HB_R6_ENC, JR_HB_R6_DESC, ISA_MIPS32R6;
660 def LDC2_R6 : LDC2_R6_ENC, LDC2_R6_DESC, ISA_MIPS32R6;
661 def LL_R6 : LL_R6_ENC, LL_R6_DESC, ISA_MIPS32R6;
662 // def LSA; // See MSA
663 def LWC2_R6 : LWC2_R6_ENC, LWC2_R6_DESC, ISA_MIPS32R6;
664 def LWPC : LWPC_ENC, LWPC_DESC, ISA_MIPS32R6;
665 def LWUPC : LWUPC_ENC, LWUPC_DESC, ISA_MIPS32R6;
666 def MADDF_S : MADDF_S_ENC, MADDF_S_DESC, ISA_MIPS32R6;
667 def MADDF_D : MADDF_D_ENC, MADDF_D_DESC, ISA_MIPS32R6;
668 def MAXA_D : MAXA_D_ENC, MAXA_D_DESC, ISA_MIPS32R6;
669 def MAXA_S : MAXA_S_ENC, MAXA_S_DESC, ISA_MIPS32R6;
670 def MAX_D : MAX_D_ENC, MAX_D_DESC, ISA_MIPS32R6;
671 def MAX_S : MAX_S_ENC, MAX_S_DESC, ISA_MIPS32R6;
672 def MINA_D : MINA_D_ENC, MINA_D_DESC, ISA_MIPS32R6;
673 def MINA_S : MINA_S_ENC, MINA_S_DESC, ISA_MIPS32R6;
674 def MIN_D : MIN_D_ENC, MIN_D_DESC, ISA_MIPS32R6;
675 def MIN_S : MIN_S_ENC, MIN_S_DESC, ISA_MIPS32R6;
676 def MOD : MOD_ENC, MOD_DESC, ISA_MIPS32R6;
677 def MODU : MODU_ENC, MODU_DESC, ISA_MIPS32R6;
678 def MSUBF_S : MSUBF_S_ENC, MSUBF_S_DESC, ISA_MIPS32R6;
679 def MSUBF_D : MSUBF_D_ENC, MSUBF_D_DESC, ISA_MIPS32R6;
680 def MUH : MUH_ENC, MUH_DESC, ISA_MIPS32R6;
681 def MUHU : MUHU_ENC, MUHU_DESC, ISA_MIPS32R6;
682 def MUL_R6 : MUL_R6_ENC, MUL_R6_DESC, ISA_MIPS32R6;
683 def MULU : MULU_ENC, MULU_DESC, ISA_MIPS32R6;
684 def NAL; // BAL with rd=0
685 def PREF_R6 : PREF_ENC, PREF_DESC, ISA_MIPS32R6;
686 def RINT_D : RINT_D_ENC, RINT_D_DESC, ISA_MIPS32R6;
687 def RINT_S : RINT_S_ENC, RINT_S_DESC, ISA_MIPS32R6;
688 def SC_R6 : SC_R6_ENC, SC_R6_DESC, ISA_MIPS32R6;
689 def SDC2_R6 : SDC2_R6_ENC, SDC2_R6_DESC, ISA_MIPS32R6;
690 def SELEQZ : SELEQZ_ENC, SELEQZ_DESC, ISA_MIPS32R6, GPR_32;
691 def SELEQZ_D : SELEQZ_D_ENC, SELEQZ_D_DESC, ISA_MIPS32R6;
692 def SELEQZ_S : SELEQZ_S_ENC, SELEQZ_S_DESC, ISA_MIPS32R6;
693 def SELNEZ : SELNEZ_ENC, SELNEZ_DESC, ISA_MIPS32R6, GPR_32;
694 def SELNEZ_D : SELNEZ_D_ENC, SELNEZ_D_DESC, ISA_MIPS32R6;
695 def SELNEZ_S : SELNEZ_S_ENC, SELNEZ_S_DESC, ISA_MIPS32R6;
696 def SEL_D : SEL_D_ENC, SEL_D_DESC, ISA_MIPS32R6;
697 def SEL_S : SEL_S_ENC, SEL_S_DESC, ISA_MIPS32R6;
698 def SWC2_R6 : SWC2_R6_ENC, SWC2_R6_DESC, ISA_MIPS32R6;
700 //===----------------------------------------------------------------------===//
702 // Patterns and Pseudo Instructions
704 //===----------------------------------------------------------------------===//
706 // f32 comparisons supported via another comparison
707 def : MipsPat<(setone f32:$lhs, f32:$rhs),
708 (NOR (CMP_UEQ_S f32:$lhs, f32:$rhs), ZERO)>, ISA_MIPS32R6;
709 def : MipsPat<(seto f32:$lhs, f32:$rhs),
710 (NOR (CMP_UN_S f32:$lhs, f32:$rhs), ZERO)>, ISA_MIPS32R6;
711 def : MipsPat<(setune f32:$lhs, f32:$rhs),
712 (NOR (CMP_EQ_S f32:$lhs, f32:$rhs), ZERO)>, ISA_MIPS32R6;
713 def : MipsPat<(seteq f32:$lhs, f32:$rhs), (CMP_EQ_S f32:$lhs, f32:$rhs)>,
715 def : MipsPat<(setgt f32:$lhs, f32:$rhs), (CMP_LE_S f32:$rhs, f32:$lhs)>,
717 def : MipsPat<(setge f32:$lhs, f32:$rhs), (CMP_LT_S f32:$rhs, f32:$lhs)>,
719 def : MipsPat<(setlt f32:$lhs, f32:$rhs), (CMP_OLT_S f32:$lhs, f32:$rhs)>,
721 def : MipsPat<(setlt f32:$lhs, f32:$rhs), (CMP_OLE_S f32:$lhs, f32:$rhs)>,
723 def : MipsPat<(setne f32:$lhs, f32:$rhs),
724 (NOR (CMP_EQ_S f32:$lhs, f32:$rhs), ZERO)>, ISA_MIPS32R6;
726 // f64 comparisons supported via another comparison
727 def : MipsPat<(setone f64:$lhs, f64:$rhs),
728 (NOR (CMP_UEQ_D f64:$lhs, f64:$rhs), ZERO)>, ISA_MIPS32R6;
729 def : MipsPat<(seto f64:$lhs, f64:$rhs),
730 (NOR (CMP_UN_D f64:$lhs, f64:$rhs), ZERO)>, ISA_MIPS32R6;
731 def : MipsPat<(setune f64:$lhs, f64:$rhs),
732 (NOR (CMP_EQ_D f64:$lhs, f64:$rhs), ZERO)>, ISA_MIPS32R6;
733 def : MipsPat<(seteq f64:$lhs, f64:$rhs), (CMP_EQ_D f64:$lhs, f64:$rhs)>,
735 def : MipsPat<(setgt f64:$lhs, f64:$rhs), (CMP_LE_D f64:$rhs, f64:$lhs)>,
737 def : MipsPat<(setge f64:$lhs, f64:$rhs), (CMP_LT_D f64:$rhs, f64:$lhs)>,
739 def : MipsPat<(setlt f64:$lhs, f64:$rhs), (CMP_OLT_D f64:$lhs, f64:$rhs)>,
741 def : MipsPat<(setlt f64:$lhs, f64:$rhs), (CMP_OLE_D f64:$lhs, f64:$rhs)>,
743 def : MipsPat<(setne f64:$lhs, f64:$rhs),
744 (NOR (CMP_EQ_D f64:$lhs, f64:$rhs), ZERO)>, ISA_MIPS32R6;
747 def : MipsPat<(select i32:$cond, i32:$t, i32:$f),
748 (OR (SELNEZ i32:$t, i32:$cond), (SELEQZ i32:$f, i32:$cond))>,
750 def : MipsPat<(select (i32 (seteq i32:$cond, immz)), i32:$t, i32:$f),
751 (OR (SELNEZ i32:$t, i32:$cond), (SELEQZ i32:$f, i32:$cond))>,
753 def : MipsPat<(select (i32 (setne i32:$cond, immz)), i32:$t, i32:$f),
754 (OR (SELNEZ i32:$f, i32:$cond), (SELEQZ i32:$t, i32:$cond))>,
756 def : MipsPat<(select (i32 (seteq i32:$cond, immZExt16:$imm)), i32:$t, i32:$f),
757 (OR (SELNEZ i32:$t, (XORi i32:$cond, immZExt16:$imm)),
758 (SELEQZ i32:$f, (XORi i32:$cond, immZExt16:$imm)))>,
760 def : MipsPat<(select (i32 (setne i32:$cond, immZExt16:$imm)), i32:$t, i32:$f),
761 (OR (SELNEZ i32:$f, (XORi i32:$cond, immZExt16:$imm)),
762 (SELEQZ i32:$t, (XORi i32:$cond, immZExt16:$imm)))>,
764 def : MipsPat<(select (i32 (setgt i32:$cond, immSExt16Plus1:$imm)), i32:$t,
766 (OR (SELNEZ i32:$t, (SLTi i32:$cond, (Plus1 imm:$imm))),
767 (SELEQZ i32:$f, (SLTi i32:$cond, (Plus1 imm:$imm))))>,
769 def : MipsPat<(select (i32 (setugt i32:$cond, immSExt16Plus1:$imm)),
771 (OR (SELNEZ i32:$t, (SLTiu i32:$cond, (Plus1 imm:$imm))),
772 (SELEQZ i32:$f, (SLTiu i32:$cond, (Plus1 imm:$imm))))>,
775 def : MipsPat<(select i32:$cond, i32:$t, immz),
776 (SELNEZ i32:$t, i32:$cond)>, ISA_MIPS32R6;
777 def : MipsPat<(select (i32 (setne i32:$cond, immz)), i32:$t, immz),
778 (SELNEZ i32:$t, i32:$cond)>, ISA_MIPS32R6;
779 def : MipsPat<(select (i32 (seteq i32:$cond, immz)), i32:$t, immz),
780 (SELEQZ i32:$t, i32:$cond)>, ISA_MIPS32R6;
781 def : MipsPat<(select i32:$cond, immz, i32:$f),
782 (SELEQZ i32:$f, i32:$cond)>, ISA_MIPS32R6;
783 def : MipsPat<(select (i32 (setne i32:$cond, immz)), immz, i32:$f),
784 (SELEQZ i32:$f, i32:$cond)>, ISA_MIPS32R6;
785 def : MipsPat<(select (i32 (seteq i32:$cond, immz)), immz, i32:$f),
786 (SELNEZ i32:$f, i32:$cond)>, ISA_MIPS32R6;