• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//=- MipsScheduleGeneric.td - Generic Scheduling Definitions -*- tablegen -*-=//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file describes the interAptiv processor in a manner of speaking. It
11// describes a hypothetical version of the in-order MIPS32R2 interAptiv with all
12// branches of the MIPS ISAs, ASEs and ISA variants. The itinerary lists are
13// broken down into per ISA lists, so that this file can be used to rapidly
14// develop new schedule models.
15//
16//===----------------------------------------------------------------------===//
17def MipsGenericModel : SchedMachineModel {
18  int IssueWidth = 1;
19  int MicroOpBufferSize = 0;
20
21  // These figures assume an L1 hit.
22  int LoadLatency = 2;
23  int MispredictPenalty = 4;
24
25  int HighLatency = 37;
26  list<Predicate> UnsupportedFeatures = [];
27
28  let CompleteModel = 0;
29  let PostRAScheduler = 1;
30
31  // FIXME: Remove when all errors have been fixed.
32  let FullInstRWOverlapCheck = 0;
33}
34
35let SchedModel = MipsGenericModel in {
36
37// ALU Pipeline
38// ============
39
40def GenericALU : ProcResource<1> { let BufferSize = 1; }
41def GenericIssueALU : ProcResource<1> { let Super = GenericALU; }
42
43def GenericWriteALU : SchedWriteRes<[GenericIssueALU]>;
44
45// and, lui, nor, or, slti, sltiu, sub, subu, xor
46// add, addi, addiu, addu, andi, ori, rotr, se[bh], sllv?, sr[al]v?, slt, sltu,
47// xori
48def : ItinRW<[GenericWriteALU], [II_ADD, II_ADDU, II_ADDI, II_ADDIU, II_ANDI,
49                                 II_AND, II_ANDI, II_CLO, II_CLZ, II_EXT,
50                                 II_INS, II_LUI, II_MULT, II_MULTU, II_NOR,
51                                 II_ORI, II_OR, II_ROTR, II_ROTRV, II_SEB,
52                                 II_SEH, II_SLTI_SLTIU, II_SLT_SLTU, II_SLL,
53                                 II_SRA, II_SRL, II_SLLV, II_SRAV, II_SRLV,
54                                 II_SSNOP, II_SUB, II_SUBU, II_WSBH, II_XOR,
55                                 II_XORI]>;
56
57def : InstRW<[GenericWriteALU], (instrs COPY)>;
58
59def GenericMDU : ProcResource<1> { let BufferSize = 1; }
60def GenericIssueMDU : ProcResource<1> { let Super = GenericALU; }
61def GenericIssueDIV : ProcResource<1> { let Super = GenericMDU; }
62def GenericWriteHILO : SchedWriteRes<[GenericIssueMDU]>;
63def GenericWriteALULong : SchedWriteRes<[GenericIssueALU]> { let Latency = 5; }
64def GenericWriteMove : SchedWriteRes<[GenericIssueALU]> { let Latency = 2; }
65
66def : ItinRW<[GenericWriteHILO], [II_MADD, II_MADDU, II_MSUB, II_MSUBU]>;
67
68def GenericWriteMDUtoGPR : SchedWriteRes<[GenericIssueMDU]> {
69  let Latency = 5;
70}
71
72def : ItinRW<[GenericWriteMDUtoGPR], [II_MUL]>;
73
74def GenericWriteDIV : SchedWriteRes<[GenericIssueDIV]> {
75  // Estimated worst case
76  let Latency = 33;
77  let ResourceCycles = [33];
78}
79def GenericWriteDIVU : SchedWriteRes<[GenericIssueDIV]> {
80  // Estimated worst case
81  let Latency = 31;
82  let ResourceCycles = [31];
83}
84
85def : ItinRW<[GenericWriteDIV], [II_DIV]>;
86
87def : ItinRW<[GenericWriteDIVU], [II_DIVU]>;
88
89// MIPS64
90// ======
91
92def : ItinRW<[GenericWriteALU], [II_DADDIU, II_DADDU, II_DADDI, II_DADD,
93                                 II_DCLO, II_DCLZ, II_DROTR, II_DROTR32,
94                                 II_DROTRV, II_DSBH, II_DSHD, II_DSLL,
95                                 II_DSLL32, II_DSLLV, II_DSRA, II_DSRA32,
96                                 II_DSRAV, II_DSRL, II_DSRL32, II_DSRLV,
97                                 II_DSUBU, II_DSUB]>;
98
99def : ItinRW<[GenericWriteDIV], [II_DDIV]>;
100
101def : ItinRW<[GenericWriteDIVU], [II_DDIVU]>;
102
103def : ItinRW<[GenericWriteMDUtoGPR], [II_DMUL]>;
104
105def : ItinRW<[GenericWriteHILO], [II_DMULU, II_DMULT, II_DMULTU]>;
106
107// MIPS16e
108// =======
109
110def : ItinRW<[GenericWriteALU], [IIM16Alu, IIPseudo]>;
111
112// microMIPS
113// =========
114
115def : ItinRW<[GenericWriteALU], [II_MOVE, II_LI, II_NOT]>;
116
117// MIPSR6
118// ======
119
120def GenericWriteMul : SchedWriteRes<[GenericIssueMDU]> { let Latency = 4; }
121def : ItinRW<[GenericWriteMul], [II_MUH, II_MUHU, II_MULU]>;
122
123def : ItinRW<[GenericWriteDIV], [II_MOD, II_MODU]>;
124
125def : ItinRW<[GenericWriteALU], [II_ADDIUPC, II_ALIGN, II_ALUIPC, II_AUI,
126                                 II_AUIPC, II_BITSWAP, II_LSA, II_SELCCZ]>;
127
128// MIPS64R6
129// ========
130
131def : ItinRW<[GenericWriteALU], [II_DALIGN, II_DAHI, II_DATI, II_DAUI,
132                               II_DBITSWAP, II_DLSA]>;
133
134def : ItinRW<[GenericWriteMDUtoGPR], [II_DMUH, II_DMUHU]>;
135def : ItinRW<[GenericWriteDIV], [II_DMOD, II_DMODU]>;
136
137// clo, clz, di, mfhi, mflo
138def : ItinRW<[GenericWriteALULong], [II_MFHI_MFLO]>;
139def : ItinRW<[GenericWriteALU], [II_MOVN, II_MOVZ]>;
140def : ItinRW<[GenericWriteMove], [II_MTHI_MTLO, II_RDHWR]>;
141
142
143// CTISTD Pipeline
144// ---------------
145
146def GenericIssueCTISTD : ProcResource<1> { let Super = GenericALU; }
147
148def GenericLDST : ProcResource<1> { let BufferSize = 1; }
149def GenericIssueLDST : ProcResource<1> { let Super = GenericLDST; }
150
151def GenericWriteJump : SchedWriteRes<[GenericIssueCTISTD]>;
152def GenericWriteJumpAndLink : SchedWriteRes<[GenericIssueCTISTD]> {
153  let Latency = 2;
154}
155
156// b, beq, beql, bg[et]z, bl[et]z, bne, bnel, j, syscall, jal, bltzal, jalx,
157// jalr, jr.hb, jr, jalr.hb, jarlc, jialc
158def : ItinRW<[GenericWriteJump], [II_B, II_BCC, II_BCCZ, II_BCCZAL, II_J,
159                                  II_JR, II_JR_HB, II_ERET, II_ERETNC,
160                                  II_DERET]>;
161
162def : ItinRW<[GenericWriteJumpAndLink], [II_JAL, II_JALR, II_JALR_HB,
163                                         II_BC2CCZ]>;
164
165def : ItinRW<[GenericWriteJump], [II_JRC, II_JRADDIUSP]>;
166
167def : ItinRW<[GenericWriteJumpAndLink], [II_BCCZALS, II_JALS, II_JALRS]>;
168
169// MIPSR6
170// ======
171
172def : ItinRW<[GenericWriteJumpAndLink], [II_BALC, II_JALRC, II_JIALC]>;
173
174def : ItinRW<[GenericWriteJump], [II_JIC, II_BC, II_BCCC, II_BCCZC]>;
175
176
177def GenericWriteTrap : SchedWriteRes<[GenericIssueCTISTD]>;
178
179def : ItinRW<[GenericWriteTrap], [II_BREAK, II_SYSCALL, II_TEQ, II_TEQI,
180                                  II_TGE, II_TGEI, II_TGEIU, II_TGEU, II_TNE,
181                                  II_TNEI, II_TLT, II_TLTI, II_TLTU, II_TTLTIU,
182                                  II_TRAP, II_SDBBP]>;
183
184// COP0 Pipeline
185// =============
186
187def GenericCOP0 : ProcResource<1> { let BufferSize = 1; }
188
189def GenericIssueCOP0 : ProcResource<1> { let Super = GenericCOP0; }
190def GenericWriteCOP0TLB : SchedWriteRes<[GenericIssueCOP0]> { let Latency = 4; }
191def GenericWriteCOP0 : SchedWriteRes<[GenericIssueCOP0]> { let Latency = 3; }
192def GenericReadCOP0 : SchedWriteRes<[GenericIssueCOP0]> { let Latency = 2; }
193def GenericReadWritePGPR : SchedWriteRes<[GenericIssueCOP0]>;
194def GenericReadWriteCOP0Long : SchedWriteRes<[GenericIssueCOP0]> {
195  let Latency = 5;
196}
197def GenericWriteCOP0Short : SchedWriteRes<[GenericIssueCOP0]>;
198
199def : ItinRW<[GenericWriteCOP0TLB], [II_TLBP, II_TLBR, II_TLBWI, II_TLBWR]>;
200def : ItinRW<[GenericWriteCOP0TLB], [II_TLBINV, II_TLBINVF]>;
201
202def : ItinRW<[GenericReadCOP0], [II_MFC0]>;
203def : ItinRW<[GenericWriteCOP0], [II_MTC0]>;
204
205def : ItinRW<[GenericWriteCOP0], [II_EVP, II_DVP]>;
206
207// MIPSR5
208// ======
209def : ItinRW<[GenericReadCOP0], [II_MFHC0]>;
210def : ItinRW<[GenericWriteCOP0], [II_MTHC0]>;
211
212// MIPS64
213// ======
214
215def : ItinRW<[GenericReadCOP0], [II_DMFC0]>;
216def : ItinRW<[GenericWriteCOP0], [II_DMTC0]>;
217
218def : ItinRW<[GenericWriteCOP0], [II_RDPGPR, II_WRPGPR]>;
219
220def : ItinRW<[GenericWriteCOP0], [II_DI, II_EI]>;
221
222def : ItinRW<[GenericWriteCOP0], [II_EHB, II_PAUSE, II_WAIT]>;
223
224def GenericCOP2 : ProcResource<1> { let BufferSize = 1; }
225def GenericWriteCOPOther : SchedWriteRes<[GenericCOP2]>;
226
227def : ItinRW<[GenericWriteCOPOther], [II_MFC2, II_MTC2, II_DMFC2, II_DMTC2]>;
228
229// LDST Pipeline
230// -------------
231
232def GenericWriteLoad : SchedWriteRes<[GenericIssueLDST]> {
233  let Latency = 2;
234}
235
236def GenericWritePref : SchedWriteRes<[GenericIssueLDST]>;
237def GenericWriteSync : SchedWriteRes<[GenericIssueLDST]>;
238def GenericWriteCache : SchedWriteRes<[GenericIssueLDST]> { let Latency = 5; }
239
240def GenericWriteStore : SchedWriteRes<[GenericIssueLDST]>;
241def GenericWriteStoreSC : SchedWriteRes<[GenericIssueLDST]> { let Latency = 2; }
242
243def GenericWriteGPRFromBypass : SchedWriteRes<[GenericIssueLDST]> {
244  let Latency = 2;
245}
246
247def GenericWriteStoreFromOtherUnits : SchedWriteRes<[GenericIssueLDST]>;
248def GenericWriteLoadToOtherUnits : SchedWriteRes<[GenericIssueLDST]> {
249  let Latency = 0;
250}
251
252// l[bhw], l[bh]u, ll
253def : ItinRW<[GenericWriteLoad], [II_LB, II_LBU, II_LH, II_LHU, II_LW, II_LL,
254                                  II_LWC2, II_LWC3, II_LDC2, II_LDC3]>;
255
256// lw[lr]
257def : ItinRW<[GenericWriteLoad], [II_LWL, II_LWR]>;
258
259// MIPS64 loads
260def : ItinRW<[GenericWriteLoad], [II_LD, II_LLD, II_LWU]>;
261
262// ld[lr]
263def : ItinRW<[GenericWriteLoad], [II_LDL, II_LDR]>;
264
265// MIPS32 EVA
266def : ItinRW<[GenericWriteLoad], [II_LBE, II_LBUE, II_LHE, II_LHUE, II_LWE,
267                                  II_LLE]>;
268
269def : ItinRW<[GenericWriteLoad], [II_LWLE, II_LWRE]>;
270
271// MIPS MT instructions
272// ====================
273
274def : ItinRW<[GenericWriteMove], [II_DMT, II_DVPE, II_EMT, II_EVPE, II_MFTR,
275                                  II_MTTR]>;
276
277def : ItinRW<[GenericReadWriteCOP0Long], [II_YIELD]>;
278
279def : ItinRW<[GenericWriteCOP0Short], [II_FORK]>;
280
281// MIPS32R6 and MIPS16e
282// ====================
283
284def : ItinRW<[GenericWriteLoad], [II_LWPC]>;
285
286// MIPS64R6
287// ====================
288
289def : ItinRW<[GenericWriteLoad], [II_LWUPC, II_LDPC]>;
290
291
292// s[bhw], sc, s[dw]c[23]
293def : ItinRW<[GenericWriteStore], [II_SB, II_SH, II_SW, II_SWC2, II_SWC3,
294                                   II_SDC2, II_SDC3]>;
295
296def : ItinRW<[GenericWriteStoreSC], [II_SC]>;
297
298// PreMIPSR6 sw[lr]
299def : ItinRW<[GenericWriteStore], [II_SWL, II_SWR]>;
300
301// EVA ASE stores
302def : ItinRW<[GenericWriteStore], [II_SBE, II_SHE, II_SWE, II_SCE]>;
303
304def : ItinRW<[GenericWriteStore], [II_SWLE, II_SWRE]>;
305
306// MIPS64
307// ======
308
309def : ItinRW<[GenericWriteStore], [II_SD, II_SCD]>;
310
311// PreMIPSR6 stores
312// ================
313
314def : ItinRW<[GenericWriteStore], [II_SDL, II_SDR]>;
315
316// MIPS16e
317// =======
318
319def : ItinRW<[GenericWriteLoad], [II_RESTORE]>;
320
321def : ItinRW<[GenericWriteStore], [II_SAVE]>;
322
323// microMIPS
324// =========
325
326def : ItinRW<[GenericWriteLoad], [II_LWM, II_LWP, II_LWXS]>;
327
328def : ItinRW<[GenericWriteStore], [II_SWM, II_SWP]>;
329
330// pref
331def : ItinRW<[GenericWritePref], [II_PREF]>;
332
333def : ItinRW<[GenericWritePref], [II_PREFE]>;
334
335// cache
336def : ItinRW<[GenericWriteCache], [II_CACHE]>;
337
338def : ItinRW<[GenericWriteCache], [II_CACHEE]>;
339
340// sync
341def : ItinRW<[GenericWriteSync], [II_SYNC]>;
342
343def : ItinRW<[GenericWriteSync], [II_SYNCI]>;
344
345// FPU Pipelines
346// =============
347
348def GenericFPQ : ProcResource<1> { let BufferSize = 1; }
349def GenericIssueFPUS : ProcResource<1> { let Super = GenericFPQ; }
350def GenericIssueFPUL : ProcResource<1> { let Super = GenericFPQ; }
351def GenericIssueFPULoad : ProcResource<1> { let Super = GenericFPQ; }
352def GenericIssueFPUStore : ProcResource<1> { let Super = GenericFPQ; }
353def GenericIssueFPUMove : ProcResource<1> { let Super = GenericFPQ; }
354def GenericFPUDivSqrt : ProcResource<1> { let Super = GenericFPQ; }
355
356// The floating point compare of the 24k series including interAptiv has a
357// listed latency of 1-2. Using the higher latency here.
358
359def GenericWriteFPUCmp : SchedWriteRes<[GenericIssueFPUS]> { let Latency = 2; }
360def GenericWriteFPUS : SchedWriteRes<[GenericIssueFPUS]> { let Latency = 4; }
361def GenericWriteFPUL : SchedWriteRes<[GenericIssueFPUL]> { let Latency = 5; }
362def GenericWriteFPUStore : SchedWriteRes<[GenericIssueFPUStore]> { let
363  Latency = 1;
364}
365def GenericWriteFPULoad : SchedWriteRes<[GenericIssueFPULoad]> {
366  let Latency = 2;
367}
368def GenericWriteFPUMoveFP : SchedWriteRes<[GenericIssueFPUMove]> {
369  let Latency = 4;
370}
371def GenericWriteFPUMoveGPRFPU : SchedWriteRes<[GenericIssueFPUMove]> {
372  let Latency = 2;
373}
374def GenericWriteFPUDivS : SchedWriteRes<[GenericFPUDivSqrt]> {
375  let Latency = 17;
376  let ResourceCycles = [ 14 ];
377}
378def GenericWriteFPUDivD : SchedWriteRes<[GenericFPUDivSqrt]> {
379  let Latency = 32;
380  let ResourceCycles = [ 29 ];
381}
382def GenericWriteFPURcpS : SchedWriteRes<[GenericFPUDivSqrt]> {
383  let Latency = 13;
384  let ResourceCycles = [ 10 ];
385}
386def GenericWriteFPURcpD : SchedWriteRes<[GenericFPUDivSqrt]> {
387  let Latency = 25;
388  let ResourceCycles = [ 21 ];
389}
390def GenericWriteFPURsqrtS : SchedWriteRes<[GenericFPUDivSqrt]> {
391  let Latency = 17;
392  let ResourceCycles = [ 14 ];
393}
394def GenericWriteFPURsqrtD : SchedWriteRes<[GenericFPUDivSqrt]> {
395  let Latency = 32;
396  let ResourceCycles = [ 29 ];
397}
398def GenericWriteFPUSqrtS : SchedWriteRes<[GenericFPUDivSqrt]> {
399  let Latency = 17;
400  let ResourceCycles = [ 14 ];
401}
402def GenericWriteFPUSqrtD : SchedWriteRes<[GenericFPUDivSqrt]> {
403  let Latency = 29;
404  let ResourceCycles = [ 29 ];
405}
406
407// Floating point compare and branch
408// ---------------------------------
409//
410// c.<cc>.[ds], bc1[tf], bc1[tf]l
411def : ItinRW<[GenericWriteFPUCmp], [II_C_CC_D, II_C_CC_S, II_BC1F, II_BC1T,
412                                    II_BC1FL, II_BC1TL]>;
413
414def : ItinRW<[GenericWriteFPUCmp], [II_CMP_CC_D, II_CMP_CC_S]>;
415
416// Short Pipe
417// ----------
418//
419// abs.[ds], abs.ps, add.[ds], neg.[ds], neg.ps, madd.s, msub.s, nmadd,s
420// nmsub.s, sub.[ds], mul.s
421
422def : ItinRW<[GenericWriteFPUS], [II_ABS, II_ADD_D, II_ADD_S, II_MADD_S,
423                                  II_MSUB_S, II_MUL_S, II_NEG, II_NMADD_S,
424                                  II_NMSUB_S, II_SUB_S, II_SUB_D]>;
425// mov[tf].[ds]
426
427def : ItinRW<[GenericWriteFPUS], [II_MOVF_S, II_MOVF_D, II_MOVT_S, II_MOVT_D]>;
428
429// MIPSR6
430// ------
431//
432// sel(eq|ne).[ds], max.[ds], maxa.[ds], min.[ds], mina.[ds], class.[ds]
433def : ItinRW<[GenericWriteFPUS], [II_SELCCZ_S, II_SELCCZ_D, II_MAX_S,
434                                  II_MAX_D, II_MAXA_S, II_MAXA_D, II_MIN_S,
435                                  II_MIN_D, II_MINA_S, II_MINA_D, II_CLASS_S,
436                                  II_CLASS_D]>;
437
438// Long Pipe
439// ----------
440//
441// nmadd.d, nmsub.d, mul.[ds], mul.ps, ceil.[wl].[sd], cvt.d.[sw], cvt.s.[dw],
442// cvt.w.[sd], cvt.[sw].ps, trunc.w.[ds], trunc.w.ps, floor.[ds],
443// round.[lw].[ds], floor.[lw].ds
444
445// madd.d, msub.dm mul.d, mul.ps, nmadd.d, nmsub.d, ceil.[wl].[sd], cvt.d.[sw],
446// cvt.s.[dw], cvt.w.[sd], cvt.[sw].ps, round.[lw].[ds], floor.[lw].ds,
447// trunc.w.[ds], trunc.w.ps,
448def : ItinRW<[GenericWriteFPUL], [II_MADD_D, II_MSUB_D, II_MUL_D, II_NMADD_D,
449                                  II_NMSUB_D, II_CEIL, II_CVT,
450                                  II_FLOOR, II_ROUND, II_TRUNC]>;
451
452// div.[ds], div.ps
453def : ItinRW<[GenericWriteFPUDivS], [II_DIV_S]>;
454def : ItinRW<[GenericWriteFPUDivD], [II_DIV_D]>;
455
456// sqrt.[ds], sqrt.ps
457def : ItinRW<[GenericWriteFPUSqrtS], [II_SQRT_S]>;
458def : ItinRW<[GenericWriteFPUSqrtD], [II_SQRT_D]>;
459
460// rsqrt.[ds], recip.[ds]
461def : ItinRW<[GenericWriteFPURcpS], [II_RECIP_S, II_RSQRT_S]>;
462def : ItinRW<[GenericWriteFPURcpD], [II_RECIP_D, II_RSQRT_D]>;
463
464// MIPSR6
465// ======
466//
467// rint.[ds]
468def : ItinRW<[GenericWriteFPUL], [II_RINT_S, II_RINT_D]>;
469
470// Load Pipe
471// ---------
472
473// ctc1, mtc1, mthc1, cfc1, mfc1, mfhc1
474def : ItinRW<[GenericWriteFPUMoveGPRFPU], [II_CFC1, II_CTC1, II_MFC1, II_MFHC1,
475                                           II_MTC1, II_MTHC1]>;
476
477// swc1, swxc1
478def : ItinRW<[GenericWriteFPUStore], [II_SDC1, II_SDXC1, II_SUXC1, II_SWC1,
479                                      II_SWXC1]>;
480
481// movn.[ds], movz.[ds]
482def : ItinRW<[GenericWriteFPUMoveFP], [II_MOV_D, II_MOV_S, II_MOVF, II_MOVT,
483                                       II_MOVN_D, II_MOVN_S, II_MOVZ_D,
484                                       II_MOVZ_S]>;
485
486// l[dw]x?c1
487def : ItinRW<[GenericWriteFPULoad], [II_LDC1, II_LDXC1, II_LUXC1, II_LWC1,
488                                     II_LWXC1]>;
489
490// MIPS64
491// ======
492
493def : ItinRW<[GenericWriteFPUMoveGPRFPU], [II_DMFC1, II_DMTC1]>;
494
495// MIPSR6
496// ======
497
498def : ItinRW<[GenericWriteFPUS], [II_MADDF_S, II_MSUBF_S]>;
499
500def : ItinRW<[GenericWriteFPUS], [II_MADDF_D, II_MSUBF_D]>;
501
502def : ItinRW<[GenericWriteFPUCmp], [II_BC1CCZ, II_SEL_D, II_SEL_S]>;
503
504// Cavium Networks MIPS (cnMIPS) - Octeon, HasCnMips
505// =================================================
506
507def : ItinRW<[GenericWriteALU], [II_SEQ_SNE, II_SEQI_SNEI, II_POP, II_BADDU,
508                                 II_BBIT]>;
509
510// MIPS DSP ASE, HasDSP
511// ====================
512
513def GenericDSP : ProcResource<1> { let BufferSize = 1; }
514def GenericDSPShort : SchedWriteRes<[GenericDSP]> { let Latency = 2; }
515def GenericDSPLong : SchedWriteRes<[GenericDSP]> { let Latency = 6; }
516def GenericDSPBypass : SchedWriteRes<[GenericDSP]> { let Latency = 1; }
517def GenericDSPMTHILO : SchedWriteRes<[GenericDSP]> { let Latency = 5; }
518def GenericDSPLoad : SchedWriteRes<[GenericDSP]> { let Latency = 4; }
519def GenericDSPMTHLIP : SchedWriteRes<[GenericDSP]> { let Latency = 5; }
520
521def : InstRW<[GenericDSPLong], (instregex "^EXTRV_RS_W$")>;
522def : InstRW<[GenericDSPLong], (instregex "^EXTRV_R_W$")>;
523def : InstRW<[GenericDSPLong], (instregex "^EXTRV_S_H$")>;
524def : InstRW<[GenericDSPLong], (instregex "^EXTRV_W$")>;
525def : InstRW<[GenericDSPLong], (instregex "^EXTR_RS_W$")>;
526def : InstRW<[GenericDSPLong], (instregex "^EXTR_R_W$")>;
527def : InstRW<[GenericDSPLong], (instregex "^EXTR_S_H$")>;
528def : InstRW<[GenericDSPLong], (instregex "^EXTR_W$")>;
529def : InstRW<[GenericDSPLong], (instregex "^INSV$")>;
530
531def : InstRW<[GenericDSPMTHLIP], (instregex "^MTHLIP$")>;
532def : InstRW<[GenericDSPMTHILO], (instregex "^MTHI_DSP$")>;
533def : InstRW<[GenericDSPMTHILO], (instregex "^MTLO_DSP$")>;
534
535def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_PH$")>;
536def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_W$")>;
537def : InstRW<[GenericDSPShort], (instregex "^ADDQ_PH$")>;
538def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_PH$")>;
539def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_W$")>;
540def : InstRW<[GenericDSPShort], (instregex "^ADDSC$")>;
541def : InstRW<[GenericDSPShort], (instregex "^ADDU_QB$")>;
542def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_QB$")>;
543def : InstRW<[GenericDSPShort], (instregex "^ADDWC$")>;
544def : InstRW<[GenericDSPShort], (instregex "^BITREV$")>;
545def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32$")>;
546def : InstRW<[GenericDSPShort], (instregex "^CMPGU_EQ_QB$")>;
547def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LE_QB$")>;
548def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LT_QB$")>;
549def : InstRW<[GenericDSPShort], (instregex "^CMPU_EQ_QB$")>;
550def : InstRW<[GenericDSPShort], (instregex "^CMPU_LE_QB$")>;
551def : InstRW<[GenericDSPShort], (instregex "^CMPU_LT_QB$")>;
552def : InstRW<[GenericDSPShort], (instregex "^CMP_EQ_PH$")>;
553def : InstRW<[GenericDSPShort], (instregex "^CMP_LE_PH$")>;
554def : InstRW<[GenericDSPShort], (instregex "^CMP_LT_PH$")>;
555def : InstRW<[GenericDSPShort], (instregex "^DPAQ_SA_L_W$")>;
556def : InstRW<[GenericDSPShort], (instregex "^DPAQ_S_W_PH$")>;
557def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBL$")>;
558def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBR$")>;
559def : InstRW<[GenericDSPShort], (instregex "^DPSQ_SA_L_W$")>;
560def : InstRW<[GenericDSPShort], (instregex "^DPSQ_S_W_PH$")>;
561def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBL$")>;
562def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBR$")>;
563def : InstRW<[GenericDSPShort], (instregex "^EXTPDPV$")>;
564def : InstRW<[GenericDSPShort], (instregex "^EXTPDP$")>;
565def : InstRW<[GenericDSPShort], (instregex "^EXTPV$")>;
566def : InstRW<[GenericDSPShort], (instregex "^EXTP$")>;
567def : InstRW<[GenericDSPShort], (instregex "^LBUX$")>;
568def : InstRW<[GenericDSPShort], (instregex "^LHX$")>;
569def : InstRW<[GenericDSPShort], (instregex "^LWX$")>;
570def : InstRW<[GenericDSPShort], (instregex "^MADDU_DSP$")>;
571def : InstRW<[GenericDSPShort], (instregex "^MADD_DSP$")>;
572def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHL$")>;
573def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHR$")>;
574def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHL$")>;
575def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHR$")>;
576def : InstRW<[GenericDSPShort], (instregex "^MFHI_DSP$")>;
577def : InstRW<[GenericDSPShort], (instregex "^MFLO_DSP$")>;
578def : InstRW<[GenericDSPShort], (instregex "^MODSUB$")>;
579def : InstRW<[GenericDSPShort], (instregex "^MSUBU_DSP$")>;
580def : InstRW<[GenericDSPShort], (instregex "^MSUB_DSP$")>;
581def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHL$")>;
582def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHR$")>;
583def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBL$")>;
584def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBR$")>;
585def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_PH$")>;
586def : InstRW<[GenericDSPShort], (instregex "^MULSAQ_S_W_PH$")>;
587def : InstRW<[GenericDSPShort], (instregex "^MULTU_DSP$")>;
588def : InstRW<[GenericDSPShort], (instregex "^MULT_DSP$")>;
589def : InstRW<[GenericDSPShort], (instregex "^PACKRL_PH$")>;
590def : InstRW<[GenericDSPShort], (instregex "^PICK_PH$")>;
591def : InstRW<[GenericDSPShort], (instregex "^PICK_QB$")>;
592def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBLA$")>;
593def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBL$")>;
594def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBRA$")>;
595def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBR$")>;
596def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHL$")>;
597def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHR$")>;
598def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBLA$")>;
599def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBL$")>;
600def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBRA$")>;
601def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBR$")>;
602def : InstRW<[GenericDSPShort], (instregex "^PRECRQU_S_QB_PH$")>;
603def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_PH_W$")>;
604def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_QB_PH$")>;
605def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_RS_PH_W$")>;
606def : InstRW<[GenericDSPShort], (instregex "^RADDU_W_QB$")>;
607def : InstRW<[GenericDSPShort], (instregex "^RDDSP$")>;
608def : InstRW<[GenericDSPShort], (instregex "^REPLV_PH$")>;
609def : InstRW<[GenericDSPShort], (instregex "^REPLV_QB$")>;
610def : InstRW<[GenericDSPShort], (instregex "^REPL_PH$")>;
611def : InstRW<[GenericDSPShort], (instregex "^REPL_QB$")>;
612def : InstRW<[GenericDSPShort], (instregex "^SHILOV$")>;
613def : InstRW<[GenericDSPShort], (instregex "^SHILO$")>;
614def : InstRW<[GenericDSPShort], (instregex "^SHLLV_PH$")>;
615def : InstRW<[GenericDSPShort], (instregex "^SHLLV_QB$")>;
616def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_PH$")>;
617def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_W$")>;
618def : InstRW<[GenericDSPShort], (instregex "^SHLL_PH$")>;
619def : InstRW<[GenericDSPShort], (instregex "^SHLL_QB$")>;
620def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_PH$")>;
621def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_W$")>;
622def : InstRW<[GenericDSPShort], (instregex "^SHRAV_PH$")>;
623def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_PH$")>;
624def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_W$")>;
625def : InstRW<[GenericDSPShort], (instregex "^SHRA_PH$")>;
626def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_PH$")>;
627def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_W$")>;
628def : InstRW<[GenericDSPShort], (instregex "^SHRLV_QB$")>;
629def : InstRW<[GenericDSPShort], (instregex "^SHRL_QB$")>;
630def : InstRW<[GenericDSPShort], (instregex "^SUBQ_PH$")>;
631def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_PH$")>;
632def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_W$")>;
633def : InstRW<[GenericDSPShort], (instregex "^SUBU_QB$")>;
634def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_QB$")>;
635def : InstRW<[GenericDSPShort], (instregex "^WRDSP$")>;
636
637// MIPS DSP R2 - hasDSP, HasDSPR2, InMicroMips
638// ===========================================
639
640def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_QB$")>;
641def : InstRW<[GenericDSPShort], (instregex "^ADDQH_PH$")>;
642def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_PH$")>;
643def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_W$")>;
644def : InstRW<[GenericDSPShort], (instregex "^ADDQH_W$")>;
645def : InstRW<[GenericDSPShort], (instregex "^ADDUH_QB$")>;
646def : InstRW<[GenericDSPShort], (instregex "^ADDUH_R_QB$")>;
647def : InstRW<[GenericDSPShort], (instregex "^ADDU_PH$")>;
648def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_PH$")>;
649def : InstRW<[GenericDSPShort], (instregex "^APPEND$")>;
650def : InstRW<[GenericDSPShort], (instregex "^BALIGN$")>;
651def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_EQ_QB$")>;
652def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LE_QB$")>;
653def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LT_QB$")>;
654def : InstRW<[GenericDSPShort], (instregex "^DPA_W_PH$")>;
655def : InstRW<[GenericDSPShort], (instregex "^DPAQX_SA_W_PH$")>;
656def : InstRW<[GenericDSPShort], (instregex "^DPAQX_S_W_PH$")>;
657def : InstRW<[GenericDSPShort], (instregex "^DPAX_W_PH$")>;
658def : InstRW<[GenericDSPShort], (instregex "^DPS_W_PH$")>;
659def : InstRW<[GenericDSPShort], (instregex "^DPSQX_S_W_PH$")>;
660def : InstRW<[GenericDSPShort], (instregex "^DPSQX_SA_W_PH$")>;
661def : InstRW<[GenericDSPShort], (instregex "^DPSX_W_PH$")>;
662def : InstRW<[GenericDSPShort], (instregex "^MUL_PH$")>;
663def : InstRW<[GenericDSPShort], (instregex "^MUL_S_PH$")>;
664def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_W$")>;
665def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_PH$")>;
666def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_W$")>;
667def : InstRW<[GenericDSPShort], (instregex "^MULSA_W_PH$")>;
668def : InstRW<[GenericDSPShort], (instregex "^PRECR_QB_PH$")>;
669def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_PH_W$")>;
670def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_R_PH_W$")>;
671def : InstRW<[GenericDSPShort], (instregex "^PREPEND$")>;
672def : InstRW<[GenericDSPShort], (instregex "^SHRA_QB$")>;
673def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_QB$")>;
674def : InstRW<[GenericDSPShort], (instregex "^SHRAV_QB$")>;
675def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_QB$")>;
676def : InstRW<[GenericDSPShort], (instregex "^SHRL_PH$")>;
677def : InstRW<[GenericDSPShort], (instregex "^SHRLV_PH$")>;
678def : InstRW<[GenericDSPShort], (instregex "^SUBQH_PH$")>;
679def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_PH$")>;
680def : InstRW<[GenericDSPShort], (instregex "^SUBQH_W$")>;
681def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_W$")>;
682def : InstRW<[GenericDSPShort], (instregex "^SUBU_PH$")>;
683def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_PH$")>;
684def : InstRW<[GenericDSPShort], (instregex "^SUBUH_QB$")>;
685def : InstRW<[GenericDSPShort], (instregex "^SUBUH_R_QB$")>;
686
687// microMIPS DSP R1 - HasDSP, InMicroMips
688// ======================================
689
690def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_PH_MM$")>;
691def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_W_MM$")>;
692def : InstRW<[GenericDSPShort], (instregex "^ADDQ_PH_MM$")>;
693def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_PH_MM$")>;
694def : InstRW<[GenericDSPShort], (instregex "^ADDQ_S_W_MM$")>;
695def : InstRW<[GenericDSPShort], (instregex "^ADDSC_MM$")>;
696def : InstRW<[GenericDSPShort], (instregex "^ADDU_QB_MM$")>;
697def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_QB_MM$")>;
698def : InstRW<[GenericDSPShort], (instregex "^ADDWC_MM$")>;
699def : InstRW<[GenericDSPShort], (instregex "^BITREV_MM$")>;
700def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32_MM$")>;
701def : InstRW<[GenericDSPShort], (instregex "^CMPGU_EQ_QB_MM$")>;
702def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LE_QB_MM$")>;
703def : InstRW<[GenericDSPShort], (instregex "^CMPGU_LT_QB_MM$")>;
704def : InstRW<[GenericDSPShort], (instregex "^CMPU_EQ_QB_MM$")>;
705def : InstRW<[GenericDSPShort], (instregex "^CMPU_LE_QB_MM$")>;
706def : InstRW<[GenericDSPShort], (instregex "^CMPU_LT_QB_MM$")>;
707def : InstRW<[GenericDSPShort], (instregex "^CMP_EQ_PH_MM$")>;
708def : InstRW<[GenericDSPShort], (instregex "^CMP_LE_PH_MM$")>;
709def : InstRW<[GenericDSPShort], (instregex "^CMP_LT_PH_MM$")>;
710def : InstRW<[GenericDSPShort], (instregex "^DPAQ_SA_L_W_MM$")>;
711def : InstRW<[GenericDSPShort], (instregex "^DPAQ_S_W_PH_MM$")>;
712def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBL_MM$")>;
713def : InstRW<[GenericDSPShort], (instregex "^DPAU_H_QBR_MM$")>;
714def : InstRW<[GenericDSPShort], (instregex "^DPSQ_SA_L_W_MM$")>;
715def : InstRW<[GenericDSPShort], (instregex "^DPSQ_S_W_PH_MM$")>;
716def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBL_MM$")>;
717def : InstRW<[GenericDSPShort], (instregex "^DPSU_H_QBR_MM$")>;
718def : InstRW<[GenericDSPShort], (instregex "^EXTPDPV_MM$")>;
719def : InstRW<[GenericDSPShort], (instregex "^EXTPDP_MM$")>;
720def : InstRW<[GenericDSPShort], (instregex "^EXTPV_MM$")>;
721def : InstRW<[GenericDSPShort], (instregex "^EXTP_MM$")>;
722def : InstRW<[GenericDSPShort], (instregex "^EXTRV_RS_W_MM$")>;
723def : InstRW<[GenericDSPShort], (instregex "^EXTRV_R_W_MM$")>;
724def : InstRW<[GenericDSPShort], (instregex "^EXTRV_S_H_MM$")>;
725def : InstRW<[GenericDSPShort], (instregex "^EXTRV_W_MM$")>;
726def : InstRW<[GenericDSPShort], (instregex "^EXTR_RS_W_MM$")>;
727def : InstRW<[GenericDSPShort], (instregex "^EXTR_R_W_MM$")>;
728def : InstRW<[GenericDSPShort], (instregex "^EXTR_S_H_MM$")>;
729def : InstRW<[GenericDSPShort], (instregex "^EXTR_W_MM$")>;
730def : InstRW<[GenericDSPShort], (instregex "^INSV_MM$")>;
731def : InstRW<[GenericDSPShort], (instregex "^LBUX_MM$")>;
732def : InstRW<[GenericDSPShort], (instregex "^LHX_MM$")>;
733def : InstRW<[GenericDSPShort], (instregex "^LWX_MM$")>;
734def : InstRW<[GenericDSPShort], (instregex "^MADDU_DSP_MM$")>;
735def : InstRW<[GenericDSPShort], (instregex "^MADD_DSP_MM$")>;
736def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHL_MM$")>;
737def : InstRW<[GenericDSPShort], (instregex "^MAQ_SA_W_PHR_MM$")>;
738def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHL_MM$")>;
739def : InstRW<[GenericDSPShort], (instregex "^MAQ_S_W_PHR_MM$")>;
740def : InstRW<[GenericDSPShort], (instregex "^MFHI_DSP_MM$")>;
741def : InstRW<[GenericDSPShort], (instregex "^MFLO_DSP_MM$")>;
742def : InstRW<[GenericDSPShort], (instregex "^MODSUB_MM$")>;
743def : InstRW<[GenericDSPShort], (instregex "^MOVEP_MM$")>;
744def : InstRW<[GenericDSPShort], (instregex "^MOVEP_MMR6$")>;
745def : InstRW<[GenericDSPShort], (instregex "^MOVN_I_MM$")>;
746def : InstRW<[GenericDSPShort], (instregex "^MOVZ_I_MM$")>;
747def : InstRW<[GenericDSPShort], (instregex "^MSUBU_DSP_MM$")>;
748def : InstRW<[GenericDSPShort], (instregex "^MSUB_DSP_MM$")>;
749def : InstRW<[GenericDSPShort], (instregex "^MTHI_DSP_MM$")>;
750def : InstRW<[GenericDSPShort], (instregex "^MTHLIP_MM$")>;
751def : InstRW<[GenericDSPShort], (instregex "^MTLO_DSP_MM$")>;
752def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHL_MM$")>;
753def : InstRW<[GenericDSPShort], (instregex "^MULEQ_S_W_PHR_MM$")>;
754def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBL_MM$")>;
755def : InstRW<[GenericDSPShort], (instregex "^MULEU_S_PH_QBR_MM$")>;
756def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_PH_MM$")>;
757def : InstRW<[GenericDSPShort], (instregex "^MULSAQ_S_W_PH_MM$")>;
758def : InstRW<[GenericDSPShort], (instregex "^MULTU_DSP_MM$")>;
759def : InstRW<[GenericDSPShort], (instregex "^MULT_DSP_MM$")>;
760def : InstRW<[GenericDSPShort], (instregex "^PACKRL_PH_MM$")>;
761def : InstRW<[GenericDSPShort], (instregex "^PICK_PH_MM$")>;
762def : InstRW<[GenericDSPShort], (instregex "^PICK_QB_MM$")>;
763def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBLA_MM$")>;
764def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBL_MM$")>;
765def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBRA_MM$")>;
766def : InstRW<[GenericDSPShort], (instregex "^PRECEQU_PH_QBR_MM$")>;
767def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHL_MM$")>;
768def : InstRW<[GenericDSPShort], (instregex "^PRECEQ_W_PHR_MM$")>;
769def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBLA_MM$")>;
770def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBL_MM$")>;
771def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBRA_MM$")>;
772def : InstRW<[GenericDSPShort], (instregex "^PRECEU_PH_QBR_MM$")>;
773def : InstRW<[GenericDSPShort], (instregex "^PRECRQU_S_QB_PH_MM$")>;
774def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_PH_W_MM$")>;
775def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_QB_PH_MM$")>;
776def : InstRW<[GenericDSPShort], (instregex "^PRECRQ_RS_PH_W_MM$")>;
777def : InstRW<[GenericDSPShort], (instregex "^RADDU_W_QB_MM$")>;
778def : InstRW<[GenericDSPShort], (instregex "^RDDSP_MM$")>;
779def : InstRW<[GenericDSPShort], (instregex "^REPLV_PH_MM$")>;
780def : InstRW<[GenericDSPShort], (instregex "^REPLV_QB_MM$")>;
781def : InstRW<[GenericDSPShort], (instregex "^REPL_PH_MM$")>;
782def : InstRW<[GenericDSPShort], (instregex "^REPL_QB_MM$")>;
783def : InstRW<[GenericDSPShort], (instregex "^SHILOV_MM$")>;
784def : InstRW<[GenericDSPShort], (instregex "^SHILO_MM$")>;
785def : InstRW<[GenericDSPShort], (instregex "^SHLLV_PH_MM$")>;
786def : InstRW<[GenericDSPShort], (instregex "^SHLLV_QB_MM$")>;
787def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_PH_MM$")>;
788def : InstRW<[GenericDSPShort], (instregex "^SHLLV_S_W_MM$")>;
789def : InstRW<[GenericDSPShort], (instregex "^SHLL_PH_MM$")>;
790def : InstRW<[GenericDSPShort], (instregex "^SHLL_QB_MM$")>;
791def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_PH_MM$")>;
792def : InstRW<[GenericDSPShort], (instregex "^SHLL_S_W_MM$")>;
793def : InstRW<[GenericDSPShort], (instregex "^SHRAV_PH_MM$")>;
794def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_PH_MM$")>;
795def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_W_MM$")>;
796def : InstRW<[GenericDSPShort], (instregex "^SHRA_PH_MM$")>;
797def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_PH_MM$")>;
798def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_W_MM$")>;
799def : InstRW<[GenericDSPShort], (instregex "^SHRLV_QB_MM$")>;
800def : InstRW<[GenericDSPShort], (instregex "^SHRL_QB_MM$")>;
801def : InstRW<[GenericDSPShort], (instregex "^SUBQ_PH_MM$")>;
802def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_PH_MM$")>;
803def : InstRW<[GenericDSPShort], (instregex "^SUBQ_S_W_MM$")>;
804def : InstRW<[GenericDSPShort], (instregex "^SUBU_QB_MM$")>;
805def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_QB_MM$")>;
806def : InstRW<[GenericDSPShort], (instregex "^WRDSP_MM$")>;
807
808
809// microMIPS DSP R2 - hasDSP, HasDSPR2, InMicroMips
810// ================================================
811
812def : InstRW<[GenericDSPShort], (instregex "^ABSQ_S_QB_MMR2$")>;
813def : InstRW<[GenericDSPShort], (instregex "^ADDQH_PH_MMR2$")>;
814def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_PH_MMR2$")>;
815def : InstRW<[GenericDSPShort], (instregex "^ADDQH_R_W_MMR2$")>;
816def : InstRW<[GenericDSPShort], (instregex "^ADDQH_W_MMR2$")>;
817def : InstRW<[GenericDSPShort], (instregex "^ADDUH_QB_MMR2$")>;
818def : InstRW<[GenericDSPShort], (instregex "^ADDUH_R_QB_MMR2$")>;
819def : InstRW<[GenericDSPShort], (instregex "^ADDU_PH_MMR2$")>;
820def : InstRW<[GenericDSPShort], (instregex "^ADDU_S_PH_MMR2$")>;
821def : InstRW<[GenericDSPShort], (instregex "^APPEND_MMR2$")>;
822def : InstRW<[GenericDSPShort], (instregex "^BALIGN_MMR2$")>;
823def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_EQ_QB_MMR2$")>;
824def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LE_QB_MMR2$")>;
825def : InstRW<[GenericDSPShort], (instregex "^CMPGDU_LT_QB_MMR2$")>;
826def : InstRW<[GenericDSPShort], (instregex "^DPA_W_PH_MMR2$")>;
827def : InstRW<[GenericDSPShort], (instregex "^DPAQX_SA_W_PH_MMR2$")>;
828def : InstRW<[GenericDSPShort], (instregex "^DPAQX_S_W_PH_MMR2$")>;
829def : InstRW<[GenericDSPShort], (instregex "^DPAX_W_PH_MMR2$")>;
830def : InstRW<[GenericDSPShort], (instregex "^DPS_W_PH_MMR2$")>;
831def : InstRW<[GenericDSPShort], (instregex "^DPSQX_S_W_PH_MMR2$")>;
832def : InstRW<[GenericDSPShort], (instregex "^DPSQX_SA_W_PH_MMR2$")>;
833def : InstRW<[GenericDSPShort], (instregex "^DPSX_W_PH_MMR2$")>;
834def : InstRW<[GenericDSPShort], (instregex "^MUL_PH_MMR2$")>;
835def : InstRW<[GenericDSPShort], (instregex "^MUL_S_PH_MMR2$")>;
836def : InstRW<[GenericDSPShort], (instregex "^MULQ_RS_W_MMR2$")>;
837def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_PH_MMR2$")>;
838def : InstRW<[GenericDSPShort], (instregex "^MULQ_S_W_MMR2$")>;
839def : InstRW<[GenericDSPShort], (instregex "^MULSA_W_PH_MMR2$")>;
840def : InstRW<[GenericDSPShort], (instregex "^PRECR_QB_PH_MMR2$")>;
841def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_PH_W_MMR2$")>;
842def : InstRW<[GenericDSPShort], (instregex "^PRECR_SRA_R_PH_W_MMR2$")>;
843def : InstRW<[GenericDSPShort], (instregex "^PREPEND_MMR2$")>;
844def : InstRW<[GenericDSPShort], (instregex "^SHRA_QB_MMR2$")>;
845def : InstRW<[GenericDSPShort], (instregex "^SHRA_R_QB_MMR2$")>;
846def : InstRW<[GenericDSPShort], (instregex "^SHRAV_QB_MMR2$")>;
847def : InstRW<[GenericDSPShort], (instregex "^SHRAV_R_QB_MMR2$")>;
848def : InstRW<[GenericDSPShort], (instregex "^SHRL_PH_MMR2$")>;
849def : InstRW<[GenericDSPShort], (instregex "^SHRLV_PH_MMR2$")>;
850def : InstRW<[GenericDSPShort], (instregex "^SUBQH_PH_MMR2$")>;
851def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_PH_MMR2$")>;
852def : InstRW<[GenericDSPShort], (instregex "^SUBQH_W_MMR2$")>;
853def : InstRW<[GenericDSPShort], (instregex "^SUBQH_R_W_MMR2$")>;
854def : InstRW<[GenericDSPShort], (instregex "^SUBU_PH_MMR2$")>;
855def : InstRW<[GenericDSPShort], (instregex "^SUBU_S_PH_MMR2$")>;
856def : InstRW<[GenericDSPShort], (instregex "^SUBUH_QB_MMR2$")>;
857def : InstRW<[GenericDSPShort], (instregex "^SUBUH_R_QB_MMR2$")>;
858
859// microMIPS DSP R3 - hasDSP, hasDSPR2, hasDSPR3, InMicroMips
860// ==========================================================
861
862def : InstRW<[GenericDSPShort], (instregex "^BPOSGE32C_MMR3$")>;
863
864// MIPS MSA ASE - hasMSA
865// =====================
866
867def GenericWriteMSAShortLogic : SchedWriteRes<[GenericIssueFPUS]>;
868def GenericWriteMSAShortInt : SchedWriteRes<[GenericIssueFPUS]> {
869let Latency = 2;
870}
871def GenericWriteMoveOtherUnitsToFPU : SchedWriteRes<[GenericIssueFPUS]>;
872def GenericWriteMSAOther3 : SchedWriteRes<[GenericIssueFPUS]> {
873let Latency = 3;
874}
875def GenericWriteMSALongInt : SchedWriteRes<[GenericIssueFPUS]> {
876let Latency = 5;
877}
878def GenericWriteFPUDivI : SchedWriteRes<[GenericFPQ]> {
879  let Latency = 33;
880  let ResourceCycles = [ 33 ];
881}
882
883// FPUS is also used in moves from floating point and MSA registers to general
884// purpose registers.
885def GenericWriteMoveFPUSToOtherUnits : SchedWriteRes<[GenericIssueFPUS]> {
886  let Latency = 0;
887}
888
889// FPUL is also used in moves from floating point and MSA registers to general
890// purpose registers.
891def GenericWriteMoveFPULToOtherUnits : SchedWriteRes<[GenericIssueFPUL]>;
892
893
894// adds_a.[bhwd], adds_[asu].[bhwd], addvi?.[bhwd], asub_[us].[bhwd],
895// aver?_[us].[bhwd]
896def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADD_A_[BHWD]$")>;
897def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADDS_[ASU]_[BHWD]$")>;
898
899// TODO: ADDVI_[BHW] might be 1 cycle latency rather than 2. Need to confirm it.
900// add.[bhwd], addvi.[bhwd], asub_[us].[bhwd], ave.[bhwd], aver.[bhwd]
901def : InstRW<[GenericWriteMSAShortInt], (instregex "^ADDVI?_[BHWD]$")>;
902def : InstRW<[GenericWriteMSAShortInt], (instregex "^ASUB_[US].[BHWD]$")>;
903def : InstRW<[GenericWriteMSAShortInt], (instregex "^AVER?_[US].[BHWD]$")>;
904
905// and.v, andi.b, move.v, ldi.[bhwd], xor.v, nor.v, xori.b, nori.b
906def : InstRW<[GenericWriteMSAShortLogic], (instregex "^MOVE_V$")>;
907def : InstRW<[GenericWriteMSAShortLogic], (instregex "^LDI_[BHWD]$")>;
908def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)_V$")>;
909def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)I_B$")>;
910def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(AND|OR|[XN]OR)I_B$")>;
911
912// vshf.[bhwd], binsl.[bhwd], binsr.[bhwd], insert.[bhwd], sld?.[bhwd],
913// bset.[bhwd], bclr.[bhwd], bneg.[bhwd], bsel_v, bseli_b
914def : InstRW<[GenericWriteMSAShortInt], (instregex "^VSHF_[BHWD]$")>;
915def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BINSL|BINSLI)_[BHWD]$")>;
916def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BINSR|BINSRI)_[BHWD]$")>;
917def : InstRW<[GenericWriteMSAShortInt], (instregex "^INSERT_[BHWD]$")>;
918def : InstRW<[GenericWriteMSAShortInt], (instregex "^(SLD|SLDI)_[BHWD]$")>;
919def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BSET|BSETI)_[BHWD]$")>;
920def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BCLR|BCLRI)_[BHWD]$")>;
921def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BNEG|BNEGI)_[BHWD]$")>;
922def : InstRW<[GenericWriteMSAShortInt], (instregex "^(BSEL_V|BSELI_B)$")>;
923def : InstRW<[GenericWriteMSAShortInt], (instregex "^BMN*Z.*$")>;
924
925// pcnt.[bhwd], sat_s.[bhwd], sat_u.bhwd]
926def : InstRW<[GenericWriteMSAOther3], (instregex "^PCNT_[BHWD]$")>;
927def : InstRW<[GenericWriteMSAOther3], (instregex "^SAT_(S|U)_[BHWD]$")>;
928
929// bnz.[bhwdv], cfcmsa, ctcmsa
930def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(BNZ|BZ)_[BHWDV]$")>;
931def : InstRW<[GenericWriteMSAShortLogic], (instregex "^C(F|T)CMSA$")>;
932
933// shf.[bhw], fill[bhwd], splat?.[bhwd]
934def : InstRW<[GenericWriteMSAShortInt], (instregex "^SHF_[BHW]$")>;
935def : InstRW<[GenericWriteMSAShortInt], (instregex "^FILL_[BHWD]$")>;
936def : InstRW<[GenericWriteMSAShortInt], (instregex "^(SPLAT|SPLATI)_[BHWD]$")>;
937
938// pcnt.[bhwd], sat_s.[bhwd], sat_u.bhwd]
939def : InstRW<[GenericWriteMSAOther3], (instregex "^PCNT_[BHWD]$")>;
940def : InstRW<[GenericWriteMSAOther3], (instregex "^SAT_(S|U)_[BHWD]$")>;
941
942// fexp2_w, fexp2_d
943def : InstRW<[GenericWriteFPUS], (instregex "^FEXP2_(W|D)$")>;
944
945// compare, converts, round to int, floating point truncate.
946def : InstRW<[GenericWriteFPUS], (instregex "^(CLT|CLTI)_(S|U)_[BHWD]$")>;
947def : InstRW<[GenericWriteFPUS], (instregex "^(CLE|CLEI)_(S|U)_[BHWD]$")>;
948def : InstRW<[GenericWriteFPUS], (instregex "^(CEQ|CEQI)_[BHWD]$")>;
949def : InstRW<[GenericWriteFPUS], (instregex "^CMP_UN_(S|D)$")>;
950def : InstRW<[GenericWriteFPUS], (instregex "^CMP_UEQ_(S|D)$")>;
951def : InstRW<[GenericWriteFPUS], (instregex "^CMP_EQ_(S|D)$")>;
952def : InstRW<[GenericWriteFPUS], (instregex "^CMP_LT_(S|D)$")>;
953def : InstRW<[GenericWriteFPUS], (instregex "^CMP_ULT_(S|D)$")>;
954def : InstRW<[GenericWriteFPUS], (instregex "^CMP_LE_(S|D)$")>;
955def : InstRW<[GenericWriteFPUS], (instregex "^CMP_ULE_(S|D)$")>;
956def : InstRW<[GenericWriteFPUS], (instregex "^FS(AF|EQ|LT|LE|NE|OR)_(W|D)$")>;
957def : InstRW<[GenericWriteFPUS], (instregex "^FSUEQ_(W|D)$")>;
958def : InstRW<[GenericWriteFPUS], (instregex "^FSULE_(W|D)$")>;
959def : InstRW<[GenericWriteFPUS], (instregex "^FSULT_(W|D)$")>;
960def : InstRW<[GenericWriteFPUS], (instregex "^FSUNE_(W|D)$")>;
961def : InstRW<[GenericWriteFPUS], (instregex "^FSUN_(W|D)$")>;
962def : InstRW<[GenericWriteFPUS], (instregex "^FCAF_(W|D)$")>;
963def : InstRW<[GenericWriteFPUS], (instregex "^FCEQ_(W|D)$")>;
964def : InstRW<[GenericWriteFPUS], (instregex "^FCLE_(W|D)$")>;
965def : InstRW<[GenericWriteFPUS], (instregex "^FCLT_(W|D)$")>;
966def : InstRW<[GenericWriteFPUS], (instregex "^FCNE_(W|D)$")>;
967def : InstRW<[GenericWriteFPUS], (instregex "^FCOR_(W|D)$")>;
968def : InstRW<[GenericWriteFPUS], (instregex "^FCUEQ_(W|D)$")>;
969def : InstRW<[GenericWriteFPUS], (instregex "^FCULE_(W|D)$")>;
970def : InstRW<[GenericWriteFPUS], (instregex "^FCULT_(W|D)$")>;
971def : InstRW<[GenericWriteFPUS], (instregex "^FCUNE_(W|D)$")>;
972def : InstRW<[GenericWriteFPUS], (instregex "^FCUN_(W|D)$")>;
973def : InstRW<[GenericWriteFPUS], (instregex "^FABS_(W|D)$")>;
974def : InstRW<[GenericWriteFPUS], (instregex "^FFINT_(U|S)_(W|D)$")>;
975def : InstRW<[GenericWriteFPUS], (instregex "^FFQL_(W|D)$")>;
976def : InstRW<[GenericWriteFPUS], (instregex "^FFQR_(W|D)$")>;
977def : InstRW<[GenericWriteFPUS], (instregex "^FTINT_(U|S)_(W|D)$")>;
978def : InstRW<[GenericWriteFPUS], (instregex "^FRINT_(W|D)$")>;
979def : InstRW<[GenericWriteFPUS], (instregex "^FTQ_(H|W)$")>;
980def : InstRW<[GenericWriteFPUS], (instregex "^FTRUNC_(U|S)_(W|D)$")>;
981
982// fexdo.[hw], fexupl.[wd], fexupr.[wd]
983def : InstRW<[GenericWriteFPUS], (instregex "^FEXDO_(H|W)$")>;
984def : InstRW<[GenericWriteFPUS], (instregex "^FEXUPL_(W|D)$")>;
985def : InstRW<[GenericWriteFPUS], (instregex "^FEXUPR_(W|D)$")>;
986
987// fclass.[wd], fmax.[wd], fmax_a.[wd], fmin.[wd], fmin_a.[wd], flog2.[wd]
988def : InstRW<[GenericWriteFPUS], (instregex "^FCLASS_(W|D)$")>;
989def : InstRW<[GenericWriteFPUS], (instregex "^FMAX_A_(W|D)$")>;
990def : InstRW<[GenericWriteFPUS], (instregex "^FMAX_(W|D)$")>;
991def : InstRW<[GenericWriteFPUS], (instregex "^FMIN_A_(W|D)$")>;
992def : InstRW<[GenericWriteFPUS], (instregex "^FMIN_(W|D)$")>;
993def : InstRW<[GenericWriteFPUS], (instregex "^FLOG2_(W|D)$")>;
994
995// interleave right/left, interleave even/odd, insert
996def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(ILVR|ILVL)_[BHWD]$")>;
997def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(ILVEV|ILVOD)_[BHWD]$")>;
998def : InstRW<[GenericWriteMSAShortLogic], (instregex "^INSVE_[BHWD]$")>;
999
1000// subs_?.[bhwd], subsus_?.[bhwd], subsuu_?.[bhwd], subvi.[bhwd], subv.[bhwd],
1001def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBS_(S|U)_[BHWD]$")>;
1002def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBSUS_(S|U)_[BHWD]$")>;
1003def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBSUU_(S|U)_[BHWD]$")>;
1004def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBVI_[BHWD]$")>;
1005def : InstRW<[GenericWriteMSAShortInt], (instregex "^SUBV_[BHWD]$")>;
1006
1007// mod_[su].[bhwd], div_[su].[bhwd]
1008def : InstRW<[GenericWriteFPUDivI], (instregex "^MOD_(S|U)_[BHWD]$")>;
1009def : InstRW<[GenericWriteFPUDivI], (instregex "^DIV_(S|U)_[BHWD]$")>;
1010
1011// hadd_[su].[bhwd], hsub_[su].[bhwd], max_[sua].[bhwd], min_[sua].[bhwd],
1012// maxi_[su].[bhwd], mini_[su].[bhwd], sra?.[bhwd], srar?.[bhwd], srlr.[bhwd],
1013// sll?.[bhwd], pckev.[bhwd], pckod.[bhwd], nloc.[bhwd], nlzc.[bhwd],
1014// insve.[bhwd]
1015def : InstRW<[GenericWriteMSAShortLogic], (instregex "^HADD_(S|U)_[BHWD]$")>;
1016def : InstRW<[GenericWriteMSAShortLogic], (instregex "^HSUB_(S|U)_[BHWD]$")>;
1017def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_S_[BHWD]$")>;
1018def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_U_[BHWD]$")>;
1019def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(MAX|MIN)_A_[BHWD]$")>;
1020def : InstRW<[GenericWriteMSAShortLogic],
1021             (instregex "^(MAXI|MINI)_(S|U)_[BHWD]$")>;
1022def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRA|SRAI)_[BHWD]$")>;
1023def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRL|SRLI)_[BHWD]$")>;
1024def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRAR|SRARI)_[BHWD]$")>;
1025def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SRLR|SRLRI)_[BHWD]$")>;
1026def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(SLL|SLLI)_[BHWD]$")>;
1027def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(PCKEV|PCKOD)_[BHWD]$")>;
1028def : InstRW<[GenericWriteMSAShortLogic], (instregex "^(NLOC|NLZC)_[BHWD]$")>;
1029def : InstRW<[GenericWriteMSAShortLogic], (instregex "^INSVE_[BHWD]$")>;
1030
1031// dpadd_?.[bhwd], dpsub_?.[bhwd], dotp_?.[bhwd], msubv.[bhwd], maddv.[bhwd]
1032// mulv.[bhwd].
1033def : InstRW<[GenericWriteMSALongInt], (instregex "^DPADD_(S|U)_[HWD]$")>;
1034def : InstRW<[GenericWriteMSALongInt], (instregex "^DPSUB_(S|U)_[HWD]$")>;
1035def : InstRW<[GenericWriteMSALongInt], (instregex "^DOTP_(S|U)_[HWD]$")>;
1036def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUBV_[BHWD]$")>;
1037def : InstRW<[GenericWriteMSALongInt], (instregex "^MADDV_[BHWD]$")>;
1038def : InstRW<[GenericWriteMSALongInt], (instregex "^MULV_[BHWD]$")>;
1039
1040// madd?.q.[hw], msub?.q.[hw], mul?.q.[hw]
1041def : InstRW<[GenericWriteMSALongInt], (instregex "^MADDR_Q_[HW]$")>;
1042def : InstRW<[GenericWriteMSALongInt], (instregex "^MADD_Q_[HW]$")>;
1043def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUBR_Q_[HW]$")>;
1044def : InstRW<[GenericWriteMSALongInt], (instregex "^MSUB_Q_[HW]$")>;
1045def : InstRW<[GenericWriteMSALongInt], (instregex "^MULR_Q_[HW]$")>;
1046def : InstRW<[GenericWriteMSALongInt], (instregex "^MUL_Q_[HW]$")>;
1047
1048// fadd.[dw], fmadd.[dw], fmul.[dw], frcp.[dw], frsqrt.[dw], fsqrt.[dw]
1049// fsub.[dw], fdiv.[dw]
1050def : InstRW<[GenericWriteFPUL], (instregex "^FADD_[DW]$")>;
1051def : InstRW<[GenericWriteFPUL], (instregex "^FMADD_[DW]$")>;
1052def : InstRW<[GenericWriteFPUL], (instregex "^FMSUB_[DW]$")>;
1053def : InstRW<[GenericWriteFPUL], (instregex "^FMUL_[DW]$")>;
1054def : InstRW<[GenericWriteFPUL], (instregex "^FRCP_[DW]$")>;
1055def : InstRW<[GenericWriteFPUL], (instregex "^FRSQRT_[DW]$")>;
1056def : InstRW<[GenericWriteFPUL], (instregex "^FSQRT_[DW]$")>;
1057def : InstRW<[GenericWriteFPUL], (instregex "^FSUB_[DW]$")>;
1058def : InstRW<[GenericWriteFPUL], (instregex "^FDIV_[DW]$")>;
1059
1060// copy.[su]_[bhwd]
1061def : InstRW<[GenericWriteFPUMoveGPRFPU], (instregex "^COPY_U_[BHW]$")>;
1062def : InstRW<[GenericWriteFPUMoveGPRFPU], (instregex "^COPY_S_[BHWD]$")>;
1063
1064def : InstRW<[GenericWriteFPUStore], (instregex "^ST_[BHWD]$")>;
1065def : InstRW<[GenericWriteFPULoad], (instregex "^LD_[BHWD]$")>;
1066}
1067