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 ReleaseAtCycles = [33];
165 def GenericWriteDIVU : SchedWriteRes<[GenericIssueDIV]> {
166 // Estimated worst case
168 let ReleaseAtCycles = [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, NAL)>;
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,
724 V3MULU, VMM0, VMULU)>;
726 def : InstRW<[GenericWriteMDUtoGPR], (instrs DMUL)>;
728 // Cavium Networks MIPS (cnMIPSP) - Octeon+, HasCnMipsP
729 // =================================================
731 def : InstRW<[GenericWriteALU], (instrs SAA, SAAD)>;
736 def GenericFPQ : ProcResource<1> { let BufferSize = 1; }
737 def GenericIssueFPUS : ProcResource<1> { let Super = GenericFPQ; }
738 def GenericIssueFPUL : ProcResource<1> { let Super = GenericFPQ; }
739 def GenericIssueFPULoad : ProcResource<1> { let Super = GenericFPQ; }
740 def GenericIssueFPUStore : ProcResource<1> { let Super = GenericFPQ; }
741 def GenericIssueFPUMove : ProcResource<1> { let Super = GenericFPQ; }
742 def GenericFPUDivSqrt : ProcResource<1> { let Super = GenericFPQ; }
744 // The floating point compare of the 24k series including interAptiv has a
745 // listed latency of 1-2. Using the higher latency here.
747 def GenericWriteFPUCmp : SchedWriteRes<[GenericIssueFPUS]> { let Latency = 2; }
748 def GenericWriteFPUS : SchedWriteRes<[GenericIssueFPUS]> { let Latency = 4; }
749 def GenericWriteFPUL : SchedWriteRes<[GenericIssueFPUL]> { let Latency = 5; }
750 def GenericWriteFPUStore : SchedWriteRes<[GenericIssueFPUStore]> { let
753 def GenericWriteFPULoad : SchedWriteRes<[GenericIssueFPULoad]> {
756 def GenericWriteFPUMoveFP : SchedWriteRes<[GenericIssueFPUMove]> {
759 def GenericWriteFPUMoveGPRFPU : SchedWriteRes<[GenericIssueFPUMove]> {
762 def GenericWriteFPUDivS : SchedWriteRes<[GenericFPUDivSqrt]> {
764 let ReleaseAtCycles = [ 14 ];
766 def GenericWriteFPUDivD : SchedWriteRes<[GenericFPUDivSqrt]> {
768 let ReleaseAtCycles = [ 29 ];
770 def GenericWriteFPURcpS : SchedWriteRes<[GenericFPUDivSqrt]> {
772 let ReleaseAtCycles = [ 10 ];
774 def GenericWriteFPURcpD : SchedWriteRes<[GenericFPUDivSqrt]> {
776 let ReleaseAtCycles = [ 21 ];
778 def GenericWriteFPURsqrtS : SchedWriteRes<[GenericFPUDivSqrt]> {
780 let ReleaseAtCycles = [ 14 ];
782 def GenericWriteFPURsqrtD : SchedWriteRes<[GenericFPUDivSqrt]> {
784 let ReleaseAtCycles = [ 29 ];
786 def GenericWriteFPUSqrtS : SchedWriteRes<[GenericFPUDivSqrt]> {
788 let ReleaseAtCycles = [ 14 ];
790 def GenericWriteFPUSqrtD : SchedWriteRes<[GenericFPUDivSqrt]> {
792 let ReleaseAtCycles = [ 29 ];
795 // Floating point compare and branch
796 // ---------------------------------
798 // c.<cc>.[ds], bc1[tf], bc1[tf]l
799 def : InstRW<[GenericWriteFPUCmp], (instrs FCMP_D32, FCMP_D64, FCMP_S32, BC1F,
800 BC1T, BC1FL, BC1TL)>;
802 def : InstRW<[GenericWriteFPUCmp], (instregex "C_[A-Z]+_(S|D32|D64)$")>;
807 // abs.[ds], abs.ps, add.[ds], neg.[ds], neg.ps, madd.s, msub.s, nmadd,s
808 // nmsub.s, sub.[ds], mul.s
810 def : InstRW<[GenericWriteFPUS], (instrs FABS_S, FABS_D32, FABS_D64, FADD_D32,
811 FADD_D64, FADD_S, MADD_S, MSUB_S, FMUL_S,
812 FNEG_S, FNEG_D32, FNEG_D64, NMADD_S, NMSUB_S,
813 FSUB_S, FSUB_D32, FSUB_D64)>;
818 // nmadd.d, nmsub.d, mul.[ds], mul.ps, ceil.[wl].[sd], cvt.d.[sw], cvt.s.[dw],
819 // cvt.w.[sd], cvt.[sw].ps, trunc.w.[ds], trunc.w.ps, floor.[ds],
820 // round.[lw].[ds], floor.[lw].ds
822 // madd.d, msub.dm mul.d, mul.ps, nmadd.d, nmsub.d, ceil.[wl].[sd], cvt.d.[sw],
823 // cvt.s.[dw], cvt.w.[sd], cvt.[sw].ps, round.[lw].[ds], floor.[lw].ds,
824 // trunc.w.[ds], trunc.w.ps,
825 def : InstRW<[GenericWriteFPUL], (instrs ADDR_PS64,
826 CEIL_L_D64, CEIL_L_S, CEIL_W_D32,
827 CEIL_W_D64, CEIL_W_S, CVT_D32_S, CVT_D32_W,
828 CVT_D64_L, CVT_D64_S, CVT_D64_W, CVT_L_D64,
829 CVT_L_S, CVT_S_D32, CVT_S_D64, CVT_S_L,
830 CVT_S_W, CVT_W_D32, CVT_W_D64, CVT_W_S,
831 CVT_PS_S64, CVT_S_PL64, CVT_S_PU64,
832 CVT_PS_PW64, CVT_PW_PS64, FADD_PS64,
833 FLOOR_L_D64, FLOOR_L_S, FLOOR_W_D32,
834 FLOOR_W_D64, FLOOR_W_S, FMUL_D32, FMUL_D64,
835 FMUL_PS64, FSUB_PS64, MADD_D32, MADD_D64,
836 MSUB_D32, MSUB_D64, MULR_PS64,
837 NMADD_D32, NMADD_D64, NMSUB_D32, NMSUB_D64,
838 PLL_PS64, PLU_PS64, PUL_PS64, PUU_PS64,
839 ROUND_L_D64, ROUND_L_S, ROUND_W_D32,
840 ROUND_W_D64, ROUND_W_S, TRUNC_L_D64,
841 TRUNC_L_S, TRUNC_W_D32, TRUNC_W_D64,
842 TRUNC_W_S, PseudoTRUNC_W_D,
843 PseudoTRUNC_W_D32, PseudoTRUNC_W_S)>;
845 // Pseudo convert instruction
846 def : InstRW<[GenericWriteFPUL], (instrs PseudoCVT_D32_W, PseudoCVT_D64_L,
847 PseudoCVT_D64_W, PseudoCVT_S_L,
851 def : InstRW<[GenericWriteFPUDivS], (instrs FDIV_S)>;
852 def : InstRW<[GenericWriteFPUDivD], (instrs FDIV_D32, FDIV_D64)>;
854 // sqrt.[ds], sqrt.ps
855 def : InstRW<[GenericWriteFPUSqrtS], (instrs FSQRT_S)>;
856 def : InstRW<[GenericWriteFPUSqrtD], (instrs FSQRT_D32, FSQRT_D64)>;
858 // rsqrt.[ds], recip.[ds]
859 def : InstRW<[GenericWriteFPURcpS], (instrs RECIP_S, RSQRT_S)>;
860 def : InstRW<[GenericWriteFPURcpD], (instrs RECIP_D32, RECIP_D64,
861 RSQRT_D32, RSQRT_D64)>;
867 // ctc1, mtc1, mthc1, cfc1, mfc1, mfhc1
868 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instrs BuildPairF64,
869 BuildPairF64_64, ExtractElementF64,
870 ExtractElementF64_64, CFC1, CTC1,
871 MFC1, MFC1_D64, MFHC1_D32,
872 MFHC1_D64, MTC1, MTC1_D64,
873 MTHC1_D32, MTHC1_D64)>;
876 def : InstRW<[GenericWriteFPUStore], (instrs SDC1, SDC164, SDXC1, SDXC164,
877 SUXC1, SUXC164, SWC1, SWXC1)>;
879 def : InstRW<[GenericWriteFPUMoveFP], (instrs FMOV_D32, FMOV_D64, FMOV_S)>;
882 // movn.[ds], movz.[ds]
883 def : InstRW<[GenericWriteFPUMoveFP], (instrs MOVF_I, MOVF_D32, MOVF_D64,
884 MOVF_S, MOVT_I, MOVT_D32, MOVT_D64,
885 MOVT_S, MOVN_I_D32, MOVN_I_D64,
886 MOVN_I_S, MOVZ_I_D32, MOVZ_I_D64,
889 def : InstRW<[GenericWriteFPUMoveFP], (instrs MOVT_I64, MOVF_I64, MOVZ_I64_S,
890 MOVN_I64_D64, MOVN_I64_S,
894 def : InstRW<[GenericWriteFPULoad], (instrs LDC1, LDC164, LDXC1, LDXC164,
895 LUXC1, LUXC164, LWC1, LWXC1)>;
900 // sel(eq|ne).[ds], max.[ds], maxa.[ds], min.[ds], mina.[ds], class.[ds]
901 def : InstRW<[GenericWriteFPUS], (instrs SELEQZ_S, SELNEZ_S, SELEQZ_D, SELNEZ_D,
902 MAX_S, MAX_D, MAXA_S, MAXA_D, MIN_S, MIN_D,
903 MINA_S, MINA_D, CLASS_S, CLASS_D)>;
905 def : InstRW<[GenericWriteFPUL], (instrs RINT_S, RINT_D)>;
907 def : InstRW<[GenericWriteFPUCmp], (instrs BC1EQZ, BC1NEZ, SEL_D, SEL_S)>;
909 def : InstRW<[GenericWriteFPUS], (instrs MADDF_S, MSUBF_S, MADDF_D, MSUBF_D)>;
915 def : InstRW<[GenericWriteFPUMoveFP], (instrs MOVF_D32_MM, MOVF_S_MM,
916 MOVN_I_D32_MM, MOVN_I_S_MM,
917 MOVT_D32_MM, MOVT_S_MM, MOVZ_I_D32_MM,
921 // cvt.?.?, ceil.?, floor.?, round.?, trunc.? (n)madd.? (n)msub.?
922 def : InstRW<[GenericWriteFPUL], (instrs CVT_D32_S_MM, CVT_D32_W_MM,
923 CVT_D64_S_MM, CVT_D64_W_MM, CVT_L_D64_MM,
924 CVT_L_S_MM, CVT_S_D32_MM, CVT_S_D64_MM,
925 CVT_S_W_MM, CVT_W_D32_MM, CVT_W_D64_MM,
926 CVT_W_S_MM, CEIL_W_MM, CEIL_W_S_MM,
927 FLOOR_W_MM, FLOOR_W_S_MM, NMADD_S_MM,
928 NMADD_D32_MM, NMSUB_S_MM, NMSUB_D32_MM,
929 MADD_S_MM, MADD_D32_MM, ROUND_W_MM,
930 ROUND_W_S_MM, TRUNC_W_MM, TRUNC_W_S_MM)>;
932 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_[A-Z]_(S|D32|D64)_MM$")>;
933 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_[A-Z][A-Z]_(S|D32|D64)_MM$")>;
934 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_[A-Z][A-Z][A-Z]_(S|D32|D64)_MM$")>;
935 def : InstRW<[GenericWriteFPUCmp], (instregex "^C_NGLE_(S|D32|D64)_MM$")>;
936 def : InstRW<[GenericWriteFPUCmp], (instrs FCMP_S32_MM, FCMP_D32_MM)>;
938 def : InstRW<[GenericWriteFPUS], (instrs MFC1_MM, MFHC1_D32_MM, MFHC1_D64_MM,
939 MTC1_MM, MTC1_D64_MM,
940 MTHC1_D32_MM, MTHC1_D64_MM)>;
942 def : InstRW<[GenericWriteFPUS], (instrs FABS_D32_MM, FABS_D64_MM, FABS_S_MM,
943 FNEG_D32_MM, FNEG_D64_MM, FNEG_S_MM,
944 FADD_D32_MM, FADD_D64_MM, FADD_S_MM,
945 FMOV_D32_MM, FMOV_D64_MM, FMOV_S_MM,
946 FMUL_D32_MM, FMUL_D64_MM, FMUL_S_MM,
947 FSUB_D32_MM, FSUB_D64_MM, FSUB_S_MM,
948 MSUB_S_MM, MSUB_D32_MM)>;
950 def : InstRW<[GenericWriteFPUDivS], (instrs FDIV_S_MM)>;
951 def : InstRW<[GenericWriteFPUDivD], (instrs FDIV_D32_MM, FDIV_D64_MM)>;
953 def : InstRW<[GenericWriteFPUSqrtS], (instrs FSQRT_S_MM)>;
954 def : InstRW<[GenericWriteFPUSqrtD], (instrs FSQRT_D32_MM, FSQRT_D64_MM)>;
956 def : InstRW<[GenericWriteFPURcpS], (instrs RECIP_S_MM, RSQRT_S_MM)>;
957 def : InstRW<[GenericWriteFPURcpD], (instrs RECIP_D32_MM, RECIP_D64_MM,
958 RSQRT_D32_MM, RSQRT_D64_MM)>;
960 def : InstRW<[GenericWriteFPUStore], (instrs SDC1_MM_D32, SDC1_MM_D64, SWC1_MM,
961 SUXC1_MM, SWXC1_MM)>;
963 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instrs CFC1_MM, CTC1_MM)>;
965 def : InstRW<[GenericWriteFPULoad], (instrs LDC1_MM_D32, LDC1_MM_D64, LUXC1_MM,
971 def : InstRW<[GenericWriteFPUS], (instrs FNEG_S_MMR6)>;
973 def : InstRW<[GenericWriteFPUCmp], (instregex "CMP_[A-Z][A-Z]_(S|D)_MMR6")>;
974 def : InstRW<[GenericWriteFPUCmp],
975 (instregex "CMP_[A-Z][A-Z][A-Z]_(S|D)_MMR6")>;
976 def : InstRW<[GenericWriteFPUCmp],
977 (instregex "CMP_[A-Z][A-Z][A-Z][A-Z]_(S|D)_MMR6")>;
979 def : InstRW<[GenericWriteFPUL],
980 (instregex "CVT_(L|D|S|W)_(L|D|S|L|W)_MMR6")>;
982 def : InstRW<[GenericWriteFPUL],
983 (instregex "TRUNC_(L|W)_(D|S)_MMR6")>;
985 def : InstRW<[GenericWriteFPUL],
986 (instregex "ROUND_(L|W)_(D|S)_MMR6")>;
988 def : InstRW<[GenericWriteFPUL],
989 (instregex "FLOOR_(L|W)_(D|S)_MMR6")>;
991 def : InstRW<[GenericWriteFPUL],
992 (instregex "CEIL_(L|W)_(S|D)_MMR6")>;
994 def : InstRW<[GenericWriteFPUS],
995 (instrs MFC1_MMR6, MTC1_MMR6, CLASS_S_MMR6, CLASS_D_MMR6,
998 def : InstRW<[GenericWriteFPUS], (instregex "M(IN|AX)_(S|D)_MMR6")>;
1000 def : InstRW<[GenericWriteFPUS], (instregex "M(IN|AX)A_(S|D)_MMR6")>;
1002 def : InstRW<[GenericWriteFPUS], (instregex "SEL(EQ|NE)Z_(S|D)_MMR6")>;
1004 def : InstRW<[GenericWriteFPUS], (instregex "SEL_(S|D)_MMR6")>;
1006 def : InstRW<[GenericWriteFPUL], (instrs RINT_S_MMR6, RINT_D_MMR6)>;
1008 def : InstRW<[GenericWriteFPUS], (instregex "M(ADD|SUB)F_(S|D)_MMR6")>;
1010 def : InstRW<[GenericWriteFPUS], (instrs FMOV_S_MMR6, FMUL_S_MMR6,
1011 FSUB_S_MMR6, FMOV_D_MMR6)>;
1013 def : InstRW<[GenericWriteFPUL], (instrs FDIV_S_MMR6)>;
1015 def : InstRW<[GenericWriteFPUStore], (instrs SDC1_D64_MMR6)>;
1017 def : InstRW<[GenericWriteFPULoad], (instrs LDC1_D64_MMR6)>;
1022 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instrs DMFC1, DMTC1)>;
1024 // MIPS DSP ASE, HasDSP
1025 // ====================
1027 def : InstRW<[GenericWriteStore], (instrs SWDSP)>;
1029 def : InstRW<[GenericWriteLoad], (instrs LWDSP)>;
1031 def : InstRW<[GenericWriteMove], (instrs PseudoMTLOHI_DSP)>;
1033 def GenericDSP : ProcResource<1> { let BufferSize = 1; }
1034 def GenericDSPShort : SchedWriteRes<[GenericDSP]> { let Latency = 2; }
1035 def GenericDSPLong : SchedWriteRes<[GenericDSP]> { let Latency = 6; }
1036 def GenericDSPBypass : SchedWriteRes<[GenericDSP]> { let Latency = 1; }
1037 def GenericDSPMTHILO : SchedWriteRes<[GenericDSP]> { let Latency = 5; }
1038 def GenericDSPLoad : SchedWriteRes<[GenericDSP]> { let Latency = 4; }
1039 def GenericDSPMTHLIP : SchedWriteRes<[GenericDSP]> { let Latency = 5; }
1041 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_RS_W$")>;
1042 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_R_W$")>;
1043 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_S_H$")>;
1044 def : InstRW<[GenericDSPLong], (instregex "^EXTRV_W$")>;
1045 def : InstRW<[GenericDSPLong], (instregex "^EXTR_RS_W$")>;
1046 def : InstRW<[GenericDSPLong], (instregex "^EXTR_R_W$")>;
1047 def : InstRW<[GenericDSPLong], (instregex "^EXTR_S_H$")>;
1048 def : InstRW<[GenericDSPLong], (instregex "^EXTR_W$")>;
1049 def : InstRW<[GenericDSPLong], (instregex "^INSV$")>;
1051 def : InstRW<[GenericDSPMTHLIP], (instregex "^MTHLIP$")>;
1052 def : InstRW<[GenericDSPMTHILO], (instregex "^MTHI_DSP$")>;
1053 def : InstRW<[GenericDSPMTHILO], (instregex "^MTLO_DSP$")>;
1055 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_PH$")>;
1056 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_W$")>;
1057 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_PH$")>;
1058 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_PH$")>;
1059 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_W$")>;
1060 def : InstRW<[GenericDSPShort], (instregex "^ADDSC$")>;
1061 def : InstRW<[GenericDSPShort], (instregex "^ADDU_QB$")>;
1062 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_QB$")>;
1063 def : InstRW<[GenericDSPShort], (instregex "^ADDWC$")>;
1064 def : InstRW<[GenericDSPShort], (instregex "^BITREV$")>;
1065 def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32$")>;
1066 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_EQ_QB$")>;
1067 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LE_QB$")>;
1068 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LT_QB$")>;
1069 def : InstRW<[GenericDSPShort], (instregex "^CMPU_EQ_QB$")>;
1070 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LE_QB$")>;
1071 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LT_QB$")>;
1072 def : InstRW<[GenericDSPShort], (instregex "^CMP_EQ_PH$")>;
1073 def : InstRW<[GenericDSPShort], (instregex "^CMP_LE_PH$")>;
1074 def : InstRW<[GenericDSPShort], (instregex "^CMP_LT_PH$")>;
1075 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_SA_L_W$")>;
1076 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_S_W_PH$")>;
1077 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBL$")>;
1078 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBR$")>;
1079 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_SA_L_W$")>;
1080 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_S_W_PH$")>;
1081 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBL$")>;
1082 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBR$")>;
1083 def : InstRW<[GenericDSPShort], (instregex "^EXTPDPV$")>;
1084 def : InstRW<[GenericDSPShort], (instregex "^EXTPDP$")>;
1085 def : InstRW<[GenericDSPShort], (instregex "^EXTPV$")>;
1086 def : InstRW<[GenericDSPShort], (instregex "^EXTP$")>;
1087 def : InstRW<[GenericDSPShort], (instregex "^LBUX$")>;
1088 def : InstRW<[GenericDSPShort], (instregex "^LHX$")>;
1089 def : InstRW<[GenericDSPShort], (instregex "^LWX$")>;
1090 def : InstRW<[GenericDSPShort], (instregex "^MADDU_DSP$")>;
1091 def : InstRW<[GenericDSPShort], (instregex "^MADD_DSP$")>;
1092 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHL$")>;
1093 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHR$")>;
1094 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHL$")>;
1095 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHR$")>;
1096 def : InstRW<[GenericDSPShort], (instregex "^MFHI_DSP$")>;
1097 def : InstRW<[GenericDSPShort], (instregex "^MFLO_DSP$")>;
1098 def : InstRW<[GenericDSPShort], (instregex "^MODSUB$")>;
1099 def : InstRW<[GenericDSPShort], (instregex "^MSUBU_DSP$")>;
1100 def : InstRW<[GenericDSPShort], (instregex "^MSUB_DSP$")>;
1101 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHL$")>;
1102 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHR$")>;
1103 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBL$")>;
1104 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBR$")>;
1105 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_PH$")>;
1106 def : InstRW<[GenericDSPShort], (instregex "^MULSAQ_S_W_PH$")>;
1107 def : InstRW<[GenericDSPShort], (instregex "^MULTU_DSP$")>;
1108 def : InstRW<[GenericDSPShort], (instregex "^MULT_DSP$")>;
1109 def : InstRW<[GenericDSPShort], (instregex "^PACKRL_PH$")>;
1110 def : InstRW<[GenericDSPShort], (instregex "^PICK_PH$")>;
1111 def : InstRW<[GenericDSPShort], (instregex "^PICK_QB$")>;
1112 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBLA$")>;
1113 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBL$")>;
1114 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBRA$")>;
1115 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBR$")>;
1116 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHL$")>;
1117 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHR$")>;
1118 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBLA$")>;
1119 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBL$")>;
1120 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBRA$")>;
1121 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBR$")>;
1122 def : InstRW<[GenericDSPShort], (instregex "^PRECRQU_S_QB_PH$")>;
1123 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_PH_W$")>;
1124 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_QB_PH$")>;
1125 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_RS_PH_W$")>;
1126 def : InstRW<[GenericDSPShort], (instregex "^RADDU_W_QB$")>;
1127 def : InstRW<[GenericDSPShort], (instregex "^RDDSP$")>;
1128 def : InstRW<[GenericDSPShort], (instregex "^REPLV_PH$")>;
1129 def : InstRW<[GenericDSPShort], (instregex "^REPLV_QB$")>;
1130 def : InstRW<[GenericDSPShort], (instregex "^REPL_PH$")>;
1131 def : InstRW<[GenericDSPShort], (instregex "^REPL_QB$")>;
1132 def : InstRW<[GenericDSPShort], (instregex "^SHILOV$")>;
1133 def : InstRW<[GenericDSPShort], (instregex "^SHILO$")>;
1134 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_PH$")>;
1135 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_QB$")>;
1136 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_PH$")>;
1137 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_W$")>;
1138 def : InstRW<[GenericDSPShort], (instregex "^SHLL_PH$")>;
1139 def : InstRW<[GenericDSPShort], (instregex "^SHLL_QB$")>;
1140 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_PH$")>;
1141 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_W$")>;
1142 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_PH$")>;
1143 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_PH$")>;
1144 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_W$")>;
1145 def : InstRW<[GenericDSPShort], (instregex "^SHRA_PH$")>;
1146 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_PH$")>;
1147 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_W$")>;
1148 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_QB$")>;
1149 def : InstRW<[GenericDSPShort], (instregex "^SHRL_QB$")>;
1150 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_PH$")>;
1151 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_PH$")>;
1152 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_W$")>;
1153 def : InstRW<[GenericDSPShort], (instregex "^SUBU_QB$")>;
1154 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_QB$")>;
1155 def : InstRW<[GenericDSPShort], (instregex "^WRDSP$")>;
1157 def : InstRW<[GenericDSPShort],
1158 (instregex "^Pseudo(CMP|CMPU)_(EQ|LE|LT)_(PH|QB)$")>;
1159 def : InstRW<[GenericDSPShort],
1160 (instregex "^PseudoPICK_(PH|QB)$")>;
1162 // MIPS DSP R2 - hasDSP, HasDSPR2, InMicroMips
1163 // ===========================================
1165 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_QB$")>;
1166 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_PH$")>;
1167 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_PH$")>;
1168 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_W$")>;
1169 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_W$")>;
1170 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_QB$")>;
1171 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_R_QB$")>;
1172 def : InstRW<[GenericDSPShort], (instregex "^ADDU_PH$")>;
1173 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_PH$")>;
1174 def : InstRW<[GenericDSPShort], (instregex "^APPEND$")>;
1175 def : InstRW<[GenericDSPShort], (instregex "^BALIGN$")>;
1176 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_EQ_QB$")>;
1177 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LE_QB$")>;
1178 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LT_QB$")>;
1179 def : InstRW<[GenericDSPShort], (instregex "^DPA_W_PH$")>;
1180 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_SA_W_PH$")>;
1181 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_S_W_PH$")>;
1182 def : InstRW<[GenericDSPShort], (instregex "^DPAX_W_PH$")>;
1183 def : InstRW<[GenericDSPShort], (instregex "^DPS_W_PH$")>;
1184 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_S_W_PH$")>;
1185 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_SA_W_PH$")>;
1186 def : InstRW<[GenericDSPShort], (instregex "^DPSX_W_PH$")>;
1187 def : InstRW<[GenericDSPShort], (instregex "^MUL_PH$")>;
1188 def : InstRW<[GenericDSPShort], (instregex "^MUL_S_PH$")>;
1189 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_W$")>;
1190 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_PH$")>;
1191 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_W$")>;
1192 def : InstRW<[GenericDSPShort], (instregex "^MULSA_W_PH$")>;
1193 def : InstRW<[GenericDSPShort], (instregex "^PRECR_QB_PH$")>;
1194 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_PH_W$")>;
1195 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_R_PH_W$")>;
1196 def : InstRW<[GenericDSPShort], (instregex "^PREPEND$")>;
1197 def : InstRW<[GenericDSPShort], (instregex "^SHRA_QB$")>;
1198 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_QB$")>;
1199 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_QB$")>;
1200 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_QB$")>;
1201 def : InstRW<[GenericDSPShort], (instregex "^SHRL_PH$")>;
1202 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_PH$")>;
1203 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_PH$")>;
1204 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_PH$")>;
1205 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_W$")>;
1206 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_W$")>;
1207 def : InstRW<[GenericDSPShort], (instregex "^SUBU_PH$")>;
1208 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_PH$")>;
1209 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_QB$")>;
1210 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_R_QB$")>;
1212 // microMIPS DSP R1 - HasDSP, InMicroMips
1213 // ======================================
1215 def : InstRW<[GenericWriteLoad], (instrs LWDSP_MM)>;
1217 def : InstRW<[GenericWriteStore], (instrs SWDSP_MM)>;
1219 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_PH_MM$")>;
1220 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_W_MM$")>;
1221 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_PH_MM$")>;
1222 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_PH_MM$")>;
1223 def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_W_MM$")>;
1224 def : InstRW<[GenericDSPShort], (instregex "^ADDSC_MM$")>;
1225 def : InstRW<[GenericDSPShort], (instregex "^ADDU_QB_MM$")>;
1226 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_QB_MM$")>;
1227 def : InstRW<[GenericDSPShort], (instregex "^ADDWC_MM$")>;
1228 def : InstRW<[GenericDSPShort], (instregex "^BITREV_MM$")>;
1229 def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32_MM$")>;
1230 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_EQ_QB_MM$")>;
1231 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LE_QB_MM$")>;
1232 def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LT_QB_MM$")>;
1233 def : InstRW<[GenericDSPShort], (instregex "^CMPU_EQ_QB_MM$")>;
1234 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LE_QB_MM$")>;
1235 def : InstRW<[GenericDSPShort], (instregex "^CMPU_LT_QB_MM$")>;
1236 def : InstRW<[GenericDSPShort], (instregex "^CMP_EQ_PH_MM$")>;
1237 def : InstRW<[GenericDSPShort], (instregex "^CMP_LE_PH_MM$")>;
1238 def : InstRW<[GenericDSPShort], (instregex "^CMP_LT_PH_MM$")>;
1239 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_SA_L_W_MM$")>;
1240 def : InstRW<[GenericDSPShort], (instregex "^DPAQ_S_W_PH_MM$")>;
1241 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBL_MM$")>;
1242 def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBR_MM$")>;
1243 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_SA_L_W_MM$")>;
1244 def : InstRW<[GenericDSPShort], (instregex "^DPSQ_S_W_PH_MM$")>;
1245 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBL_MM$")>;
1246 def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBR_MM$")>;
1247 def : InstRW<[GenericDSPShort], (instregex "^EXTPDPV_MM$")>;
1248 def : InstRW<[GenericDSPShort], (instregex "^EXTPDP_MM$")>;
1249 def : InstRW<[GenericDSPShort], (instregex "^EXTPV_MM$")>;
1250 def : InstRW<[GenericDSPShort], (instregex "^EXTP_MM$")>;
1251 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_RS_W_MM$")>;
1252 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_R_W_MM$")>;
1253 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_S_H_MM$")>;
1254 def : InstRW<[GenericDSPShort], (instregex "^EXTRV_W_MM$")>;
1255 def : InstRW<[GenericDSPShort], (instregex "^EXTR_RS_W_MM$")>;
1256 def : InstRW<[GenericDSPShort], (instregex "^EXTR_R_W_MM$")>;
1257 def : InstRW<[GenericDSPShort], (instregex "^EXTR_S_H_MM$")>;
1258 def : InstRW<[GenericDSPShort], (instregex "^EXTR_W_MM$")>;
1259 def : InstRW<[GenericDSPShort], (instregex "^INSV_MM$")>;
1260 def : InstRW<[GenericDSPShort], (instregex "^LBUX_MM$")>;
1261 def : InstRW<[GenericDSPShort], (instregex "^LHX_MM$")>;
1262 def : InstRW<[GenericDSPShort], (instregex "^LWX_MM$")>;
1263 def : InstRW<[GenericDSPShort], (instregex "^MADDU_DSP_MM$")>;
1264 def : InstRW<[GenericDSPShort], (instregex "^MADD_DSP_MM$")>;
1265 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHL_MM$")>;
1266 def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHR_MM$")>;
1267 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHL_MM$")>;
1268 def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHR_MM$")>;
1269 def : InstRW<[GenericDSPShort], (instregex "^MFHI_DSP_MM$")>;
1270 def : InstRW<[GenericDSPShort], (instregex "^MFLO_DSP_MM$")>;
1271 def : InstRW<[GenericDSPShort], (instregex "^MODSUB_MM$")>;
1272 def : InstRW<[GenericDSPShort], (instregex "^MOVEP_MMR6$")>;
1273 def : InstRW<[GenericDSPShort], (instregex "^MOVN_I_MM$")>;
1274 def : InstRW<[GenericDSPShort], (instregex "^MOVZ_I_MM$")>;
1275 def : InstRW<[GenericDSPShort], (instregex "^MSUBU_DSP_MM$")>;
1276 def : InstRW<[GenericDSPShort], (instregex "^MSUB_DSP_MM$")>;
1277 def : InstRW<[GenericDSPShort], (instregex "^MTHI_DSP_MM$")>;
1278 def : InstRW<[GenericDSPShort], (instregex "^MTHLIP_MM$")>;
1279 def : InstRW<[GenericDSPShort], (instregex "^MTLO_DSP_MM$")>;
1280 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHL_MM$")>;
1281 def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHR_MM$")>;
1282 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBL_MM$")>;
1283 def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBR_MM$")>;
1284 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_PH_MM$")>;
1285 def : InstRW<[GenericDSPShort], (instregex "^MULSAQ_S_W_PH_MM$")>;
1286 def : InstRW<[GenericDSPShort], (instregex "^MULTU_DSP_MM$")>;
1287 def : InstRW<[GenericDSPShort], (instregex "^MULT_DSP_MM$")>;
1288 def : InstRW<[GenericDSPShort], (instregex "^PACKRL_PH_MM$")>;
1289 def : InstRW<[GenericDSPShort], (instregex "^PICK_PH_MM$")>;
1290 def : InstRW<[GenericDSPShort], (instregex "^PICK_QB_MM$")>;
1291 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBLA_MM$")>;
1292 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBL_MM$")>;
1293 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBRA_MM$")>;
1294 def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBR_MM$")>;
1295 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHL_MM$")>;
1296 def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHR_MM$")>;
1297 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBLA_MM$")>;
1298 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBL_MM$")>;
1299 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBRA_MM$")>;
1300 def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBR_MM$")>;
1301 def : InstRW<[GenericDSPShort], (instregex "^PRECRQU_S_QB_PH_MM$")>;
1302 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_PH_W_MM$")>;
1303 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_QB_PH_MM$")>;
1304 def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_RS_PH_W_MM$")>;
1305 def : InstRW<[GenericDSPShort], (instregex "^RADDU_W_QB_MM$")>;
1306 def : InstRW<[GenericDSPShort], (instregex "^RDDSP_MM$")>;
1307 def : InstRW<[GenericDSPShort], (instregex "^REPLV_PH_MM$")>;
1308 def : InstRW<[GenericDSPShort], (instregex "^REPLV_QB_MM$")>;
1309 def : InstRW<[GenericDSPShort], (instregex "^REPL_PH_MM$")>;
1310 def : InstRW<[GenericDSPShort], (instregex "^REPL_QB_MM$")>;
1311 def : InstRW<[GenericDSPShort], (instregex "^SHILOV_MM$")>;
1312 def : InstRW<[GenericDSPShort], (instregex "^SHILO_MM$")>;
1313 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_PH_MM$")>;
1314 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_QB_MM$")>;
1315 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_PH_MM$")>;
1316 def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_W_MM$")>;
1317 def : InstRW<[GenericDSPShort], (instregex "^SHLL_PH_MM$")>;
1318 def : InstRW<[GenericDSPShort], (instregex "^SHLL_QB_MM$")>;
1319 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_PH_MM$")>;
1320 def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_W_MM$")>;
1321 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_PH_MM$")>;
1322 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_PH_MM$")>;
1323 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_W_MM$")>;
1324 def : InstRW<[GenericDSPShort], (instregex "^SHRA_PH_MM$")>;
1325 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_PH_MM$")>;
1326 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_W_MM$")>;
1327 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_QB_MM$")>;
1328 def : InstRW<[GenericDSPShort], (instregex "^SHRL_QB_MM$")>;
1329 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_PH_MM$")>;
1330 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_PH_MM$")>;
1331 def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_W_MM$")>;
1332 def : InstRW<[GenericDSPShort], (instregex "^SUBU_QB_MM$")>;
1333 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_QB_MM$")>;
1334 def : InstRW<[GenericDSPShort], (instregex "^WRDSP_MM$")>;
1337 // microMIPS DSP R2 - hasDSP, HasDSPR2, InMicroMips
1338 // ================================================
1340 def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_QB_MMR2$")>;
1341 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_PH_MMR2$")>;
1342 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_PH_MMR2$")>;
1343 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_W_MMR2$")>;
1344 def : InstRW<[GenericDSPShort], (instregex "^ADDQH_W_MMR2$")>;
1345 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_QB_MMR2$")>;
1346 def : InstRW<[GenericDSPShort], (instregex "^ADDUH_R_QB_MMR2$")>;
1347 def : InstRW<[GenericDSPShort], (instregex "^ADDU_PH_MMR2$")>;
1348 def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_PH_MMR2$")>;
1349 def : InstRW<[GenericDSPShort], (instregex "^APPEND_MMR2$")>;
1350 def : InstRW<[GenericDSPShort], (instregex "^BALIGN_MMR2$")>;
1351 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_EQ_QB_MMR2$")>;
1352 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LE_QB_MMR2$")>;
1353 def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LT_QB_MMR2$")>;
1354 def : InstRW<[GenericDSPShort], (instregex "^DPA_W_PH_MMR2$")>;
1355 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_SA_W_PH_MMR2$")>;
1356 def : InstRW<[GenericDSPShort], (instregex "^DPAQX_S_W_PH_MMR2$")>;
1357 def : InstRW<[GenericDSPShort], (instregex "^DPAX_W_PH_MMR2$")>;
1358 def : InstRW<[GenericDSPShort], (instregex "^DPS_W_PH_MMR2$")>;
1359 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_S_W_PH_MMR2$")>;
1360 def : InstRW<[GenericDSPShort], (instregex "^DPSQX_SA_W_PH_MMR2$")>;
1361 def : InstRW<[GenericDSPShort], (instregex "^DPSX_W_PH_MMR2$")>;
1362 def : InstRW<[GenericDSPShort], (instregex "^MUL_PH_MMR2$")>;
1363 def : InstRW<[GenericDSPShort], (instregex "^MUL_S_PH_MMR2$")>;
1364 def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_W_MMR2$")>;
1365 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_PH_MMR2$")>;
1366 def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_W_MMR2$")>;
1367 def : InstRW<[GenericDSPShort], (instregex "^MULSA_W_PH_MMR2$")>;
1368 def : InstRW<[GenericDSPShort], (instregex "^PRECR_QB_PH_MMR2$")>;
1369 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_PH_W_MMR2$")>;
1370 def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_R_PH_W_MMR2$")>;
1371 def : InstRW<[GenericDSPShort], (instregex "^PREPEND_MMR2$")>;
1372 def : InstRW<[GenericDSPShort], (instregex "^SHRA_QB_MMR2$")>;
1373 def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_QB_MMR2$")>;
1374 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_QB_MMR2$")>;
1375 def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_QB_MMR2$")>;
1376 def : InstRW<[GenericDSPShort], (instregex "^SHRL_PH_MMR2$")>;
1377 def : InstRW<[GenericDSPShort], (instregex "^SHRLV_PH_MMR2$")>;
1378 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_PH_MMR2$")>;
1379 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_PH_MMR2$")>;
1380 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_W_MMR2$")>;
1381 def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_W_MMR2$")>;
1382 def : InstRW<[GenericDSPShort], (instregex "^SUBU_PH_MMR2$")>;
1383 def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_PH_MMR2$")>;
1384 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_QB_MMR2$")>;
1385 def : InstRW<[GenericDSPShort], (instregex "^SUBUH_R_QB_MMR2$")>;
1387 // microMIPS DSP R3 - hasDSP, hasDSPR2, hasDSPR3, InMicroMips
1388 // ==========================================================
1390 def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32C_MMR3$")>;
1392 // MIPS MSA ASE - hasMSA
1393 // =====================
1395 def GenericWriteMSAShortLogic : SchedWriteRes<[GenericIssueFPUS]>;
1396 def GenericWriteMSAShortInt : SchedWriteRes<[GenericIssueFPUS]> {
1399 def GenericWriteMoveOtherUnitsToFPU : SchedWriteRes<[GenericIssueFPUS]>;
1400 def GenericWriteMSAOther3 : SchedWriteRes<[GenericIssueFPUS]> {
1403 def GenericWriteMSALongInt : SchedWriteRes<[GenericIssueFPUS]> {
1406 def GenericWriteFPUDivI : SchedWriteRes<[GenericFPQ]> {
1408 let ReleaseAtCycles = [ 33 ];
1411 // FPUS is also used in moves from floating point and MSA registers to general
1412 // purpose registers.
1413 def GenericWriteMoveFPUSToOtherUnits : SchedWriteRes<[GenericIssueFPUS]> {
1417 // FPUL is also used in moves from floating point and MSA registers to general
1418 // purpose registers.
1419 def GenericWriteMoveFPULToOtherUnits : SchedWriteRes<[GenericIssueFPUL]>;
1422 // adds_a.[bhwd], adds_[asu].[bhwd], addvi?.[bhwd], asub_[us].[bhwd],
1423 // aver?_[us].[bhwd]
1424 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADD_A_[BHWD]$")>;
1425 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADDS_[ASU]_[BHWD]$")>;
1427 // TODO: ADDVI_[BHW] might be 1 cycle latency rather than 2. Need to confirm it.
1428 // add.[bhwd], addvi.[bhwd], asub_[us].[bhwd], ave.[bhwd], aver.[bhwd]
1429 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADDVI?_[BHWD]$")>;
1430 def : InstRW<[GenericWriteMSAShortInt], (instregex "^ASUB_[US].[BHWD]$")>;
1431 def : InstRW<[GenericWriteMSAShortInt], (instregex "^AVER?_[US].[BHWD]$")>;
1433 // and.v, andi.b, move.v, ldi.[bhwd], xor.v, nor.v, xori.b, nori.b, lsa
1434 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^MOVE_V$")>;
1435 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^LDI_[BHWD]$")>;
1436 def : InstRW<[GenericWriteMSAShortLogic], (instrs LSA)>;
1437 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)_V$")>;
1438 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)I_B$")>;
1439 def : InstRW<[GenericWriteMSAShortLogic],
1440 (instregex "^(AND|OR|[XN]OR)_V_[DHW]_PSEUDO$")>;
1442 // vshf.[bhwd], binsl.[bhwd], binsr.[bhwd], insert.[bhwd], sld?.[bhwd],
1443 // bset.[bhwd], bclr.[bhwd], bneg.[bhwd], bsel_v, bseli_b
1444 def : InstRW<[GenericWriteMSAShortInt], (instregex "^VSHF_[BHWD]$")>;
1445 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BINSL|BINSLI)_[BHWD]$")>;
1446 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BINSR|BINSRI)_[BHWD]$")>;
1447 def : InstRW<[GenericWriteMSAShortInt], (instregex "^INSERT_[BHWD]$")>;
1448 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(SLD|SLDI)_[BHWD]$")>;
1449 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BSET|BSETI)_[BHWD]$")>;
1450 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BCLR|BCLRI)_[BHWD]$")>;
1451 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BNEG|BNEGI)_[BHWD]$")>;
1452 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BSEL_V|BSELI_B)$")>;
1453 def : InstRW<[GenericWriteMSAShortInt], (instregex "^BMN*Z.*$")>;
1454 def : InstRW<[GenericWriteMSAShortInt],
1455 (instregex "^BSEL_(H|W|D|FW|FD)_PSEUDO$")>;
1457 // pcnt.[bhwd], sat_s.[bhwd], sat_u.[bhwd]
1458 def : InstRW<[GenericWriteMSAOther3], (instregex "^PCNT_[BHWD]$")>;
1459 def : InstRW<[GenericWriteMSAOther3], (instregex "^SAT_(S|U)_[BHWD]$")>;
1461 // bnz.[bhwdv], cfcmsa, ctcmsa
1462 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(BNZ|BZ)_[BHWDV]$")>;
1463 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^C(F|T)CMSA$")>;
1465 // shf.[bhw], fill[bhwd], splat?.[bhwd]
1466 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SHF_[BHW]$")>;
1467 def : InstRW<[GenericWriteMSAShortInt], (instregex "^FILL_[BHWD]$")>;
1468 def : InstRW<[GenericWriteMSAShortInt], (instregex "^(SPLAT|SPLATI)_[BHWD]$")>;
1471 def : InstRW<[GenericWriteFPUS], (instregex "^FEXP2_(W|D)$")>;
1473 // compare, converts, round to int, floating point truncate.
1474 def : InstRW<[GenericWriteFPUS], (instregex "^(CLT|CLTI)_(S|U)_[BHWD]$")>;
1475 def : InstRW<[GenericWriteFPUS], (instregex "^(CLE|CLEI)_(S|U)_[BHWD]$")>;
1476 def : InstRW<[GenericWriteFPUS], (instregex "^(CEQ|CEQI)_[BHWD]$")>;
1477 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_UN_(S|D)$")>;
1478 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_UEQ_(S|D)$")>;
1479 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_EQ_(S|D)$")>;
1480 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_LT_(S|D)$")>;
1481 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_ULT_(S|D)$")>;
1482 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_LE_(S|D)$")>;
1483 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_ULE_(S|D)$")>;
1484 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_F_(D|S)$")>;
1485 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SAF_(D|S)$")>;
1486 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SEQ_(D|S)$")>;
1487 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SLE_(D|S)$")>;
1488 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SLT_(D|S)$")>;
1489 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SUEQ_(D|S)$")>;
1490 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SULE_(D|S)$")>;
1491 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SULT_(D|S)$")>;
1492 def : InstRW<[GenericWriteFPUS], (instregex "^CMP_SUN_(D|S)$")>;
1493 def : InstRW<[GenericWriteFPUS], (instregex "^FS(AF|EQ|LT|LE|NE|OR)_(W|D)$")>;
1494 def : InstRW<[GenericWriteFPUS], (instregex "^FSUEQ_(W|D)$")>;
1495 def : InstRW<[GenericWriteFPUS], (instregex "^FSULE_(W|D)$")>;
1496 def : InstRW<[GenericWriteFPUS], (instregex "^FSULT_(W|D)$")>;
1497 def : InstRW<[GenericWriteFPUS], (instregex "^FSUNE_(W|D)$")>;
1498 def : InstRW<[GenericWriteFPUS], (instregex "^FSUN_(W|D)$")>;
1499 def : InstRW<[GenericWriteFPUS], (instregex "^FCAF_(W|D)$")>;
1500 def : InstRW<[GenericWriteFPUS], (instregex "^FCEQ_(W|D)$")>;
1501 def : InstRW<[GenericWriteFPUS], (instregex "^FCLE_(W|D)$")>;
1502 def : InstRW<[GenericWriteFPUS], (instregex "^FCLT_(W|D)$")>;
1503 def : InstRW<[GenericWriteFPUS], (instregex "^FCNE_(W|D)$")>;
1504 def : InstRW<[GenericWriteFPUS], (instregex "^FCOR_(W|D)$")>;
1505 def : InstRW<[GenericWriteFPUS], (instregex "^FCUEQ_(W|D)$")>;
1506 def : InstRW<[GenericWriteFPUS], (instregex "^FCULE_(W|D)$")>;
1507 def : InstRW<[GenericWriteFPUS], (instregex "^FCULT_(W|D)$")>;
1508 def : InstRW<[GenericWriteFPUS], (instregex "^FCUNE_(W|D)$")>;
1509 def : InstRW<[GenericWriteFPUS], (instregex "^FCUN_(W|D)$")>;
1510 def : InstRW<[GenericWriteFPUS], (instregex "^FABS_(W|D)$")>;
1511 def : InstRW<[GenericWriteFPUS], (instregex "^FFINT_(U|S)_(W|D)$")>;
1512 def : InstRW<[GenericWriteFPUS], (instregex "^FFQL_(W|D)$")>;
1513 def : InstRW<[GenericWriteFPUS], (instregex "^FFQR_(W|D)$")>;
1514 def : InstRW<[GenericWriteFPUS], (instregex "^FTINT_(U|S)_(W|D)$")>;
1515 def : InstRW<[GenericWriteFPUS], (instregex "^FRINT_(W|D)$")>;
1516 def : InstRW<[GenericWriteFPUS], (instregex "^FTQ_(H|W)$")>;
1517 def : InstRW<[GenericWriteFPUS], (instregex "^FTRUNC_(U|S)_(W|D)$")>;
1519 // fexdo.[hw], fexupl.[wd], fexupr.[wd]
1520 def : InstRW<[GenericWriteFPUS], (instregex "^FEXDO_(H|W)$")>;
1521 def : InstRW<[GenericWriteFPUS], (instregex "^FEXUPL_(W|D)$")>;
1522 def : InstRW<[GenericWriteFPUS], (instregex "^FEXUPR_(W|D)$")>;
1524 // fclass.[wd], fmax.[wd], fmax_a.[wd], fmin.[wd], fmin_a.[wd], flog2.[wd]
1525 def : InstRW<[GenericWriteFPUS], (instregex "^FCLASS_(W|D)$")>;
1526 def : InstRW<[GenericWriteFPUS], (instregex "^FMAX_A_(W|D)$")>;
1527 def : InstRW<[GenericWriteFPUS], (instregex "^FMAX_(W|D)$")>;
1528 def : InstRW<[GenericWriteFPUS], (instregex "^FMIN_A_(W|D)$")>;
1529 def : InstRW<[GenericWriteFPUS], (instregex "^FMIN_(W|D)$")>;
1530 def : InstRW<[GenericWriteFPUS], (instregex "^FLOG2_(W|D)$")>;
1532 // interleave right/left, interleave even/odd, insert
1533 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(ILVR|ILVL)_[BHWD]$")>;
1534 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(ILVEV|ILVOD)_[BHWD]$")>;
1536 // subs_?.[bhwd], subsus_?.[bhwd], subsuu_?.[bhwd], subvi.[bhwd], subv.[bhwd],
1537 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBS_(S|U)_[BHWD]$")>;
1538 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBSUS_(S|U)_[BHWD]$")>;
1539 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBSUU_(S|U)_[BHWD]$")>;
1540 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBVI_[BHWD]$")>;
1541 def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBV_[BHWD]$")>;
1543 // mod_[su].[bhwd], div_[su].[bhwd]
1544 def : InstRW<[GenericWriteFPUDivI], (instregex "^MOD_(S|U)_[BHWD]$")>;
1545 def : InstRW<[GenericWriteFPUDivI], (instregex "^DIV_(S|U)_[BHWD]$")>;
1547 // hadd_[su].[bhwd], hsub_[su].[bhwd], max_[sua].[bhwd], min_[sua].[bhwd],
1548 // maxi_[su].[bhwd], mini_[su].[bhwd], sra?.[bhwd], srar?.[bhwd], srlr.[bhwd],
1549 // sll?.[bhwd], pckev.[bhwd], pckod.[bhwd], nloc.[bhwd], nlzc.[bhwd],
1551 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^HADD_(S|U)_[BHWD]$")>;
1552 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^HSUB_(S|U)_[BHWD]$")>;
1553 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_S_[BHWD]$")>;
1554 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_U_[BHWD]$")>;
1555 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_A_[BHWD]$")>;
1556 def : InstRW<[GenericWriteMSAShortLogic],
1557 (instregex "^(MAXI|MINI)_(S|U)_[BHWD]$")>;
1558 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRA|SRAI)_[BHWD]$")>;
1559 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRL|SRLI)_[BHWD]$")>;
1560 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRAR|SRARI)_[BHWD]$")>;
1561 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRLR|SRLRI)_[BHWD]$")>;
1562 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SLL|SLLI)_[BHWD]$")>;
1563 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(PCKEV|PCKOD)_[BHWD]$")>;
1564 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(NLOC|NLZC)_[BHWD]$")>;
1565 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^INSVE_[BHWD]$")>;
1566 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^INSERT_F(D|W)_PSEUDO$")>;
1567 def : InstRW<[GenericWriteMSAShortLogic], (instregex "^FILL_F(D|W)_PSEUDO$")>;
1569 // dpadd_?.[bhwd], dpsub_?.[bhwd], dotp_?.[bhwd], msubv.[bhwd], maddv.[bhwd]
1571 def : InstRW<[GenericWriteMSALongInt], (instregex "^DPADD_(S|U)_[HWD]$")>;
1572 def : InstRW<[GenericWriteMSALongInt], (instregex "^DPSUB_(S|U)_[HWD]$")>;
1573 def : InstRW<[GenericWriteMSALongInt], (instregex "^DOTP_(S|U)_[HWD]$")>;
1574 def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUBV_[BHWD]$")>;
1575 def : InstRW<[GenericWriteMSALongInt], (instregex "^MADDV_[BHWD]$")>;
1576 def : InstRW<[GenericWriteMSALongInt], (instregex "^MULV_[BHWD]$")>;
1578 // madd?.q.[hw], msub?.q.[hw], mul?.q.[hw]
1579 def : InstRW<[GenericWriteMSALongInt], (instregex "^MADDR_Q_[HW]$")>;
1580 def : InstRW<[GenericWriteMSALongInt], (instregex "^MADD_Q_[HW]$")>;
1581 def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUBR_Q_[HW]$")>;
1582 def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUB_Q_[HW]$")>;
1583 def : InstRW<[GenericWriteMSALongInt], (instregex "^MULR_Q_[HW]$")>;
1584 def : InstRW<[GenericWriteMSALongInt], (instregex "^MUL_Q_[HW]$")>;
1586 // fadd.[dw], fmadd.[dw], fmul.[dw], frcp.[dw], frsqrt.[dw], fsqrt.[dw]
1587 // fsub.[dw], fdiv.[dw]
1588 def : InstRW<[GenericWriteFPUL], (instregex "^FADD_[DW]$")>;
1589 def : InstRW<[GenericWriteFPUL], (instregex "^FMADD_[DW]$")>;
1590 def : InstRW<[GenericWriteFPUL], (instregex "^FMSUB_[DW]$")>;
1591 def : InstRW<[GenericWriteFPUL], (instregex "^FMUL_[DW]$")>;
1592 def : InstRW<[GenericWriteFPUL], (instregex "^FRCP_[DW]$")>;
1593 def : InstRW<[GenericWriteFPUL], (instregex "^FRSQRT_[DW]$")>;
1594 def : InstRW<[GenericWriteFPUL], (instregex "^FSQRT_[DW]$")>;
1595 def : InstRW<[GenericWriteFPUL], (instregex "^FSUB_[DW]$")>;
1596 def : InstRW<[GenericWriteFPUL], (instregex "^FDIV_[DW]$")>;
1599 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instregex "^COPY_U_[BHW]$")>;
1600 def : InstRW<[GenericWriteFPUMoveGPRFPU], (instregex "^COPY_S_[BHWD]$")>;
1602 def : InstRW<[GenericWriteFPUStore], (instregex "^ST_[BHWD]$")>;
1603 def : InstRW<[GenericWriteFPUStore], (instrs ST_F16)>;
1604 def : InstRW<[GenericWriteFPULoad], (instregex "^LD_[BHWD]$")>;
1605 def : InstRW<[GenericWriteFPULoad], (instrs LD_F16)>;
1607 // Atomic instructions
1609 // FIXME: Define `WriteAtomic` in the MipsSchedule.td and
1610 // attach it to the Atomic2OpsPostRA, AtomicCmpSwapPostRA, ...
1611 // classes. Then just define resources for the `WriteAtomic` in each
1613 def GenericAtomic : ProcResource<1> { let BufferSize = 1; }
1614 def GenericWriteAtomic : SchedWriteRes<[GenericAtomic]> { let Latency = 2; }
1616 def : InstRW<[GenericWriteAtomic],
1617 (instregex "^ATOMIC_SWAP_I(8|16|32|64)_POSTRA$")>;
1618 def : InstRW<[GenericWriteAtomic],
1619 (instregex "^ATOMIC_CMP_SWAP_I(8|16|32|64)_POSTRA$")>;
1620 def : InstRW<[GenericWriteAtomic],
1621 (instregex "^ATOMIC_LOAD_(ADD|SUB|AND|OR|XOR|NAND|MIN|MAX|UMIN|UMAX)"
1622 "_I(8|16|32|64)_POSTRA$")>;