1 //=- MipsScheduleGeneric.td - Generic Scheduling Definitions -*- tablegen -*-=//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file describes the interAptiv processor in a manner of speaking. It
10 // describes a hypothetical version of the in-order MIPS32R2 interAptiv with all
11 // branches of the MIPS ISAs, ASEs and ISA variants. The itinerary lists are
12 // broken down into per ISA lists, so that this file can be used to rapidly
13 // develop new schedule models.
15 //===----------------------------------------------------------------------===//
16 def MipsGenericModel : SchedMachineModel {
18 int MicroOpBufferSize = 0;
20 // These figures assume an L1 hit.
22 int MispredictPenalty = 4;
25 list<Predicate> UnsupportedFeatures = [];
27 let CompleteModel = 1;
28 let PostRAScheduler = 1;
30 // FIXME: Remove when all errors have been fixed.
31 let FullInstRWOverlapCheck = 1;
34 let SchedModel = MipsGenericModel in {
39 def GenericALU : ProcResource<1> { let BufferSize = 1; }
40 def GenericIssueALU : ProcResource<1> { let Super = GenericALU; }
42 def GenericWriteALU : SchedWriteRes<[GenericIssueALU]>;
44 // add, addi, addiu, addu, and, andi, clo, clz, ext, ins, lui, nor, or, ori,
45 // rotr, rotrv, seb, seh, sll, sllv, slt, slti, sltiu, sltu, sra, srav, srl,
46 // srlv, ssnop, sub, subu, wsbh, xor, xori
47 def : InstRW<[GenericWriteALU], (instrs ADD, ADDi, ADDiu, ADDu, AND, ANDi,
48 CLO, CLZ, EXT, INS, LEA_ADDiu, LUi, NOP,
49 NOR, OR, ORi, ROTR, ROTRV, SEB, SEH, SLL,
50 SLLV, SLT, SLTi, SLTiu, SLTu, SRA, SRAV, SRL,
51 SRLV, SSNOP, SUB, SUBu, WSBH, XOR, XORi)>;
53 def : InstRW<[GenericWriteALU], (instrs COPY)>;
58 // addiupc, align, aluipc, aui, auipc, bitswap, clo, clz, lsa, seleqz, selnez
59 def : InstRW<[GenericWriteALU], (instrs ADDIUPC, ALIGN, ALUIPC, AUI,
60 AUIPC, BITSWAP, CLO_R6, CLZ_R6, LSA_R6,
66 def : InstRW<[GenericWriteALU], (instrs AddiuRxImmX16, AddiuRxRxImm16,
67 AddiuRxRxImmX16, AddiuRxRyOffMemX16,
68 AddiuRxPcImmX16, AddiuSpImm16, AddiuSpImmX16,
69 AdduRxRyRz16, AndRxRxRy16, CmpRxRy16,
70 CmpiRxImm16, CmpiRxImmX16, LiRxImm16,
71 LiRxImmX16, LiRxImmAlignX16, Move32R16,
72 MoveR3216, Mfhi16, Mflo16, NegRxRy16,
73 NotRxRy16, OrRxRxRy16, SebRx16, SehRx16,
74 SllX16, SllvRxRy16, SltiRxImm16,
75 SltiRxImmX16, SltiCCRxImmX16,
76 SltiuRxImm16, SltiuRxImmX16, SltiuCCRxImmX16,
77 SltRxRy16, SltCCRxRy16, SltuRxRy16,
78 SltuRxRyRz16, SltuCCRxRy16, SravRxRy16,
79 SraX16, SrlvRxRy16, SrlX16, SubuRxRyRz16,
82 def : InstRW<[GenericWriteALU], (instrs Constant32, LwConstant32,
83 GotPrologue16, CONSTPOOL_ENTRY)>;
88 def : InstRW<[GenericWriteALU], (instrs ADDIUPC_MM, ADDIUR1SP_MM, ADDIUR2_MM,
89 ADDIUS5_MM, ADDIUSP_MM, ADDU16_MM, ADD_MM,
90 ADDi_MM, ADDiu_MM, ADDu_MM, AND16_MM,
91 ANDI16_MM, AND_MM, ANDi_MM, CLO_MM, CLZ_MM,
92 EXT_MM, INS_MM, LEA_ADDiu_MM, LI16_MM,
93 LUi_MM, MOVE16_MM, MOVEP_MM, NOR_MM,
94 NOT16_MM, OR16_MM, OR_MM, ORi_MM, ROTRV_MM,
95 ROTR_MM, SEB_MM, SEH_MM, SLL16_MM, SLLV_MM,
96 SLL_MM, SLT_MM, SLTi_MM, SLTiu_MM, SLTu_MM,
97 SRAV_MM, SRA_MM, SRL16_MM, SRLV_MM, SRL_MM,
98 SSNOP_MM, SUBU16_MM, SUB_MM, SUBu_MM,
99 WSBH_MM, XOR16_MM, XOR_MM, XORi_MM)>;
104 def : InstRW<[GenericWriteALU], (instrs ADDIUPC_MMR6, ADDIU_MMR6, ADDU16_MMR6,
105 ADDU_MMR6, ADD_MMR6, ALIGN_MMR6, ALUIPC_MMR6,
106 AND16_MMR6, ANDI16_MMR6, ANDI_MMR6, AND_MMR6,
107 AUIPC_MMR6, AUI_MMR6, BITSWAP_MMR6, CLO_MMR6,
108 CLZ_MMR6, EXT_MMR6, INS_MMR6, LI16_MMR6,
109 LSA_MMR6, LUI_MMR6, MOVE16_MMR6, NOR_MMR6,
110 NOT16_MMR6, OR16_MMR6, ORI_MMR6, OR_MMR6,
111 SELEQZ_MMR6, SELNEZ_MMR6, SLL16_MMR6,
112 SLL_MMR6, SRL16_MMR6, SSNOP_MMR6, SUBU16_MMR6,
113 SUBU_MMR6, SUB_MMR6, WSBH_MMR6, XOR16_MMR6,
114 XORI_MMR6, XOR_MMR6)>;
119 def : InstRW<[GenericWriteALU], (instrs AND64, ANDi64, DEXT64_32, DSLL64_32,
120 ORi64, SEB64, SEH64, SLL64_32, SLL64_64,
121 SLT64, SLTi64, SLTiu64, SLTu64, XOR64,
124 def : InstRW<[GenericWriteALU], (instrs DADD, DADDi, DADDiu, DADDu, DCLO,
125 DCLZ, DEXT, DEXTM, DEXTU, DINS, DINSM, DINSU,
126 DROTR, DROTR32, DROTRV, DSBH, DSHD, DSLL,
127 DSLL32, DSLLV, DSRA, DSRA32, DSRAV, DSRL,
128 DSRL32, DSRLV, DSUB, DSUBu, LEA_ADDiu64,
129 LUi64, NOR64, OR64)>;
134 def : InstRW<[GenericWriteALU], (instrs DALIGN, DAHI, DATI, DAUI, DCLO_R6,
135 DCLZ_R6, DBITSWAP, DLSA, DLSA_R6, SELEQZ64,
139 def GenericMDU : ProcResource<1> { let BufferSize = 1; }
140 def GenericIssueMDU : ProcResource<1> { let Super = GenericALU; }
141 def GenericIssueDIV : ProcResource<1> { let Super = GenericMDU; }
142 def GenericWriteHILO : SchedWriteRes<[GenericIssueMDU]>;
143 def GenericWriteALULong : SchedWriteRes<[GenericIssueALU]> { let Latency = 5; }
144 def GenericWriteMove : SchedWriteRes<[GenericIssueALU]> { let Latency = 2; }
145 def GenericWriteMul : SchedWriteRes<[GenericIssueMDU]> { let Latency = 4; }
147 def : InstRW<[GenericWriteHILO], (instrs MADD, MADDU, MSUB, MSUBU)>;
149 def : InstRW<[GenericWriteHILO], (instrs PseudoMADD_MM, PseudoMADDU_MM,
150 PseudoMSUB_MM, PseudoMSUBU_MM,
151 PseudoMULT_MM, PseudoMULTu_MM)>;
153 def : InstRW<[GenericWriteHILO], (instrs PseudoMADD, PseudoMADDU, PseudoMSUB,
154 PseudoMSUBU, PseudoMULT, PseudoMULTu)>;
156 def GenericWriteMDUtoGPR : SchedWriteRes<[GenericIssueMDU]> {
160 def GenericWriteDIV : SchedWriteRes<[GenericIssueDIV]> {
161 // Estimated worst case
163 let ResourceCycles = [33];
165 def GenericWriteDIVU : SchedWriteRes<[GenericIssueDIV]> {
166 // Estimated worst case
168 let ResourceCycles = [31];
172 def : InstRW<[GenericWriteMDUtoGPR], (instrs MUL)>;
175 def : InstRW<[GenericWriteMul], (instrs MULT, MULTu)>;
178 def : InstRW<[GenericWriteDIV], (instrs PseudoSDIV, SDIV)>;
180 def : InstRW<[GenericWriteDIVU], (instrs PseudoUDIV, UDIV)>;
182 // mfhi, mflo, movn, mthi, mtlo, rdwhr
183 def : InstRW<[GenericWriteALULong], (instrs MFHI, MFLO, PseudoMFHI,
186 def : InstRW<[GenericWriteALULong], (instrs PseudoMFHI_MM, PseudoMFLO_MM)>;
188 def : InstRW<[GenericWriteMove], (instrs MTHI, MTLO, RDHWR, PseudoMTLOHI)>;
189 def : InstRW<[GenericWriteMove], (instrs PseudoMTLOHI_MM)>;
191 def : InstRW<[GenericWriteALU], (instrs MOVN_I_I, MOVZ_I_I)>;
196 // muh, muhu, mulu, mul
197 def : InstRW<[GenericWriteMul], (instrs MUH, MUHU, MULU, MUL_R6)>;
200 def : InstRW<[GenericWriteDIV], (instrs MOD, MODU, DIV, DIVU)>;
206 def : InstRW<[GenericWriteHILO], (instrs MultRxRy16, MultuRxRy16,
207 MultRxRyRz16, MultuRxRyRz16)>;
209 def : InstRW<[GenericWriteDIV], (instrs DivRxRy16)>;
211 def : InstRW<[GenericWriteDIVU], (instrs DivuRxRy16)>;
216 def : InstRW<[GenericWriteMul], (instrs MULT_MM, MULTu_MM, MADD_MM, MADDU_MM,
219 def : InstRW<[GenericWriteALULong], (instrs MUL_MM)>;
221 def : InstRW<[GenericWriteDIV], (instrs SDIV_MM, SDIV_MM_Pseudo)>;
223 def : InstRW<[GenericWriteDIVU], (instrs UDIV_MM, UDIV_MM_Pseudo)>;
225 def : InstRW<[GenericWriteMove], (instrs MFHI16_MM, MFLO16_MM, MOVF_I_MM,
226 MOVT_I_MM, MFHI_MM, MFLO_MM, MTHI_MM,
229 def : InstRW<[GenericWriteMove], (instrs RDHWR_MM)>;
234 def : InstRW<[GenericWriteMul], (instrs MUHU_MMR6, MUH_MMR6, MULU_MMR6,
237 def : InstRW<[GenericWriteDIV], (instrs MODU_MMR6, MOD_MMR6, DIVU_MMR6,
240 def : InstRW<[GenericWriteMove], (instrs RDHWR_MMR6)>;
245 def : InstRW<[GenericWriteHILO], (instrs DMULU, DMULT, DMULTu, PseudoDMULT,
248 def : InstRW<[GenericWriteDIV], (instrs DSDIV, PseudoDSDIV)>;
250 def : InstRW<[GenericWriteDIVU], (instrs DUDIV, PseudoDUDIV)>;
252 def : InstRW<[GenericWriteALULong], (instrs MFHI64, MFLO64, PseudoMFHI64,
253 PseudoMFLO64, PseudoMTLOHI64)>;
255 def : InstRW<[GenericWriteMove], (instrs MTHI64, MTLO64, RDHWR64)>;
258 def : InstRW<[GenericWriteALU], (instrs MOVN_I_I64, MOVN_I64_I, MOVN_I64_I64,
259 MOVZ_I_I64, MOVZ_I64_I, MOVZ_I64_I64)>;
265 def : InstRW<[GenericWriteMDUtoGPR], (instrs DMUH, DMUHU, DMUL_R6)>;
267 def : InstRW<[GenericWriteDIV], (instrs DDIV, DMOD)>;
269 def : InstRW<[GenericWriteDIVU], (instrs DDIVU, DMODU)>;
274 def GenericIssueCTISTD : ProcResource<1> { let Super = GenericALU; }
276 def GenericLDST : ProcResource<1> { let BufferSize = 1; }
277 def GenericIssueLDST : ProcResource<1> { let Super = GenericLDST; }
279 def GenericWriteJump : SchedWriteRes<[GenericIssueCTISTD]>;
280 def GenericWriteJumpAndLink : SchedWriteRes<[GenericIssueCTISTD]> {
284 // b, beq, beql, bg[et]z, bl[et]z, bne, bnel, j, syscall, jal, bltzal, jalx,
285 // jalr, jr.hb, jr, jalr.hb, jarlc, jialc
286 def : InstRW<[GenericWriteJump], (instrs B, BAL, BAL_BR, BEQ, BNE, BGTZ, BGEZ,
287 BLEZ, BLTZ, BLTZAL, J, JALX, JR, JR_HB, ERET,
288 ERet, ERETNC, DERET)>;
290 def : InstRW<[GenericWriteJump], (instrs BEQL, BNEL, BGEZL, BGTZL, BLEZL,
293 def : InstRW<[GenericWriteJump], (instrs TAILCALL, TAILCALLREG,
294 TAILCALLREGHB, PseudoIndirectBranch,
295 PseudoIndirectHazardBranch, PseudoReturn,
298 def : InstRW<[GenericWriteJumpAndLink], (instrs BGEZAL, JAL, JALR, JALR_HB,
299 JALRHBPseudo, JALRPseudo)>;
301 def : InstRW<[GenericWriteJumpAndLink], (instrs BGEZALL, BLTZALL)>;
303 def GenericWriteTrap : SchedWriteRes<[GenericIssueCTISTD]>;
305 def : InstRW<[GenericWriteTrap], (instrs BREAK, SYSCALL, TEQ, TEQI,
306 TGE, TGEI, TGEIU, TGEU, TNE,
307 TNEI, TLT, TLTI, TLTU, TTLTIU,
313 def : InstRW<[GenericWriteJumpAndLink], (instrs BALC, BEQZALC, BGEZALC,
314 BGTZALC, BLEZALC, BLTZALC,
318 def : InstRW<[GenericWriteJump], (instrs BC, BC2EQZ, BC2NEZ, BEQC, BEQZC, BGEC,
319 BGEUC, BGEZC, BGTZC, BLEZC, BLTC, BLTUC,
320 BLTZC, BNEC, BNEZC, BNVC, BOVC, JIC, JR_HB_R6,
321 SIGRIE, PseudoIndirectBranchR6,
322 PseudoIndrectHazardBranchR6)>;
324 def : InstRW<[GenericWriteJump], (instrs TAILCALLR6REG, TAILCALLHBR6REG)>;
326 def : InstRW<[GenericWriteTrap], (instrs SDBBP_R6)>;
331 def : InstRW<[GenericWriteJump], (instrs Bimm16, BimmX16, BeqzRxImm16,
332 BeqzRxImmX16, BnezRxImm16, BnezRxImmX16,
333 Bteqz16, BteqzX16, BteqzT8CmpX16,
334 BteqzT8CmpiX16, BteqzT8SltX16,
335 BteqzT8SltuX16, BteqzT8SltiX16,
336 BteqzT8SltiuX16, Btnez16, BtnezX16,
337 BtnezT8CmpX16, BtnezT8CmpiX16,
338 BtnezT8SltX16, BtnezT8SltuX16,
339 BtnezT8SltiX16, BtnezT8SltiuX16, JrRa16,
340 JrcRa16, JrcRx16, RetRA16)>;
342 def : InstRW<[GenericWriteJumpAndLink], (instrs Jal16, JalB16, JumpLinkReg16)>;
344 def : InstRW<[GenericWriteTrap], (instrs Break16)>;
346 def : InstRW<[GenericWriteALULong], (instrs SelBeqZ, SelTBteqZCmp,
347 SelTBteqZCmpi, SelTBteqZSlt,
348 SelTBteqZSlti, SelTBteqZSltu,
349 SelTBteqZSltiu, SelBneZ, SelTBtneZCmp,
350 SelTBtneZCmpi, SelTBtneZSlt,
351 SelTBtneZSlti, SelTBtneZSltu,
357 def : InstRW<[GenericWriteJump], (instrs B16_MM, BAL_BR_MM, BC1F_MM, BC1T_MM,
358 BEQZ16_MM, BEQZC_MM, BEQ_MM, BGEZ_MM,
359 BGTZ_MM, BLEZ_MM, BLTZ_MM, BNEZ16_MM,
360 BNEZC_MM, BNE_MM, B_MM, DERET_MM, ERET_MM,
361 JR16_MM, JR_MM, J_MM, B_MM_Pseudo)>;
363 def : InstRW<[GenericWriteJumpAndLink], (instrs BGEZALS_MM, BGEZAL_MM,
364 BLTZALS_MM, BLTZAL_MM, JALR16_MM,
365 JALRS16_MM, JALRS_MM, JALR_MM,
366 JALS_MM, JALX_MM, JAL_MM)>;
368 def : InstRW<[GenericWriteJump], (instrs TAILCALLREG_MM, TAILCALL_MM,
369 PseudoIndirectBranch_MM)>;
371 def : InstRW<[GenericWriteTrap], (instrs BREAK16_MM, BREAK_MM, SDBBP16_MM,
372 SDBBP_MM, SYSCALL_MM, TEQI_MM, TEQ_MM,
373 TGEIU_MM, TGEI_MM, TGEU_MM, TGE_MM, TLTIU_MM,
374 TLTI_MM, TLTU_MM, TLT_MM, TNEI_MM, TNE_MM,
380 def : InstRW<[GenericWriteJump], (instrs BC16_MMR6, BC1EQZC_MMR6, BC1NEZC_MMR6,
381 BC2EQZC_MMR6, BC2NEZC_MMR6, BC_MMR6,
382 BEQC_MMR6, BEQZC16_MMR6, BEQZC_MMR6,
383 BGEC_MMR6, BGEUC_MMR6, BGEZC_MMR6,
384 BGTZC_MMR6, BLEZC_MMR6, BLTC_MMR6,
385 BLTUC_MMR6, BLTZC_MMR6, BNEC_MMR6,
386 BNEZC16_MMR6, BNEZC_MMR6, BNVC_MMR6,
387 BOVC_MMR6, DERET_MMR6, ERETNC_MMR6, JAL_MMR6,
388 ERET_MMR6, JIC_MMR6, JRADDIUSP, JRC16_MM,
389 JRC16_MMR6, JRCADDIUSP_MMR6, SIGRIE_MMR6,
390 B_MMR6_Pseudo, PseudoIndirectBranch_MMR6)>;
392 def : InstRW<[GenericWriteJumpAndLink], (instrs BALC_MMR6, BEQZALC_MMR6,
393 BGEZALC_MMR6, BGTZALC_MMR6,
394 BLEZALC_MMR6, BLTZALC_MMR6,
395 BNEZALC_MMR6, JALRC16_MMR6,
396 JALRC_HB_MMR6, JALRC_MMR6,
399 def : InstRW<[GenericWriteJump], (instrs TAILCALLREG_MMR6, TAILCALL_MMR6)>;
401 def : InstRW<[GenericWriteTrap], (instrs BREAK16_MMR6, BREAK_MMR6, SDBBP_MMR6,
407 def : InstRW<[GenericWriteJump], (instrs BEQ64, BGEZ64, BGTZ64, BLEZ64,
408 BLTZ64, BNE64, JR64)>;
410 def : InstRW<[GenericWriteJumpAndLink], (instrs JALR64, JALR64Pseudo,
411 JALRHB64Pseudo, JALR_HB64)>;
413 def : InstRW<[GenericWriteJump], (instrs JR_HB64, TAILCALLREG64,
414 TAILCALLREGHB64, PseudoReturn64)>;
419 def : InstRW<[GenericWriteJump], (instrs BEQC64, BEQZC64, BGEC64, BGEUC64,
420 BGEZC64, BGTZC64, BLEZC64, BLTC64, BLTUC64,
421 BLTZC64, BNEC64, BNEZC64, JIC64,
422 PseudoIndirectBranch64,
423 PseudoIndirectHazardBranch64)>;
425 def : InstRW<[GenericWriteJumpAndLink], (instrs JIALC64)>;
427 def : InstRW<[GenericWriteJump], (instrs JR_HB64_R6, TAILCALL64R6REG,
428 TAILCALLHB64R6REG, PseudoIndirectBranch64R6,
429 PseudoIndrectHazardBranch64R6)>;
434 def GenericCOP0 : ProcResource<1> { let BufferSize = 1; }
436 def GenericIssueCOP0 : ProcResource<1> { let Super = GenericCOP0; }
437 def GenericWriteCOP0TLB : SchedWriteRes<[GenericIssueCOP0]> { let Latency = 4; }
438 def GenericWriteCOP0 : SchedWriteRes<[GenericIssueCOP0]> { let Latency = 3; }
439 def GenericReadCOP0 : SchedWriteRes<[GenericIssueCOP0]> { let Latency = 2; }
440 def GenericReadWritePGPR : SchedWriteRes<[GenericIssueCOP0]>;
441 def GenericReadWriteCOP0Long : SchedWriteRes<[GenericIssueCOP0]> {
444 def GenericWriteCOP0Short : SchedWriteRes<[GenericIssueCOP0]>;
446 def : InstRW<[GenericWriteCOP0TLB], (instrs TLBP, TLBR, TLBWI, TLBWR)>;
447 def : InstRW<[GenericWriteCOP0TLB], (instrs TLBINV, TLBINVF)>;
449 def : InstRW<[GenericReadCOP0], (instrs MFC0)>;
450 def : InstRW<[GenericWriteCOP0], (instrs MTC0)>;
452 def : InstRW<[GenericWriteCOP0], (instrs EVP, DVP)>;
454 def : InstRW<[GenericWriteCOP0], (instrs DI, EI)>;
456 def : InstRW<[GenericWriteCOP0], (instrs EHB, PAUSE, WAIT)>;
461 def : InstRW<[GenericWriteCOP0TLB], (instrs TLBP_MM, TLBR_MM, TLBWI_MM,
464 def : InstRW<[GenericWriteCOP0], (instrs DI_MM, EI_MM)>;
466 def : InstRW<[GenericWriteCOP0], (instrs EHB_MM, PAUSE_MM, WAIT_MM)>;
472 def : InstRW<[GenericWriteCOP0], (instrs RDPGPR_MMR6, WRPGPR_MMR6)>;
474 def : InstRW<[GenericWriteCOP0TLB], (instrs TLBINV_MMR6, TLBINVF_MMR6)>;
476 def : InstRW<[GenericReadCOP0], (instrs MFHC0_MMR6, MFC0_MMR6, MFHC2_MMR6,
479 def : InstRW<[GenericWriteCOP0], (instrs MTHC0_MMR6, MTC0_MMR6, MTHC2_MMR6,
482 def : InstRW<[GenericWriteCOP0], (instrs EVP_MMR6, DVP_MMR6)>;
484 def : InstRW<[GenericWriteCOP0], (instrs DI_MMR6, EI_MMR6)>;
486 def : InstRW<[GenericWriteCOP0], (instrs EHB_MMR6, PAUSE_MMR6, WAIT_MMR6)>;
491 def : InstRW<[GenericReadCOP0], (instrs DMFC0)>;
493 def : InstRW<[GenericWriteCOP0], (instrs DMTC0)>;
496 def GenericCOP2 : ProcResource<1> { let BufferSize = 1; }
497 def GenericWriteCOPOther : SchedWriteRes<[GenericCOP2]>;
499 def : InstRW<[GenericWriteCOPOther], (instrs MFC2, MTC2)>;
501 def : InstRW<[GenericWriteCOPOther], (instrs DMFC2, DMTC2)>;
506 // The latency and repeat rate of these instructions are implementation
508 def : InstRW<[GenericWriteMove], (instrs CFC2_MM, CTC2_MM)>;
511 // MIPS MT ASE - hasMT
512 // ====================
514 def : InstRW<[GenericWriteMove], (instrs DMT, DVPE, EMT, EVPE, MFTR,
517 def : InstRW<[GenericReadWriteCOP0Long], (instrs YIELD)>;
519 def : InstRW<[GenericWriteCOP0Short], (instrs FORK)>;
521 // MIPS Virtualization ASE
522 // =======================
524 def : InstRW<[GenericWriteCOP0Short], (instrs HYPCALL, TLBGINV, TLBGINVF, TLBGP,
525 TLBGR, TLBGWI, TLBGWR, MFGC0, MFHGC0,
528 // MIPS64 Virtualization ASE
529 // =========================
531 def : InstRW<[GenericWriteCOP0Short], (instrs DMFGC0, DMTGC0)>;
533 // microMIPS virtualization ASE
534 // ============================
536 def : InstRW<[GenericWriteCOP0Short], (instrs HYPCALL_MM, TLBGINVF_MM,
537 TLBGINV_MM, TLBGP_MM, TLBGR_MM,
538 TLBGWI_MM, TLBGWR_MM, MFGC0_MM,
539 MFHGC0_MM, MTGC0_MM, MTHGC0_MM)>;
544 def GenericWriteLoad : SchedWriteRes<[GenericIssueLDST]> {
548 def GenericWritePref : SchedWriteRes<[GenericIssueLDST]>;
549 def GenericWriteSync : SchedWriteRes<[GenericIssueLDST]>;
550 def GenericWriteCache : SchedWriteRes<[GenericIssueLDST]> { let Latency = 5; }
552 def GenericWriteStore : SchedWriteRes<[GenericIssueLDST]>;
553 def GenericWriteStoreSC : SchedWriteRes<[GenericIssueLDST]> { let Latency = 2; }
555 def GenericWriteGPRFromBypass : SchedWriteRes<[GenericIssueLDST]> {
559 def GenericWriteStoreFromOtherUnits : SchedWriteRes<[GenericIssueLDST]>;
560 def GenericWriteLoadToOtherUnits : SchedWriteRes<[GenericIssueLDST]> {
564 // l[bhw], l[bh]u, ll
565 def : InstRW<[GenericWriteLoad], (instrs LB, LBu, LH, LHu, LW, LL,
566 LWC2, LWC3, LDC2, LDC3)>;
569 def : InstRW<[GenericWriteLoad], (instrs LWL, LWR)>;
571 // s[bhw], sc, s[dw]c[23]
572 def : InstRW<[GenericWriteStore], (instrs SB, SH, SW, SWC2, SWC3,
576 def : InstRW<[GenericWriteStore], (instrs SWL, SWR)>;
578 def : InstRW<[GenericWriteStoreSC], (instrs SC, SC_MMR6)>;
581 def : InstRW<[GenericWritePref], (instrs PREF)>;
583 def : InstRW<[GenericWriteCache], (instrs CACHE)>;
586 def : InstRW<[GenericWriteSync], (instrs SYNC, SYNCI)>;
591 def : InstRW<[GenericWriteLoad], (instrs LDC2_R6, LL_R6, LWC2_R6, LWPC)>;
593 def : InstRW<[GenericWriteStore], (instrs SWC2_R6, SDC2_R6)>;
595 def : InstRW<[GenericWriteStoreSC], (instrs SC_R6)>;
597 def : InstRW<[GenericWritePref], (instrs PREF_R6)>;
599 def : InstRW<[GenericWriteCache], (instrs CACHE_R6)>;
601 def : InstRW<[GenericWriteSync], (instrs GINVI, GINVT)>;
606 def : InstRW<[GenericWriteLoad], (instrs LBE, LBuE, LHE, LHuE, LWE,
609 def : InstRW<[GenericWriteStore], (instrs SBE, SHE, SWE, SCE)>;
611 def : InstRW<[GenericWriteLoad], (instrs LWLE, LWRE)>;
613 def : InstRW<[GenericWriteStore], (instrs SWLE, SWRE)>;
615 def : InstRW<[GenericWritePref], (instrs PREFE)>;
617 def : InstRW<[GenericWriteCache], (instrs CACHEE)>;
619 // microMIPS EVA ASE - InMicroMipsMode, hasEVA
620 // ===========================================
622 def : InstRW<[GenericWriteLoad], (instrs LBE_MM, LBuE_MM, LHE_MM, LHuE_MM,
623 LWE_MM, LWLE_MM, LWRE_MM, LLE_MM)>;
625 def : InstRW<[GenericWriteStore], (instrs SBE_MM, SB_MM, SHE_MM, SWE_MM,
626 SWLE_MM, SWRE_MM, SCE_MM)>;
628 def : InstRW<[GenericWritePref], (instrs PREFE_MM)>;
629 def : InstRW<[GenericWriteCache], (instrs CACHEE_MM)>;
635 def : InstRW<[GenericWriteLoad], (instrs Restore16, RestoreX16,
637 LbuRxRyOffMemX16, LhRxRyOffMemX16,
638 LhuRxRyOffMemX16, LwRxRyOffMemX16,
639 LwRxSpImmX16, LwRxPcTcp16, LwRxPcTcpX16)>;
641 def : InstRW<[GenericWriteStore], (instrs Save16, SaveX16, SbRxRyOffMemX16,
642 ShRxRyOffMemX16, SwRxRyOffMemX16,
648 def : InstRW<[GenericWriteLoad], (instrs LBU16_MM, LB_MM, LBu_MM, LHU16_MM,
649 LH_MM, LHu_MM, LL_MM, LW16_MM, LWGP_MM,
650 LWL_MM, LWM16_MM, LWM32_MM, LWP_MM, LWR_MM,
651 LWSP_MM, LWU_MM, LWXS_MM, LW_MM)>;
653 def : InstRW<[GenericWriteStore], (instrs SB16_MM, SC_MM, SH16_MM, SH_MM,
654 SW16_MM, SWL_MM, SWM16_MM, SWM32_MM, SWM_MM,
655 SWP_MM, SWR_MM, SWSP_MM, SW_MM)>;
658 def : InstRW<[GenericWritePref], (instrs PREF_MM, PREFX_MM)>;
660 def : InstRW<[GenericWriteCache], (instrs CACHE_MM)>;
662 def : InstRW<[GenericWriteSync], (instrs SYNC_MM, SYNCI_MM)>;
663 def : InstRW<[GenericWriteSync], (instrs GINVI_MMR6, GINVT_MMR6)>;
668 def : InstRW<[GenericWriteLoad], (instrs LBU_MMR6, LB_MMR6, LDC2_MMR6, LL_MMR6,
669 LWM16_MMR6, LWC2_MMR6, LWPC_MMR6, LW_MMR6)>;
671 def : InstRW<[GenericWriteStore], (instrs SB16_MMR6, SB_MMR6, SDC2_MMR6,
672 SH16_MMR6, SH_MMR6, SW16_MMR6, SWC2_MMR6,
673 SWM16_MMR6, SWSP_MMR6, SW_MMR6)>;
675 def : InstRW<[GenericWriteSync], (instrs SYNC_MMR6, SYNCI_MMR6)>;
677 def : InstRW<[GenericWritePref], (instrs PREF_MMR6)>;
679 def : InstRW<[GenericWriteCache], (instrs CACHE_MMR6)>;
684 def : InstRW<[GenericWriteLoad], (instrs LD, LL64, LLD, LWu, LB64, LBu64,
688 def : InstRW<[GenericWriteLoad], (instrs LWL64, LWR64, LDL, LDR)>;
690 def : InstRW<[GenericWriteStore], (instrs SD, SC64, SCD, SB64, SH64, SW64,
693 def : InstRW<[GenericWriteStore], (instrs SDL, SDR)>;
698 def : InstRW<[GenericWriteLoad], (instrs LWUPC, LDPC)>;
700 def : InstRW<[GenericWriteLoad], (instrs LLD_R6, LL64_R6)>;
702 def : InstRW<[GenericWriteStoreSC], (instrs SC64_R6, SCD_R6)>;
704 // MIPSR6 CRC ASE - hasCRC
705 // =======================
707 def : InstRW<[GenericWriteALU], (instrs CRC32B, CRC32H, CRC32W, CRC32CB,
710 // MIPS64R6 CRC ASE - hasCRC
711 // -------------------------
713 def : InstRW<[GenericWriteALU], (instrs CRC32D, CRC32CD)>;
716 // Cavium Networks MIPS (cnMIPS) - Octeon, HasCnMips
717 // =================================================
719 def : InstRW<[GenericWriteALU], (instrs BADDu, BBIT0, BBIT032, BBIT1, BBIT132,
720 CINS, CINS32, CINS64_32, CINS_i32,
721 DMFC2_OCTEON, DMTC2_OCTEON, DPOP, EXTS,
722 EXTS32, MTM0, MTM1, MTM2, MTP0, MTP1, MTP2,
723 POP, SEQ, SEQi, SNE, SNEi, V3MULU, VMM0,
726 def : InstRW<[GenericWriteMDUtoGPR], (instrs DMUL)>;
731 def GenericFPQ : ProcResource<1> { let BufferSize = 1; }
732 def GenericIssueFPUS : ProcResource<1> { let Super = GenericFPQ; }
733 def GenericIssueFPUL : ProcResource<1> { let Super = GenericFPQ; }
734 def GenericIssueFPULoad : ProcResource<1> { let Super = GenericFPQ; }
735 def GenericIssueFPUStore : ProcResource<1> { let Super = GenericFPQ; }
736 def GenericIssueFPUMove : ProcResource<1> { let Super = GenericFPQ; }
737 def GenericFPUDivSqrt : ProcResource<1> { let Super = GenericFPQ; }
739 // The floating point compare of the 24k series including interAptiv has a
740 // listed latency of 1-2. Using the higher latency here.
742 def GenericWriteFPUCmp : SchedWriteRes<[GenericIssueFPUS]> { let Latency = 2; }
743 def GenericWriteFPUS : SchedWriteRes<[GenericIssueFPUS]> { let Latency = 4; }
744 def GenericWriteFPUL : SchedWriteRes<[GenericIssueFPUL]> { let Latency = 5; }
745 def GenericWriteFPUStore : SchedWriteRes<[GenericIssueFPUStore]> { let
748 def GenericWriteFPULoad : SchedWriteRes<[GenericIssueFPULoad]> {
751 def GenericWriteFPUMoveFP : SchedWriteRes<[GenericIssueFPUMove]> {
754 def GenericWriteFPUMoveGPRFPU : SchedWriteRes<[GenericIssueFPUMove]> {
757 def GenericWriteFPUDivS : SchedWriteRes<[GenericFPUDivSqrt]> {
759 let ResourceCycles = [ 14 ];
761 def GenericWriteFPUDivD : SchedWriteRes<[GenericFPUDivSqrt]> {
763 let ResourceCycles = [ 29 ];
765 def GenericWriteFPURcpS : SchedWriteRes<[GenericFPUDivSqrt]> {
767 let ResourceCycles = [ 10 ];
769 def GenericWriteFPURcpD : SchedWriteRes<[GenericFPUDivSqrt]> {
771 let ResourceCycles = [ 21 ];
773 def GenericWriteFPURsqrtS : SchedWriteRes<[GenericFPUDivSqrt]> {
775 let ResourceCycles = [ 14 ];
777 def GenericWriteFPURsqrtD : SchedWriteRes<[GenericFPUDivSqrt]> {
779 let ResourceCycles = [ 29 ];
781 def GenericWriteFPUSqrtS : SchedWriteRes<[GenericFPUDivSqrt]> {
783 let ResourceCycles = [ 14 ];
785 def GenericWriteFPUSqrtD : SchedWriteRes<[GenericFPUDivSqrt]> {
787 let ResourceCycles = [ 29 ];
790 // Floating point compare and branch
791 // ---------------------------------
793 // c.<cc>.[ds], bc1[tf], bc1[tf]l
794 def : InstRW<[GenericWriteFPUCmp], (instrs FCMP_D32, FCMP_D64, FCMP_S32, BC1F,
795 BC1T, BC1FL, BC1TL)>;
797 def : InstRW<[GenericWriteFPUCmp], (instregex "C_[A-Z]+_(S|D32|D64)$")>;
802 // abs.[ds], abs.ps, add.[ds], neg.[ds], neg.ps, madd.s, msub.s, nmadd,s
803 // nmsub.s, sub.[ds], mul.s
805 def : InstRW<[GenericWriteFPUS], (instrs FABS_S, FABS_D32, FABS_D64, FADD_D32,
806 FADD_D64, FADD_S, MADD_S, MSUB_S, FMUL_S,
807 FNEG_S, FNEG_D32, FNEG_D64, NMADD_S, NMSUB_S,
808 FSUB_S, FSUB_D32, FSUB_D64)>;
813 // nmadd.d, nmsub.d, mul.[ds], mul.ps, ceil.[wl].[sd], cvt.d.[sw], cvt.s.[dw],
814 // cvt.w.[sd], cvt.[sw].ps, trunc.w.[ds], trunc.w.ps, floor.[ds],
815 // round.[lw].[ds], floor.[lw].ds
817 // madd.d, msub.dm mul.d, mul.ps, nmadd.d, nmsub.d, ceil.[wl].[sd], cvt.d.[sw],
818 // cvt.s.[dw], cvt.w.[sd], cvt.[sw].ps, round.[lw].[ds], floor.[lw].ds,
819 // trunc.w.[ds], trunc.w.ps,
820 def : InstRW<[GenericWriteFPUL], (instrs CEIL_L_D64, CEIL_L_S, CEIL_W_D32,
821 CEIL_W_D64, CEIL_W_S, CVT_D32_S, CVT_D32_W,
822 CVT_D64_L, CVT_D64_S, CVT_D64_W, CVT_L_D64,
823 CVT_L_S, CVT_S_D32, CVT_S_D64, CVT_S_L,
824 CVT_S_W, CVT_W_D32, CVT_W_D64, CVT_W_S,
825 CVT_PS_S64, CVT_S_PL64, CVT_S_PU64,
826 FLOOR_L_D64, FLOOR_L_S, FLOOR_W_D32,
827 FLOOR_W_D64, FLOOR_W_S, FMUL_D32, FMUL_D64,
828 MADD_D32, MADD_D64, MSUB_D32, MSUB_D64,
829 NMADD_D32, NMADD_D64, NMSUB_D32, NMSUB_D64,
831 ROUND_L_D64, ROUND_L_S, ROUND_W_D32,
832 ROUND_W_D64, ROUND_W_S, TRUNC_L_D64,
833 TRUNC_L_S, TRUNC_W_D32, TRUNC_W_D64,
834 TRUNC_W_S, PseudoTRUNC_W_D,
835 PseudoTRUNC_W_D32, PseudoTRUNC_W_S)>;
837 // Pseudo convert instruction
838 def : InstRW<[GenericWriteFPUL], (instrs PseudoCVT_D32_W, PseudoCVT_D64_L,
839 PseudoCVT_D64_W, PseudoCVT_S_L,
843 def : InstRW<[GenericWriteFPUDivS], (instrs FDIV_S)>;
844 def : InstRW<[GenericWriteFPUDivD], (instrs FDIV_D32, FDIV_D64)>;
846 // sqrt.[ds], sqrt.ps
847 def : InstRW<[GenericWriteFPUSqrtS], (instrs FSQRT_S)>;
848 def : InstRW<[GenericWriteFPUSqrtD], (instrs FSQRT_D32, FSQRT_D64)>;
850 // rsqrt.[ds], recip.[ds]
851 def : InstRW<[GenericWriteFPURcpS], (instrs RECIP_S, RSQRT_S)>;
852 def : InstRW<[GenericWriteFPURcpD], (instrs RECIP_D32, RECIP_D64,
853 RSQRT_D32, RSQRT_D64)>;
859 // ctc1, mtc1, mthc1, cfc1, mfc1, mfhc1
860 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instrs BuildPairF64,
861 BuildPairF64_64, ExtractElementF64,
862 ExtractElementF64_64, CFC1, CTC1,
863 MFC1, MFC1_D64, MFHC1_D32,
864 MFHC1_D64, MTC1, MTC1_D64,
865 MTHC1_D32, MTHC1_D64)>;
868 def : InstRW<[GenericWriteFPUStore], (instrs SDC1, SDC164, SDXC1, SDXC164,
869 SUXC1, SUXC164, SWC1, SWXC1)>;
871 def : InstRW<[GenericWriteFPUMoveFP], (instrs FMOV_D32, FMOV_D64, FMOV_S)>;
874 // movn.[ds], movz.[ds]
875 def : InstRW<[GenericWriteFPUMoveFP], (instrs MOVF_I, MOVF_D32, MOVF_D64,
876 MOVF_S, MOVT_I, MOVT_D32, MOVT_D64,
877 MOVT_S, MOVN_I_D32, MOVN_I_D64,
878 MOVN_I_S, MOVZ_I_D32, MOVZ_I_D64,
881 def : InstRW<[GenericWriteFPUMoveFP], (instrs MOVT_I64, MOVF_I64, MOVZ_I64_S,
882 MOVN_I64_D64, MOVN_I64_S,
886 def : InstRW<[GenericWriteFPULoad], (instrs LDC1, LDC164, LDXC1, LDXC164,
887 LUXC1, LUXC164, LWC1, LWXC1)>;
892 // sel(eq|ne).[ds], max.[ds], maxa.[ds], min.[ds], mina.[ds], class.[ds]
893 def : InstRW<[GenericWriteFPUS], (instrs SELEQZ_S, SELNEZ_S, SELEQZ_D, SELNEZ_D,
894 MAX_S, MAX_D, MAXA_S, MAXA_D, MIN_S, MIN_D,
895 MINA_S, MINA_D, CLASS_S, CLASS_D)>;
897 def : InstRW<[GenericWriteFPUL], (instrs RINT_S, RINT_D)>;
899 def : InstRW<[GenericWriteFPUCmp], (instrs BC1EQZ, BC1NEZ, SEL_D, SEL_S)>;
901 def : InstRW<[GenericWriteFPUS], (instrs MADDF_S, MSUBF_S, MADDF_D, MSUBF_D)>;
907 def : InstRW<[GenericWriteFPUMoveFP], (instrs MOVF_D32_MM, MOVF_S_MM,
908 MOVN_I_D32_MM, MOVN_I_S_MM,
909 MOVT_D32_MM, MOVT_S_MM, MOVZ_I_D32_MM,
913 // cvt.?.?, ceil.?, floor.?, round.?, trunc.? (n)madd.? (n)msub.?
914 def : InstRW<[GenericWriteFPUL], (instrs CVT_D32_S_MM, CVT_D32_W_MM,
915 CVT_D64_S_MM, CVT_D64_W_MM, CVT_L_D64_MM,
916 CVT_L_S_MM, CVT_S_D32_MM, CVT_S_D64_MM,
917 CVT_S_W_MM, CVT_W_D32_MM, CVT_W_D64_MM,
918 CVT_W_S_MM, CEIL_W_MM, CEIL_W_S_MM,
919 FLOOR_W_MM, FLOOR_W_S_MM, NMADD_S_MM,
920 NMADD_D32_MM, NMSUB_S_MM, NMSUB_D32_MM,
921 MADD_S_MM, MADD_D32_MM, ROUND_W_MM,
922 ROUND_W_S_MM, TRUNC_W_MM, TRUNC_W_S_MM)>;
924 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_[A-Z]_(S|D32|D64)_MM$")>;
925 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_[A-Z][A-Z]_(S|D32|D64)_MM$")>;
926 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_[A-Z][A-Z][A-Z]_(S|D32|D64)_MM$")>;
927 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_NGLE_(S|D32|D64)_MM$")>;
928 def : InstRW<[GenericWriteFPUCmp], (instrs FCMP_S32_MM, FCMP_D32_MM)>;
930 def : InstRW<[GenericWriteFPUS], (instrs MFC1_MM, MFHC1_D32_MM, MFHC1_D64_MM,
931 MTC1_MM, MTC1_D64_MM,
932 MTHC1_D32_MM, MTHC1_D64_MM)>;
934 def : InstRW<[GenericWriteFPUS], (instrs FABS_D32_MM, FABS_D64_MM, FABS_S_MM,
935 FNEG_D32_MM, FNEG_D64_MM, FNEG_S_MM,
936 FADD_D32_MM, FADD_D64_MM, FADD_S_MM,
937 FMOV_D32_MM, FMOV_D64_MM, FMOV_S_MM,
938 FMUL_D32_MM, FMUL_D64_MM, FMUL_S_MM,
939 FSUB_D32_MM, FSUB_D64_MM, FSUB_S_MM,
940 MSUB_S_MM, MSUB_D32_MM)>;
942 def : InstRW<[GenericWriteFPUDivS], (instrs FDIV_S_MM)>;
943 def : InstRW<[GenericWriteFPUDivD], (instrs FDIV_D32_MM, FDIV_D64_MM)>;
945 def : InstRW<[GenericWriteFPUSqrtS], (instrs FSQRT_S_MM)>;
946 def : InstRW<[GenericWriteFPUSqrtD], (instrs FSQRT_D32_MM, FSQRT_D64_MM)>;
948 def : InstRW<[GenericWriteFPURcpS], (instrs RECIP_S_MM, RSQRT_S_MM)>;
949 def : InstRW<[GenericWriteFPURcpD], (instrs RECIP_D32_MM, RECIP_D64_MM,
950 RSQRT_D32_MM, RSQRT_D64_MM)>;
952 def : InstRW<[GenericWriteFPUStore], (instrs SDC1_MM, SWC1_MM, SUXC1_MM,
955 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instrs CFC1_MM, CTC1_MM)>;
957 def : InstRW<[GenericWriteFPULoad], (instrs LDC1_MM, LUXC1_MM, LWC1_MM,
963 def : InstRW<[GenericWriteFPUS], (instrs FNEG_S_MMR6)>;
965 def : InstRW<[GenericWriteFPUCmp], (instregex "CMP_[A-Z][A-Z]_(S|D)_MMR6")>;
966 def : InstRW<[GenericWriteFPUCmp],
967 (instregex "CMP_[A-Z][A-Z][A-Z]_(S|D)_MMR6")>;
968 def : InstRW<[GenericWriteFPUCmp],
969 (instregex "CMP_[A-Z][A-Z][A-Z][A-Z]_(S|D)_MMR6")>;
971 def : InstRW<[GenericWriteFPUL],
972 (instregex "CVT_(L|D|S|W)_(L|D|S|L|W)_MMR6")>;
974 def : InstRW<[GenericWriteFPUL],
975 (instregex "TRUNC_(L|W)_(D|S)_MMR6")>;
977 def : InstRW<[GenericWriteFPUL],
978 (instregex "ROUND_(L|W)_(D|S)_MMR6")>;
980 def : InstRW<[GenericWriteFPUL],
981 (instregex "FLOOR_(L|W)_(D|S)_MMR6")>;
983 def : InstRW<[GenericWriteFPUL],
984 (instregex "CEIL_(L|W)_(S|D)_MMR6")>;
986 def : InstRW<[GenericWriteFPUS],
987 (instrs MFC1_MMR6, MTC1_MMR6, CLASS_S_MMR6, CLASS_D_MMR6,
990 def : InstRW<[GenericWriteFPUS], (instregex "M(IN|AX)_(S|D)_MMR6")>;
992 def : InstRW<[GenericWriteFPUS], (instregex "M(IN|AX)A_(S|D)_MMR6")>;
994 def : InstRW<[GenericWriteFPUS], (instregex "SEL(EQ|NE)Z_(S|D)_MMR6")>;
996 def : InstRW<[GenericWriteFPUS], (instregex "SEL_(S|D)_MMR6")>;
998 def : InstRW<[GenericWriteFPUL], (instrs RINT_S_MMR6, RINT_D_MMR6)>;
1000 def : InstRW<[GenericWriteFPUS], (instregex "M(ADD|SUB)F_(S|D)_MMR6")>;
1002 def : InstRW<[GenericWriteFPUS], (instrs FMOV_S_MMR6, FMUL_S_MMR6,
1003 FSUB_S_MMR6, FMOV_D_MMR6)>;
1005 def : InstRW<[GenericWriteFPUL], (instrs FDIV_S_MMR6)>;
1007 def : InstRW<[GenericWriteFPUStore], (instrs SDC1_D64_MMR6)>;
1009 def : InstRW<[GenericWriteFPULoad], (instrs LDC1_D64_MMR6)>;
1014 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instrs DMFC1, DMTC1)>;
1016 // MIPS DSP ASE, HasDSP
1017 // ====================
1019 def : InstRW<[GenericWriteStore], (instrs SWDSP)>;
1021 def : InstRW<[GenericWriteLoad], (instrs LWDSP)>;
1023 def : InstRW<[GenericWriteMove], (instrs PseudoMTLOHI_DSP)>;
1025 def GenericDSP : ProcResource<1> { let BufferSize = 1; }
1026 def GenericDSPShort : SchedWriteRes<[GenericDSP]> { let Latency = 2; }
1027 def GenericDSPLong : SchedWriteRes<[GenericDSP]> { let Latency = 6; }
1028 def GenericDSPBypass : SchedWriteRes<[GenericDSP]> { let Latency = 1; }
1029 def GenericDSPMTHILO : SchedWriteRes<[GenericDSP]> { let Latency = 5; }
1030 def GenericDSPLoad : SchedWriteRes<[GenericDSP]> { let Latency = 4; }
1031 def GenericDSPMTHLIP : SchedWriteRes<[GenericDSP]> { let Latency = 5; }
1033 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_RS_W$")>;
1034 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_R_W$")>;
1035 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_S_H$")>;
1036 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_W$")>;
1037 def : InstRW<[GenericDSPLong], (instregex "^EXTR_RS_W$")>;
1038 def : InstRW<[GenericDSPLong], (instregex "^EXTR_R_W$")>;
1039 def : InstRW<[GenericDSPLong], (instregex "^EXTR_S_H$")>;
1040 def : InstRW<[GenericDSPLong], (instregex "^EXTR_W$")>;
1041 def : InstRW<[GenericDSPLong], (instregex "^INSV$")>;
1043 def : InstRW<[GenericDSPMTHLIP], (instregex "^MTHLIP$")>;
1044 def : InstRW<[GenericDSPMTHILO], (instregex "^MTHI_DSP$")>;
1045 def : InstRW<[GenericDSPMTHILO], (instregex "^MTLO_DSP$")>;
1047 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_PH$")>;
1048 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_W$")>;
1049 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_PH$")>;
1050 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_PH$")>;
1051 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_W$")>;
1052 def : InstRW<[GenericDSPShort], (instregex "^ADDSC$")>;
1053 def : InstRW<[GenericDSPShort], (instregex "^ADDU_QB$")>;
1054 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_QB$")>;
1055 def : InstRW<[GenericDSPShort], (instregex "^ADDWC$")>;
1056 def : InstRW<[GenericDSPShort], (instregex "^BITREV$")>;
1057 def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32$")>;
1058 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_EQ_QB$")>;
1059 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LE_QB$")>;
1060 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LT_QB$")>;
1061 def : InstRW<[GenericDSPShort], (instregex "^CMPU_EQ_QB$")>;
1062 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LE_QB$")>;
1063 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LT_QB$")>;
1064 def : InstRW<[GenericDSPShort], (instregex "^CMP_EQ_PH$")>;
1065 def : InstRW<[GenericDSPShort], (instregex "^CMP_LE_PH$")>;
1066 def : InstRW<[GenericDSPShort], (instregex "^CMP_LT_PH$")>;
1067 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_SA_L_W$")>;
1068 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_S_W_PH$")>;
1069 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBL$")>;
1070 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBR$")>;
1071 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_SA_L_W$")>;
1072 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_S_W_PH$")>;
1073 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBL$")>;
1074 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBR$")>;
1075 def : InstRW<[GenericDSPShort], (instregex "^EXTPDPV$")>;
1076 def : InstRW<[GenericDSPShort], (instregex "^EXTPDP$")>;
1077 def : InstRW<[GenericDSPShort], (instregex "^EXTPV$")>;
1078 def : InstRW<[GenericDSPShort], (instregex "^EXTP$")>;
1079 def : InstRW<[GenericDSPShort], (instregex "^LBUX$")>;
1080 def : InstRW<[GenericDSPShort], (instregex "^LHX$")>;
1081 def : InstRW<[GenericDSPShort], (instregex "^LWX$")>;
1082 def : InstRW<[GenericDSPShort], (instregex "^MADDU_DSP$")>;
1083 def : InstRW<[GenericDSPShort], (instregex "^MADD_DSP$")>;
1084 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHL$")>;
1085 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHR$")>;
1086 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHL$")>;
1087 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHR$")>;
1088 def : InstRW<[GenericDSPShort], (instregex "^MFHI_DSP$")>;
1089 def : InstRW<[GenericDSPShort], (instregex "^MFLO_DSP$")>;
1090 def : InstRW<[GenericDSPShort], (instregex "^MODSUB$")>;
1091 def : InstRW<[GenericDSPShort], (instregex "^MSUBU_DSP$")>;
1092 def : InstRW<[GenericDSPShort], (instregex "^MSUB_DSP$")>;
1093 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHL$")>;
1094 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHR$")>;
1095 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBL$")>;
1096 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBR$")>;
1097 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_PH$")>;
1098 def : InstRW<[GenericDSPShort], (instregex "^MULSAQ_S_W_PH$")>;
1099 def : InstRW<[GenericDSPShort], (instregex "^MULTU_DSP$")>;
1100 def : InstRW<[GenericDSPShort], (instregex "^MULT_DSP$")>;
1101 def : InstRW<[GenericDSPShort], (instregex "^PACKRL_PH$")>;
1102 def : InstRW<[GenericDSPShort], (instregex "^PICK_PH$")>;
1103 def : InstRW<[GenericDSPShort], (instregex "^PICK_QB$")>;
1104 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBLA$")>;
1105 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBL$")>;
1106 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBRA$")>;
1107 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBR$")>;
1108 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHL$")>;
1109 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHR$")>;
1110 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBLA$")>;
1111 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBL$")>;
1112 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBRA$")>;
1113 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBR$")>;
1114 def : InstRW<[GenericDSPShort], (instregex "^PRECRQU_S_QB_PH$")>;
1115 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_PH_W$")>;
1116 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_QB_PH$")>;
1117 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_RS_PH_W$")>;
1118 def : InstRW<[GenericDSPShort], (instregex "^RADDU_W_QB$")>;
1119 def : InstRW<[GenericDSPShort], (instregex "^RDDSP$")>;
1120 def : InstRW<[GenericDSPShort], (instregex "^REPLV_PH$")>;
1121 def : InstRW<[GenericDSPShort], (instregex "^REPLV_QB$")>;
1122 def : InstRW<[GenericDSPShort], (instregex "^REPL_PH$")>;
1123 def : InstRW<[GenericDSPShort], (instregex "^REPL_QB$")>;
1124 def : InstRW<[GenericDSPShort], (instregex "^SHILOV$")>;
1125 def : InstRW<[GenericDSPShort], (instregex "^SHILO$")>;
1126 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_PH$")>;
1127 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_QB$")>;
1128 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_PH$")>;
1129 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_W$")>;
1130 def : InstRW<[GenericDSPShort], (instregex "^SHLL_PH$")>;
1131 def : InstRW<[GenericDSPShort], (instregex "^SHLL_QB$")>;
1132 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_PH$")>;
1133 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_W$")>;
1134 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_PH$")>;
1135 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_PH$")>;
1136 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_W$")>;
1137 def : InstRW<[GenericDSPShort], (instregex "^SHRA_PH$")>;
1138 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_PH$")>;
1139 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_W$")>;
1140 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_QB$")>;
1141 def : InstRW<[GenericDSPShort], (instregex "^SHRL_QB$")>;
1142 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_PH$")>;
1143 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_PH$")>;
1144 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_W$")>;
1145 def : InstRW<[GenericDSPShort], (instregex "^SUBU_QB$")>;
1146 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_QB$")>;
1147 def : InstRW<[GenericDSPShort], (instregex "^WRDSP$")>;
1149 def : InstRW<[GenericDSPShort],
1150 (instregex "^Pseudo(CMP|CMPU)_(EQ|LE|LT)_(PH|QB)$")>;
1151 def : InstRW<[GenericDSPShort],
1152 (instregex "^PseudoPICK_(PH|QB)$")>;
1154 // MIPS DSP R2 - hasDSP, HasDSPR2, InMicroMips
1155 // ===========================================
1157 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_QB$")>;
1158 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_PH$")>;
1159 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_PH$")>;
1160 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_W$")>;
1161 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_W$")>;
1162 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_QB$")>;
1163 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_R_QB$")>;
1164 def : InstRW<[GenericDSPShort], (instregex "^ADDU_PH$")>;
1165 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_PH$")>;
1166 def : InstRW<[GenericDSPShort], (instregex "^APPEND$")>;
1167 def : InstRW<[GenericDSPShort], (instregex "^BALIGN$")>;
1168 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_EQ_QB$")>;
1169 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LE_QB$")>;
1170 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LT_QB$")>;
1171 def : InstRW<[GenericDSPShort], (instregex "^DPA_W_PH$")>;
1172 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_SA_W_PH$")>;
1173 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_S_W_PH$")>;
1174 def : InstRW<[GenericDSPShort], (instregex "^DPAX_W_PH$")>;
1175 def : InstRW<[GenericDSPShort], (instregex "^DPS_W_PH$")>;
1176 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_S_W_PH$")>;
1177 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_SA_W_PH$")>;
1178 def : InstRW<[GenericDSPShort], (instregex "^DPSX_W_PH$")>;
1179 def : InstRW<[GenericDSPShort], (instregex "^MUL_PH$")>;
1180 def : InstRW<[GenericDSPShort], (instregex "^MUL_S_PH$")>;
1181 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_W$")>;
1182 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_PH$")>;
1183 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_W$")>;
1184 def : InstRW<[GenericDSPShort], (instregex "^MULSA_W_PH$")>;
1185 def : InstRW<[GenericDSPShort], (instregex "^PRECR_QB_PH$")>;
1186 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_PH_W$")>;
1187 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_R_PH_W$")>;
1188 def : InstRW<[GenericDSPShort], (instregex "^PREPEND$")>;
1189 def : InstRW<[GenericDSPShort], (instregex "^SHRA_QB$")>;
1190 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_QB$")>;
1191 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_QB$")>;
1192 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_QB$")>;
1193 def : InstRW<[GenericDSPShort], (instregex "^SHRL_PH$")>;
1194 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_PH$")>;
1195 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_PH$")>;
1196 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_PH$")>;
1197 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_W$")>;
1198 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_W$")>;
1199 def : InstRW<[GenericDSPShort], (instregex "^SUBU_PH$")>;
1200 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_PH$")>;
1201 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_QB$")>;
1202 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_R_QB$")>;
1204 // microMIPS DSP R1 - HasDSP, InMicroMips
1205 // ======================================
1207 def : InstRW<[GenericWriteLoad], (instrs LWDSP_MM)>;
1209 def : InstRW<[GenericWriteStore], (instrs SWDSP_MM)>;
1211 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_PH_MM$")>;
1212 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_W_MM$")>;
1213 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_PH_MM$")>;
1214 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_PH_MM$")>;
1215 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_W_MM$")>;
1216 def : InstRW<[GenericDSPShort], (instregex "^ADDSC_MM$")>;
1217 def : InstRW<[GenericDSPShort], (instregex "^ADDU_QB_MM$")>;
1218 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_QB_MM$")>;
1219 def : InstRW<[GenericDSPShort], (instregex "^ADDWC_MM$")>;
1220 def : InstRW<[GenericDSPShort], (instregex "^BITREV_MM$")>;
1221 def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32_MM$")>;
1222 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_EQ_QB_MM$")>;
1223 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LE_QB_MM$")>;
1224 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LT_QB_MM$")>;
1225 def : InstRW<[GenericDSPShort], (instregex "^CMPU_EQ_QB_MM$")>;
1226 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LE_QB_MM$")>;
1227 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LT_QB_MM$")>;
1228 def : InstRW<[GenericDSPShort], (instregex "^CMP_EQ_PH_MM$")>;
1229 def : InstRW<[GenericDSPShort], (instregex "^CMP_LE_PH_MM$")>;
1230 def : InstRW<[GenericDSPShort], (instregex "^CMP_LT_PH_MM$")>;
1231 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_SA_L_W_MM$")>;
1232 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_S_W_PH_MM$")>;
1233 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBL_MM$")>;
1234 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBR_MM$")>;
1235 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_SA_L_W_MM$")>;
1236 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_S_W_PH_MM$")>;
1237 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBL_MM$")>;
1238 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBR_MM$")>;
1239 def : InstRW<[GenericDSPShort], (instregex "^EXTPDPV_MM$")>;
1240 def : InstRW<[GenericDSPShort], (instregex "^EXTPDP_MM$")>;
1241 def : InstRW<[GenericDSPShort], (instregex "^EXTPV_MM$")>;
1242 def : InstRW<[GenericDSPShort], (instregex "^EXTP_MM$")>;
1243 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_RS_W_MM$")>;
1244 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_R_W_MM$")>;
1245 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_S_H_MM$")>;
1246 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_W_MM$")>;
1247 def : InstRW<[GenericDSPShort], (instregex "^EXTR_RS_W_MM$")>;
1248 def : InstRW<[GenericDSPShort], (instregex "^EXTR_R_W_MM$")>;
1249 def : InstRW<[GenericDSPShort], (instregex "^EXTR_S_H_MM$")>;
1250 def : InstRW<[GenericDSPShort], (instregex "^EXTR_W_MM$")>;
1251 def : InstRW<[GenericDSPShort], (instregex "^INSV_MM$")>;
1252 def : InstRW<[GenericDSPShort], (instregex "^LBUX_MM$")>;
1253 def : InstRW<[GenericDSPShort], (instregex "^LHX_MM$")>;
1254 def : InstRW<[GenericDSPShort], (instregex "^LWX_MM$")>;
1255 def : InstRW<[GenericDSPShort], (instregex "^MADDU_DSP_MM$")>;
1256 def : InstRW<[GenericDSPShort], (instregex "^MADD_DSP_MM$")>;
1257 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHL_MM$")>;
1258 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHR_MM$")>;
1259 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHL_MM$")>;
1260 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHR_MM$")>;
1261 def : InstRW<[GenericDSPShort], (instregex "^MFHI_DSP_MM$")>;
1262 def : InstRW<[GenericDSPShort], (instregex "^MFLO_DSP_MM$")>;
1263 def : InstRW<[GenericDSPShort], (instregex "^MODSUB_MM$")>;
1264 def : InstRW<[GenericDSPShort], (instregex "^MOVEP_MMR6$")>;
1265 def : InstRW<[GenericDSPShort], (instregex "^MOVN_I_MM$")>;
1266 def : InstRW<[GenericDSPShort], (instregex "^MOVZ_I_MM$")>;
1267 def : InstRW<[GenericDSPShort], (instregex "^MSUBU_DSP_MM$")>;
1268 def : InstRW<[GenericDSPShort], (instregex "^MSUB_DSP_MM$")>;
1269 def : InstRW<[GenericDSPShort], (instregex "^MTHI_DSP_MM$")>;
1270 def : InstRW<[GenericDSPShort], (instregex "^MTHLIP_MM$")>;
1271 def : InstRW<[GenericDSPShort], (instregex "^MTLO_DSP_MM$")>;
1272 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHL_MM$")>;
1273 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHR_MM$")>;
1274 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBL_MM$")>;
1275 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBR_MM$")>;
1276 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_PH_MM$")>;
1277 def : InstRW<[GenericDSPShort], (instregex "^MULSAQ_S_W_PH_MM$")>;
1278 def : InstRW<[GenericDSPShort], (instregex "^MULTU_DSP_MM$")>;
1279 def : InstRW<[GenericDSPShort], (instregex "^MULT_DSP_MM$")>;
1280 def : InstRW<[GenericDSPShort], (instregex "^PACKRL_PH_MM$")>;
1281 def : InstRW<[GenericDSPShort], (instregex "^PICK_PH_MM$")>;
1282 def : InstRW<[GenericDSPShort], (instregex "^PICK_QB_MM$")>;
1283 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBLA_MM$")>;
1284 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBL_MM$")>;
1285 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBRA_MM$")>;
1286 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBR_MM$")>;
1287 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHL_MM$")>;
1288 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHR_MM$")>;
1289 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBLA_MM$")>;
1290 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBL_MM$")>;
1291 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBRA_MM$")>;
1292 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBR_MM$")>;
1293 def : InstRW<[GenericDSPShort], (instregex "^PRECRQU_S_QB_PH_MM$")>;
1294 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_PH_W_MM$")>;
1295 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_QB_PH_MM$")>;
1296 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_RS_PH_W_MM$")>;
1297 def : InstRW<[GenericDSPShort], (instregex "^RADDU_W_QB_MM$")>;
1298 def : InstRW<[GenericDSPShort], (instregex "^RDDSP_MM$")>;
1299 def : InstRW<[GenericDSPShort], (instregex "^REPLV_PH_MM$")>;
1300 def : InstRW<[GenericDSPShort], (instregex "^REPLV_QB_MM$")>;
1301 def : InstRW<[GenericDSPShort], (instregex "^REPL_PH_MM$")>;
1302 def : InstRW<[GenericDSPShort], (instregex "^REPL_QB_MM$")>;
1303 def : InstRW<[GenericDSPShort], (instregex "^SHILOV_MM$")>;
1304 def : InstRW<[GenericDSPShort], (instregex "^SHILO_MM$")>;
1305 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_PH_MM$")>;
1306 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_QB_MM$")>;
1307 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_PH_MM$")>;
1308 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_W_MM$")>;
1309 def : InstRW<[GenericDSPShort], (instregex "^SHLL_PH_MM$")>;
1310 def : InstRW<[GenericDSPShort], (instregex "^SHLL_QB_MM$")>;
1311 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_PH_MM$")>;
1312 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_W_MM$")>;
1313 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_PH_MM$")>;
1314 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_PH_MM$")>;
1315 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_W_MM$")>;
1316 def : InstRW<[GenericDSPShort], (instregex "^SHRA_PH_MM$")>;
1317 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_PH_MM$")>;
1318 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_W_MM$")>;
1319 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_QB_MM$")>;
1320 def : InstRW<[GenericDSPShort], (instregex "^SHRL_QB_MM$")>;
1321 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_PH_MM$")>;
1322 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_PH_MM$")>;
1323 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_W_MM$")>;
1324 def : InstRW<[GenericDSPShort], (instregex "^SUBU_QB_MM$")>;
1325 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_QB_MM$")>;
1326 def : InstRW<[GenericDSPShort], (instregex "^WRDSP_MM$")>;
1329 // microMIPS DSP R2 - hasDSP, HasDSPR2, InMicroMips
1330 // ================================================
1332 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_QB_MMR2$")>;
1333 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_PH_MMR2$")>;
1334 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_PH_MMR2$")>;
1335 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_W_MMR2$")>;
1336 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_W_MMR2$")>;
1337 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_QB_MMR2$")>;
1338 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_R_QB_MMR2$")>;
1339 def : InstRW<[GenericDSPShort], (instregex "^ADDU_PH_MMR2$")>;
1340 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_PH_MMR2$")>;
1341 def : InstRW<[GenericDSPShort], (instregex "^APPEND_MMR2$")>;
1342 def : InstRW<[GenericDSPShort], (instregex "^BALIGN_MMR2$")>;
1343 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_EQ_QB_MMR2$")>;
1344 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LE_QB_MMR2$")>;
1345 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LT_QB_MMR2$")>;
1346 def : InstRW<[GenericDSPShort], (instregex "^DPA_W_PH_MMR2$")>;
1347 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_SA_W_PH_MMR2$")>;
1348 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_S_W_PH_MMR2$")>;
1349 def : InstRW<[GenericDSPShort], (instregex "^DPAX_W_PH_MMR2$")>;
1350 def : InstRW<[GenericDSPShort], (instregex "^DPS_W_PH_MMR2$")>;
1351 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_S_W_PH_MMR2$")>;
1352 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_SA_W_PH_MMR2$")>;
1353 def : InstRW<[GenericDSPShort], (instregex "^DPSX_W_PH_MMR2$")>;
1354 def : InstRW<[GenericDSPShort], (instregex "^MUL_PH_MMR2$")>;
1355 def : InstRW<[GenericDSPShort], (instregex "^MUL_S_PH_MMR2$")>;
1356 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_W_MMR2$")>;
1357 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_PH_MMR2$")>;
1358 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_W_MMR2$")>;
1359 def : InstRW<[GenericDSPShort], (instregex "^MULSA_W_PH_MMR2$")>;
1360 def : InstRW<[GenericDSPShort], (instregex "^PRECR_QB_PH_MMR2$")>;
1361 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_PH_W_MMR2$")>;
1362 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_R_PH_W_MMR2$")>;
1363 def : InstRW<[GenericDSPShort], (instregex "^PREPEND_MMR2$")>;
1364 def : InstRW<[GenericDSPShort], (instregex "^SHRA_QB_MMR2$")>;
1365 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_QB_MMR2$")>;
1366 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_QB_MMR2$")>;
1367 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_QB_MMR2$")>;
1368 def : InstRW<[GenericDSPShort], (instregex "^SHRL_PH_MMR2$")>;
1369 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_PH_MMR2$")>;
1370 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_PH_MMR2$")>;
1371 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_PH_MMR2$")>;
1372 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_W_MMR2$")>;
1373 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_W_MMR2$")>;
1374 def : InstRW<[GenericDSPShort], (instregex "^SUBU_PH_MMR2$")>;
1375 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_PH_MMR2$")>;
1376 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_QB_MMR2$")>;
1377 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_R_QB_MMR2$")>;
1379 // microMIPS DSP R3 - hasDSP, hasDSPR2, hasDSPR3, InMicroMips
1380 // ==========================================================
1382 def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32C_MMR3$")>;
1384 // MIPS MSA ASE - hasMSA
1385 // =====================
1387 def GenericWriteMSAShortLogic : SchedWriteRes<[GenericIssueFPUS]>;
1388 def GenericWriteMSAShortInt : SchedWriteRes<[GenericIssueFPUS]> {
1391 def GenericWriteMoveOtherUnitsToFPU : SchedWriteRes<[GenericIssueFPUS]>;
1392 def GenericWriteMSAOther3 : SchedWriteRes<[GenericIssueFPUS]> {
1395 def GenericWriteMSALongInt : SchedWriteRes<[GenericIssueFPUS]> {
1398 def GenericWriteFPUDivI : SchedWriteRes<[GenericFPQ]> {
1400 let ResourceCycles = [ 33 ];
1403 // FPUS is also used in moves from floating point and MSA registers to general
1404 // purpose registers.
1405 def GenericWriteMoveFPUSToOtherUnits : SchedWriteRes<[GenericIssueFPUS]> {
1409 // FPUL is also used in moves from floating point and MSA registers to general
1410 // purpose registers.
1411 def GenericWriteMoveFPULToOtherUnits : SchedWriteRes<[GenericIssueFPUL]>;
1414 // adds_a.[bhwd], adds_[asu].[bhwd], addvi?.[bhwd], asub_[us].[bhwd],
1415 // aver?_[us].[bhwd]
1416 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADD_A_[BHWD]$")>;
1417 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADDS_[ASU]_[BHWD]$")>;
1419 // TODO: ADDVI_[BHW] might be 1 cycle latency rather than 2. Need to confirm it.
1420 // add.[bhwd], addvi.[bhwd], asub_[us].[bhwd], ave.[bhwd], aver.[bhwd]
1421 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADDVI?_[BHWD]$")>;
1422 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ASUB_[US].[BHWD]$")>;
1423 def : InstRW<[GenericWriteMSAShortInt], (instregex "^AVER?_[US].[BHWD]$")>;
1425 // and.v, andi.b, move.v, ldi.[bhwd], xor.v, nor.v, xori.b, nori.b, lsa
1426 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^MOVE_V$")>;
1427 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^LDI_[BHWD]$")>;
1428 def : InstRW<[GenericWriteMSAShortLogic], (instrs LSA)>;
1429 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)_V$")>;
1430 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)I_B$")>;
1431 def : InstRW<[GenericWriteMSAShortLogic],
1432 (instregex "^(AND|OR|[XN]OR)_V_[DHW]_PSEUDO$")>;
1434 // vshf.[bhwd], binsl.[bhwd], binsr.[bhwd], insert.[bhwd], sld?.[bhwd],
1435 // bset.[bhwd], bclr.[bhwd], bneg.[bhwd], bsel_v, bseli_b
1436 def : InstRW<[GenericWriteMSAShortInt], (instregex "^VSHF_[BHWD]$")>;
1437 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BINSL|BINSLI)_[BHWD]$")>;
1438 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BINSR|BINSRI)_[BHWD]$")>;
1439 def : InstRW<[GenericWriteMSAShortInt], (instregex "^INSERT_[BHWD]$")>;
1440 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(SLD|SLDI)_[BHWD]$")>;
1441 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BSET|BSETI)_[BHWD]$")>;
1442 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BCLR|BCLRI)_[BHWD]$")>;
1443 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BNEG|BNEGI)_[BHWD]$")>;
1444 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BSEL_V|BSELI_B)$")>;
1445 def : InstRW<[GenericWriteMSAShortInt], (instregex "^BMN*Z.*$")>;
1446 def : InstRW<[GenericWriteMSAShortInt],
1447 (instregex "^BSEL_(H|W|D|FW|FD)_PSEUDO$")>;
1449 // pcnt.[bhwd], sat_s.[bhwd], sat_u.[bhwd]
1450 def : InstRW<[GenericWriteMSAOther3], (instregex "^PCNT_[BHWD]$")>;
1451 def : InstRW<[GenericWriteMSAOther3], (instregex "^SAT_(S|U)_[BHWD]$")>;
1453 // bnz.[bhwdv], cfcmsa, ctcmsa
1454 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(BNZ|BZ)_[BHWDV]$")>;
1455 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^C(F|T)CMSA$")>;
1457 // shf.[bhw], fill[bhwd], splat?.[bhwd]
1458 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SHF_[BHW]$")>;
1459 def : InstRW<[GenericWriteMSAShortInt], (instregex "^FILL_[BHWD]$")>;
1460 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(SPLAT|SPLATI)_[BHWD]$")>;
1463 def : InstRW<[GenericWriteFPUS], (instregex "^FEXP2_(W|D)$")>;
1465 // compare, converts, round to int, floating point truncate.
1466 def : InstRW<[GenericWriteFPUS], (instregex "^(CLT|CLTI)_(S|U)_[BHWD]$")>;
1467 def : InstRW<[GenericWriteFPUS], (instregex "^(CLE|CLEI)_(S|U)_[BHWD]$")>;
1468 def : InstRW<[GenericWriteFPUS], (instregex "^(CEQ|CEQI)_[BHWD]$")>;
1469 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_UN_(S|D)$")>;
1470 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_UEQ_(S|D)$")>;
1471 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_EQ_(S|D)$")>;
1472 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_LT_(S|D)$")>;
1473 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_ULT_(S|D)$")>;
1474 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_LE_(S|D)$")>;
1475 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_ULE_(S|D)$")>;
1476 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_F_(D|S)$")>;
1477 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SAF_(D|S)$")>;
1478 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SEQ_(D|S)$")>;
1479 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SLE_(D|S)$")>;
1480 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SLT_(D|S)$")>;
1481 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SUEQ_(D|S)$")>;
1482 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SULE_(D|S)$")>;
1483 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SULT_(D|S)$")>;
1484 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SUN_(D|S)$")>;
1485 def : InstRW<[GenericWriteFPUS], (instregex "^FS(AF|EQ|LT|LE|NE|OR)_(W|D)$")>;
1486 def : InstRW<[GenericWriteFPUS], (instregex "^FSUEQ_(W|D)$")>;
1487 def : InstRW<[GenericWriteFPUS], (instregex "^FSULE_(W|D)$")>;
1488 def : InstRW<[GenericWriteFPUS], (instregex "^FSULT_(W|D)$")>;
1489 def : InstRW<[GenericWriteFPUS], (instregex "^FSUNE_(W|D)$")>;
1490 def : InstRW<[GenericWriteFPUS], (instregex "^FSUN_(W|D)$")>;
1491 def : InstRW<[GenericWriteFPUS], (instregex "^FCAF_(W|D)$")>;
1492 def : InstRW<[GenericWriteFPUS], (instregex "^FCEQ_(W|D)$")>;
1493 def : InstRW<[GenericWriteFPUS], (instregex "^FCLE_(W|D)$")>;
1494 def : InstRW<[GenericWriteFPUS], (instregex "^FCLT_(W|D)$")>;
1495 def : InstRW<[GenericWriteFPUS], (instregex "^FCNE_(W|D)$")>;
1496 def : InstRW<[GenericWriteFPUS], (instregex "^FCOR_(W|D)$")>;
1497 def : InstRW<[GenericWriteFPUS], (instregex "^FCUEQ_(W|D)$")>;
1498 def : InstRW<[GenericWriteFPUS], (instregex "^FCULE_(W|D)$")>;
1499 def : InstRW<[GenericWriteFPUS], (instregex "^FCULT_(W|D)$")>;
1500 def : InstRW<[GenericWriteFPUS], (instregex "^FCUNE_(W|D)$")>;
1501 def : InstRW<[GenericWriteFPUS], (instregex "^FCUN_(W|D)$")>;
1502 def : InstRW<[GenericWriteFPUS], (instregex "^FABS_(W|D)$")>;
1503 def : InstRW<[GenericWriteFPUS], (instregex "^FFINT_(U|S)_(W|D)$")>;
1504 def : InstRW<[GenericWriteFPUS], (instregex "^FFQL_(W|D)$")>;
1505 def : InstRW<[GenericWriteFPUS], (instregex "^FFQR_(W|D)$")>;
1506 def : InstRW<[GenericWriteFPUS], (instregex "^FTINT_(U|S)_(W|D)$")>;
1507 def : InstRW<[GenericWriteFPUS], (instregex "^FRINT_(W|D)$")>;
1508 def : InstRW<[GenericWriteFPUS], (instregex "^FTQ_(H|W)$")>;
1509 def : InstRW<[GenericWriteFPUS], (instregex "^FTRUNC_(U|S)_(W|D)$")>;
1511 // fexdo.[hw], fexupl.[wd], fexupr.[wd]
1512 def : InstRW<[GenericWriteFPUS], (instregex "^FEXDO_(H|W)$")>;
1513 def : InstRW<[GenericWriteFPUS], (instregex "^FEXUPL_(W|D)$")>;
1514 def : InstRW<[GenericWriteFPUS], (instregex "^FEXUPR_(W|D)$")>;
1516 // fclass.[wd], fmax.[wd], fmax_a.[wd], fmin.[wd], fmin_a.[wd], flog2.[wd]
1517 def : InstRW<[GenericWriteFPUS], (instregex "^FCLASS_(W|D)$")>;
1518 def : InstRW<[GenericWriteFPUS], (instregex "^FMAX_A_(W|D)$")>;
1519 def : InstRW<[GenericWriteFPUS], (instregex "^FMAX_(W|D)$")>;
1520 def : InstRW<[GenericWriteFPUS], (instregex "^FMIN_A_(W|D)$")>;
1521 def : InstRW<[GenericWriteFPUS], (instregex "^FMIN_(W|D)$")>;
1522 def : InstRW<[GenericWriteFPUS], (instregex "^FLOG2_(W|D)$")>;
1524 // interleave right/left, interleave even/odd, insert
1525 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(ILVR|ILVL)_[BHWD]$")>;
1526 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(ILVEV|ILVOD)_[BHWD]$")>;
1528 // subs_?.[bhwd], subsus_?.[bhwd], subsuu_?.[bhwd], subvi.[bhwd], subv.[bhwd],
1529 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBS_(S|U)_[BHWD]$")>;
1530 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBSUS_(S|U)_[BHWD]$")>;
1531 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBSUU_(S|U)_[BHWD]$")>;
1532 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBVI_[BHWD]$")>;
1533 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBV_[BHWD]$")>;
1535 // mod_[su].[bhwd], div_[su].[bhwd]
1536 def : InstRW<[GenericWriteFPUDivI], (instregex "^MOD_(S|U)_[BHWD]$")>;
1537 def : InstRW<[GenericWriteFPUDivI], (instregex "^DIV_(S|U)_[BHWD]$")>;
1539 // hadd_[su].[bhwd], hsub_[su].[bhwd], max_[sua].[bhwd], min_[sua].[bhwd],
1540 // maxi_[su].[bhwd], mini_[su].[bhwd], sra?.[bhwd], srar?.[bhwd], srlr.[bhwd],
1541 // sll?.[bhwd], pckev.[bhwd], pckod.[bhwd], nloc.[bhwd], nlzc.[bhwd],
1543 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^HADD_(S|U)_[BHWD]$")>;
1544 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^HSUB_(S|U)_[BHWD]$")>;
1545 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_S_[BHWD]$")>;
1546 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_U_[BHWD]$")>;
1547 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_A_[BHWD]$")>;
1548 def : InstRW<[GenericWriteMSAShortLogic],
1549 (instregex "^(MAXI|MINI)_(S|U)_[BHWD]$")>;
1550 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRA|SRAI)_[BHWD]$")>;
1551 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRL|SRLI)_[BHWD]$")>;
1552 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRAR|SRARI)_[BHWD]$")>;
1553 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRLR|SRLRI)_[BHWD]$")>;
1554 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SLL|SLLI)_[BHWD]$")>;
1555 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(PCKEV|PCKOD)_[BHWD]$")>;
1556 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(NLOC|NLZC)_[BHWD]$")>;
1557 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^INSVE_[BHWD]$")>;
1558 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^INSERT_F(D|W)_PSEUDO$")>;
1559 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^FILL_F(D|W)_PSEUDO$")>;
1561 // dpadd_?.[bhwd], dpsub_?.[bhwd], dotp_?.[bhwd], msubv.[bhwd], maddv.[bhwd]
1563 def : InstRW<[GenericWriteMSALongInt], (instregex "^DPADD_(S|U)_[HWD]$")>;
1564 def : InstRW<[GenericWriteMSALongInt], (instregex "^DPSUB_(S|U)_[HWD]$")>;
1565 def : InstRW<[GenericWriteMSALongInt], (instregex "^DOTP_(S|U)_[HWD]$")>;
1566 def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUBV_[BHWD]$")>;
1567 def : InstRW<[GenericWriteMSALongInt], (instregex "^MADDV_[BHWD]$")>;
1568 def : InstRW<[GenericWriteMSALongInt], (instregex "^MULV_[BHWD]$")>;
1570 // madd?.q.[hw], msub?.q.[hw], mul?.q.[hw]
1571 def : InstRW<[GenericWriteMSALongInt], (instregex "^MADDR_Q_[HW]$")>;
1572 def : InstRW<[GenericWriteMSALongInt], (instregex "^MADD_Q_[HW]$")>;
1573 def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUBR_Q_[HW]$")>;
1574 def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUB_Q_[HW]$")>;
1575 def : InstRW<[GenericWriteMSALongInt], (instregex "^MULR_Q_[HW]$")>;
1576 def : InstRW<[GenericWriteMSALongInt], (instregex "^MUL_Q_[HW]$")>;
1578 // fadd.[dw], fmadd.[dw], fmul.[dw], frcp.[dw], frsqrt.[dw], fsqrt.[dw]
1579 // fsub.[dw], fdiv.[dw]
1580 def : InstRW<[GenericWriteFPUL], (instregex "^FADD_[DW]$")>;
1581 def : InstRW<[GenericWriteFPUL], (instregex "^FMADD_[DW]$")>;
1582 def : InstRW<[GenericWriteFPUL], (instregex "^FMSUB_[DW]$")>;
1583 def : InstRW<[GenericWriteFPUL], (instregex "^FMUL_[DW]$")>;
1584 def : InstRW<[GenericWriteFPUL], (instregex "^FRCP_[DW]$")>;
1585 def : InstRW<[GenericWriteFPUL], (instregex "^FRSQRT_[DW]$")>;
1586 def : InstRW<[GenericWriteFPUL], (instregex "^FSQRT_[DW]$")>;
1587 def : InstRW<[GenericWriteFPUL], (instregex "^FSUB_[DW]$")>;
1588 def : InstRW<[GenericWriteFPUL], (instregex "^FDIV_[DW]$")>;
1591 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instregex "^COPY_U_[BHW]$")>;
1592 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instregex "^COPY_S_[BHWD]$")>;
1594 def : InstRW<[GenericWriteFPUStore], (instregex "^ST_[BHWD]$")>;
1595 def : InstRW<[GenericWriteFPUStore], (instrs ST_F16)>;
1596 def : InstRW<[GenericWriteFPULoad], (instregex "^LD_[BHWD]$")>;
1597 def : InstRW<[GenericWriteFPULoad], (instrs LD_F16)>;
1599 // Atomic instructions
1601 // FIXME: Define `WriteAtomic` in the MipsSchedule.td and
1602 // attach it to the Atomic2OpsPostRA, AtomicCmpSwapPostRA, ...
1603 // classes. Then just define resources for the `WriteAtomic` in each
1605 def GenericAtomic : ProcResource<1> { let BufferSize = 1; }
1606 def GenericWriteAtomic : SchedWriteRes<[GenericAtomic]> { let Latency = 2; }
1608 def : InstRW<[GenericWriteAtomic],
1609 (instregex "^ATOMIC_SWAP_I(8|16|32|64)_POSTRA$")>;
1610 def : InstRW<[GenericWriteAtomic],
1611 (instregex "^ATOMIC_CMP_SWAP_I(8|16|32|64)_POSTRA$")>;
1612 def : InstRW<[GenericWriteAtomic],
1613 (instregex "^ATOMIC_LOAD_(ADD|SUB|AND|OR|XOR|NAND)_I(8|16|32|64)_POSTRA$")>;