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