• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//=- AArch64SchedExynosM3.td - Samsung Exynos M3 Sched Defs --*- 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 defines the machine model for the Samsung Exynos M3 to support
11// instruction scheduling and other instruction cost heuristics.
12//
13//===----------------------------------------------------------------------===//
14
15//===----------------------------------------------------------------------===//
16// The Exynos-M3 is an advanced superscalar microprocessor with a 6-wide
17// in-order stage for decode and dispatch and a wider issue stage.
18// The execution units and loads and stores are out-of-order.
19
20def ExynosM3Model : SchedMachineModel {
21  let IssueWidth            =   6; // Up to 6 uops per cycle.
22  let MicroOpBufferSize     = 228; // ROB size.
23  let LoopMicroOpBufferSize =  40; // Based on the instruction queue size.
24  let LoadLatency           =   4; // Optimistic load cases.
25  let MispredictPenalty     =  16; // Minimum branch misprediction penalty.
26  let CompleteModel         =   1; // Use the default model otherwise.
27
28  list<Predicate> UnsupportedFeatures = [HasSVE];
29
30  // FIXME: Remove when all errors have been fixed.
31  let FullInstRWOverlapCheck = 0;
32}
33
34//===----------------------------------------------------------------------===//
35// Define each kind of processor resource and number available on the Exynos-M3,
36// which has 12 pipelines, each with its own queue with out-of-order dispatch.
37
38let SchedModel = ExynosM3Model in {
39
40def M3UnitA  : ProcResource<2>; // Simple integer
41def M3UnitC  : ProcResource<2>; // Simple and complex integer
42def M3UnitD  : ProcResource<1>; // Integer division (inside C0, serialized)
43def M3UnitB  : ProcResource<2>; // Branch
44def M3UnitL  : ProcResource<2>; // Load
45def M3UnitS  : ProcResource<1>; // Store
46def M3PipeF0 : ProcResource<1>; // FP #0
47let Super = M3PipeF0 in {
48  def M3UnitFMAC0 : ProcResource<1>; // FP multiplication
49  def M3UnitFADD0 : ProcResource<1>; // Simple FP
50  def M3UnitFCVT0 : ProcResource<1>; // FP conversion
51  def M3UnitFSQR  : ProcResource<2>; // FP square root (serialized)
52  def M3UnitNALU0 : ProcResource<1>; // Simple vector
53  def M3UnitNMSC  : ProcResource<1>; // FP and vector miscellanea
54  def M3UnitNSHT0 : ProcResource<1>; // Vector shifting
55  def M3UnitNSHF0 : ProcResource<1>; // Vector shuffling
56}
57def M3PipeF1 : ProcResource<1>; // FP #1
58let Super = M3PipeF1 in {
59  def M3UnitFMAC1 : ProcResource<1>; // FP multiplication
60  def M3UnitFADD1 : ProcResource<1>; // Simple FP
61  def M3UnitFDIV0 : ProcResource<2>; // FP division (serialized)
62  def M3UnitFCVT1 : ProcResource<1>; // FP conversion
63  def M3UnitFST0  : ProcResource<1>; // FP store
64  def M3UnitNALU1 : ProcResource<1>; // Simple vector
65  def M3UnitNCRY0 : ProcResource<1>; // Cryptographic
66  def M3UnitNMUL  : ProcResource<1>; // Vector multiplication
67  def M3UnitNSHT1 : ProcResource<1>; // Vector shifting
68  def M3UnitNSHF1 : ProcResource<1>; // Vector shuffling
69}
70def M3PipeF2 : ProcResource<1>; // FP #2
71let Super = M3PipeF2 in {
72  def M3UnitFMAC2 : ProcResource<1>; // FP multiplication
73  def M3UnitFADD2 : ProcResource<1>; // Simple FP
74  def M3UnitFDIV1 : ProcResource<2>; // FP division (serialized)
75  def M3UnitFST1  : ProcResource<1>; // FP store
76  def M3UnitNALU2 : ProcResource<1>; // Simple vector
77  def M3UnitNCRY1 : ProcResource<1>; // Cryptographic
78  def M3UnitNSHT2 : ProcResource<1>; // Vector shifting
79  def M3UnitNSHF2 : ProcResource<1>; // Vector shuffling
80}
81
82
83def M3UnitALU  : ProcResGroup<[M3UnitA,
84                               M3UnitC]>;
85def M3UnitFMAC : ProcResGroup<[M3UnitFMAC0,
86                               M3UnitFMAC1,
87                               M3UnitFMAC2]>;
88def M3UnitFADD : ProcResGroup<[M3UnitFADD0,
89                               M3UnitFADD1,
90                               M3UnitFADD2]>;
91def M3UnitFDIV : ProcResGroup<[M3UnitFDIV0,
92                               M3UnitFDIV1]>;
93def M3UnitFCVT : ProcResGroup<[M3UnitFCVT0,
94                               M3UnitFCVT1]>;
95def M3UnitFST  : ProcResGroup<[M3UnitFST0,
96                               M3UnitFST1]>;
97def M3UnitNALU : ProcResGroup<[M3UnitNALU0,
98                               M3UnitNALU1,
99                               M3UnitNALU2]>;
100def M3UnitNCRY : ProcResGroup<[M3UnitNCRY0,
101                               M3UnitNCRY1]>;
102def M3UnitNSHT : ProcResGroup<[M3UnitNSHT0,
103                               M3UnitNSHT1,
104                               M3UnitNSHT2]>;
105def M3UnitNSHF : ProcResGroup<[M3UnitNSHF0,
106                               M3UnitNSHF1,
107                               M3UnitNSHF2]>;
108
109//===----------------------------------------------------------------------===//
110// Predicates.
111
112def M3BranchLinkFastPred  : SchedPredicate<[{MI->getOpcode() == AArch64::BLR &&
113                                             MI->getOperand(0).isReg() &&
114                                             MI->getOperand(0).getReg() != AArch64::LR}]>;
115def M3ResetFastPred       : SchedPredicate<[{TII->isExynosResetFast(*MI)}]>;
116def M3RotateRightFastPred : SchedPredicate<[{(MI->getOpcode() == AArch64::EXTRWrri ||
117                                              MI->getOpcode() == AArch64::EXTRXrri) &&
118                                             MI->getOperand(1).isReg() && MI->getOperand(2).isReg() &&
119                                             MI->getOperand(1).getReg() == MI->getOperand(2).getReg()}]>;
120def M3ShiftLeftFastPred   : SchedPredicate<[{TII->isExynosShiftLeftFast(*MI)}]>;
121
122//===----------------------------------------------------------------------===//
123// Coarse scheduling model.
124
125def M3WriteZ0 : SchedWriteRes<[]> { let Latency = 0;
126                                    let NumMicroOps = 1; }
127
128def M3WriteA1 : SchedWriteRes<[M3UnitALU]> { let Latency = 1; }
129def M3WriteAA : SchedWriteRes<[M3UnitALU]> { let Latency = 2;
130                                             let ResourceCycles = [2]; }
131def M3WriteAB : SchedWriteRes<[M3UnitALU,
132                               M3UnitC]>   { let Latency = 1;
133                                             let NumMicroOps = 2; }
134def M3WriteAC : SchedWriteRes<[M3UnitALU,
135                               M3UnitALU,
136                               M3UnitC]>   { let Latency = 2;
137                                             let NumMicroOps = 3; }
138def M3WriteAD : SchedWriteRes<[M3UnitALU,
139                               M3UnitC]>   { let Latency = 2;
140                                             let NumMicroOps = 2; }
141def M3WriteC1 : SchedWriteRes<[M3UnitC]>   { let Latency = 1; }
142def M3WriteC2 : SchedWriteRes<[M3UnitC]>   { let Latency = 2; }
143def M3WriteAX : SchedWriteVariant<[SchedVar<M3ResetFastPred,     [M3WriteZ0]>,
144                                   SchedVar<M3ShiftLeftFastPred, [M3WriteA1]>,
145                                   SchedVar<NoSchedPred,         [M3WriteAA]>]>;
146def M3WriteAY : SchedWriteVariant<[SchedVar<M3RotateRightFastPred, [M3WriteA1]>,
147                                   SchedVar<NoSchedPred,           [M3WriteAA]>]>;
148
149def M3WriteB1 : SchedWriteRes<[M3UnitB]> { let Latency = 1; }
150def M3WriteBX : SchedWriteVariant<[SchedVar<M3BranchLinkFastPred, [M3WriteAB]>,
151                                   SchedVar<NoSchedPred,          [M3WriteAC]>]>;
152
153def M3WriteL4 : SchedWriteRes<[M3UnitL]> { let Latency = 4; }
154def M3WriteL5 : SchedWriteRes<[M3UnitL]> { let Latency = 5; }
155def M3WriteLA : SchedWriteRes<[M3UnitL,
156                               M3UnitL]> { let Latency = 5;
157                                           let NumMicroOps = 1; }
158def M3WriteLB : SchedWriteRes<[M3UnitA,
159                               M3UnitL]> { let Latency = 5;
160                                           let NumMicroOps = 2; }
161def M3WriteLC : SchedWriteRes<[M3UnitA,
162                               M3UnitL,
163                               M3UnitL]> { let Latency = 5;
164                                           let NumMicroOps = 2; }
165def M3WriteLD : SchedWriteRes<[M3UnitA,
166                               M3UnitL]> { let Latency = 4;
167                                           let NumMicroOps = 2; }
168def M3WriteLH : SchedWriteRes<[]>        { let Latency = 5;
169                                           let NumMicroOps = 0; }
170
171def M3WriteLX : SchedWriteVariant<[SchedVar<M3ShiftLeftFastPred, [M3WriteL5]>,
172                                   SchedVar<NoSchedPred,         [M3WriteLB]>]>;
173
174def M3WriteS1 : SchedWriteRes<[M3UnitS]>   { let Latency = 1; }
175def M3WriteSA : SchedWriteRes<[M3UnitA,
176                               M3UnitS,
177                               M3UnitFST]> { let Latency = 2;
178                                             let NumMicroOps = 2; }
179def M3WriteSB : SchedWriteRes<[M3UnitA,
180                               M3UnitS]>   { let Latency = 1;
181                                             let NumMicroOps = 2; }
182def M3WriteSC : SchedWriteRes<[M3UnitA,
183                               M3UnitS]>   { let Latency = 2;
184                                             let NumMicroOps = 2; }
185
186def M3WriteSX : SchedWriteVariant<[SchedVar<M3ShiftLeftFastPred, [M3WriteS1]>,
187                                   SchedVar<NoSchedPred,         [M3WriteSB]>]>;
188def M3WriteSY : SchedWriteVariant<[SchedVar<M3ShiftLeftFastPred, [M3WriteS1]>,
189                                   SchedVar<NoSchedPred,         [M3WriteSC]>]>;
190
191def M3ReadAdrBase : SchedReadVariant<[SchedVar<ScaledIdxPred, [ReadDefault]>,
192                                      SchedVar<NoSchedPred,   [ReadDefault]>]>;
193
194// Branch instructions.
195def : SchedAlias<WriteBr, M3WriteZ0>;
196def : WriteRes<WriteBrReg, [M3UnitC]> { let Latency = 1; }
197
198// Arithmetic and logical integer instructions.
199def : WriteRes<WriteI,     [M3UnitALU]> { let Latency = 1; }
200def : WriteRes<WriteISReg, [M3UnitALU]> { let Latency = 1; }
201def : WriteRes<WriteIEReg, [M3UnitALU]> { let Latency = 1; }
202def : WriteRes<WriteIS,    [M3UnitALU]> { let Latency = 1; }
203
204// Move instructions.
205def : WriteRes<WriteImm, [M3UnitALU]> { let Latency = 1; }
206
207// Divide and multiply instructions.
208def : WriteRes<WriteID32, [M3UnitC,
209                           M3UnitD]>  { let Latency = 12;
210                                        let ResourceCycles = [1, 12]; }
211def : WriteRes<WriteID64, [M3UnitC,
212                           M3UnitD]>  { let Latency = 21;
213                                        let ResourceCycles = [1, 21]; }
214def : WriteRes<WriteIM32, [M3UnitC]>  { let Latency = 3; }
215def : WriteRes<WriteIM64, [M3UnitC]>  { let Latency = 4;
216                                        let ResourceCycles = [2]; }
217
218// Miscellaneous instructions.
219def : WriteRes<WriteExtr, [M3UnitALU,
220                           M3UnitALU]> { let Latency = 1;
221                                         let NumMicroOps = 2; }
222
223// Addressing modes.
224def : WriteRes<WriteAdr, []> { let Latency = 1;
225                               let NumMicroOps = 0; }
226def : SchedAlias<ReadAdrBase, M3ReadAdrBase>;
227
228// Load instructions.
229def : SchedAlias<WriteLD, M3WriteL4>;
230def : WriteRes<WriteLDHi, []> { let Latency = 4;
231                                let NumMicroOps = 0; }
232def : SchedAlias<WriteLDIdx, M3WriteLX>;
233
234// Store instructions.
235def : SchedAlias<WriteST,    M3WriteS1>;
236def : SchedAlias<WriteSTP,   M3WriteS1>;
237def : SchedAlias<WriteSTX,   M3WriteS1>;
238def : SchedAlias<WriteSTIdx, M3WriteSX>;
239
240// FP data instructions.
241def : WriteRes<WriteF,    [M3UnitFADD]>  { let Latency = 2; }
242def : WriteRes<WriteFCmp, [M3UnitNMSC]>  { let Latency = 2; }
243def : WriteRes<WriteFDiv, [M3UnitFDIV]>  { let Latency = 12;
244                                           let ResourceCycles = [12]; }
245def : WriteRes<WriteFMul, [M3UnitFMAC]>  { let Latency = 4; }
246
247// FP miscellaneous instructions.
248// TODO: Conversion between register files is much different.
249def : WriteRes<WriteFCvt,  [M3UnitFCVT]> { let Latency = 3; }
250def : WriteRes<WriteFImm,  [M3UnitNALU]> { let Latency = 1; }
251def : WriteRes<WriteFCopy, [M3UnitNALU]> { let Latency = 1; }
252
253// FP load instructions.
254def : SchedAlias<WriteVLD, M3WriteL5>;
255
256// FP store instructions.
257def : WriteRes<WriteVST, [M3UnitS,
258                          M3UnitFST]> { let Latency = 1;
259                                        let NumMicroOps = 1; }
260
261// ASIMD FP instructions.
262def : WriteRes<WriteV, [M3UnitNALU]> { let Latency = 3; }
263
264// Other miscellaneous instructions.
265def : WriteRes<WriteAtomic,  []> { let Unsupported = 1; }
266def : WriteRes<WriteBarrier, []> { let Latency = 1; }
267def : WriteRes<WriteHint,    []> { let Latency = 1; }
268def : WriteRes<WriteSys,     []> { let Latency = 1; }
269
270//===----------------------------------------------------------------------===//
271// Generic fast forwarding.
272
273// TODO: Add FP register forwarding rules.
274
275def : ReadAdvance<ReadI,       0>;
276def : ReadAdvance<ReadISReg,   0>;
277def : ReadAdvance<ReadIEReg,   0>;
278def : ReadAdvance<ReadIM,      0>;
279// TODO: The forwarding for 32 bits actually saves 2 cycles.
280def : ReadAdvance<ReadIMA,     3, [WriteIM32, WriteIM64]>;
281def : ReadAdvance<ReadID,      0>;
282def : ReadAdvance<ReadExtrHi,  0>;
283def : ReadAdvance<ReadAdrBase, 0>;
284def : ReadAdvance<ReadVLD,     0>;
285
286//===----------------------------------------------------------------------===//
287// Finer scheduling model.
288
289def M3WriteNEONA   : SchedWriteRes<[M3UnitNSHF,
290                                    M3UnitFADD]>  { let Latency = 3;
291                                                    let NumMicroOps = 2; }
292def M3WriteNEONB   : SchedWriteRes<[M3UnitNALU,
293                                    M3UnitFST]>   { let Latency = 10;
294                                                    let NumMicroOps = 2; }
295def M3WriteNEOND   : SchedWriteRes<[M3UnitNSHF,
296                                    M3UnitFST]>   { let Latency = 6;
297                                                    let NumMicroOps = 2; }
298def M3WriteNEONH   : SchedWriteRes<[M3UnitNALU,
299                                    M3UnitS]>     { let Latency = 5;
300                                                    let NumMicroOps = 2; }
301def M3WriteNEONI   : SchedWriteRes<[M3UnitNSHF,
302                                    M3UnitS]>     { let Latency = 5;
303                                                    let NumMicroOps = 2; }
304def M3WriteNEONV   : SchedWriteRes<[M3UnitFDIV0,
305                                    M3UnitFDIV1]>  { let Latency = 7;
306                                                     let NumMicroOps = 2;
307                                                     let ResourceCycles = [8, 8]; }
308def M3WriteNEONW   : SchedWriteRes<[M3UnitFDIV0,
309                                    M3UnitFDIV1]>  { let Latency = 12;
310                                                     let NumMicroOps = 2;
311                                                     let ResourceCycles = [13, 13]; }
312def M3WriteNEONX   : SchedWriteRes<[M3UnitFSQR,
313                                    M3UnitFSQR]>  { let Latency = 18;
314                                                    let NumMicroOps = 2;
315                                                    let ResourceCycles = [19, 19]; }
316def M3WriteNEONY   : SchedWriteRes<[M3UnitFSQR,
317                                    M3UnitFSQR]>  { let Latency = 25;
318                                                    let NumMicroOps = 2;
319                                                    let ResourceCycles = [26, 26]; }
320def M3WriteNEONZ   : SchedWriteRes<[M3UnitNMSC,
321                                    M3UnitNMSC]>  { let Latency = 5;
322                                                    let NumMicroOps = 2; }
323def M3WriteFADD2   : SchedWriteRes<[M3UnitFADD]>  { let Latency = 2; }
324def M3WriteFCVT2   : SchedWriteRes<[M3UnitFCVT]>  { let Latency = 2; }
325def M3WriteFCVT3   : SchedWriteRes<[M3UnitFCVT]>  { let Latency = 3; }
326def M3WriteFCVT3A  : SchedWriteRes<[M3UnitFCVT0]> { let Latency = 3; }
327def M3WriteFCVT4A  : SchedWriteRes<[M3UnitFCVT0]> { let Latency = 4; }
328def M3WriteFCVT4   : SchedWriteRes<[M3UnitFCVT]>  { let Latency = 4; }
329def M3WriteFDIV10  : SchedWriteRes<[M3UnitFDIV]>  { let Latency = 7;
330                                                    let ResourceCycles = [8]; }
331def M3WriteFDIV12  : SchedWriteRes<[M3UnitFDIV]>  { let Latency = 12;
332                                                    let ResourceCycles = [13]; }
333def M3WriteFMAC3   : SchedWriteRes<[M3UnitFMAC]>  { let Latency = 3; }
334def M3WriteFMAC4   : SchedWriteRes<[M3UnitFMAC]>  { let Latency = 4; }
335def M3WriteFMAC5   : SchedWriteRes<[M3UnitFMAC]>  { let Latency = 5; }
336def M3WriteFSQR17  : SchedWriteRes<[M3UnitFSQR]>  { let Latency = 18;
337                                                    let ResourceCycles = [19]; }
338def M3WriteFSQR25  : SchedWriteRes<[M3UnitFSQR]>  { let Latency = 25;
339                                                    let ResourceCycles = [26]; }
340def M3WriteNALU1   : SchedWriteRes<[M3UnitNALU]>  { let Latency = 1; }
341def M3WriteNCRY1A  : SchedWriteRes<[M3UnitNCRY0]> { let Latency = 1; }
342def M3WriteNCRY3A  : SchedWriteRes<[M3UnitNCRY0]> { let Latency = 3; }
343def M3WriteNCRY5A  : SchedWriteRes<[M3UnitNCRY]>  { let Latency = 5; }
344def M3WriteNMSC1   : SchedWriteRes<[M3UnitNMSC]>  { let Latency = 1; }
345def M3WriteNMSC2   : SchedWriteRes<[M3UnitNMSC]>  { let Latency = 2; }
346def M3WriteNMSC3   : SchedWriteRes<[M3UnitNMSC]>  { let Latency = 3; }
347def M3WriteNMUL3   : SchedWriteRes<[M3UnitNMUL]>  { let Latency = 3; }
348def M3WriteNSHF1   : SchedWriteRes<[M3UnitNSHF]>  { let Latency = 1; }
349def M3WriteNSHF3   : SchedWriteRes<[M3UnitNSHF]>  { let Latency = 3; }
350def M3WriteNSHT1   : SchedWriteRes<[M3UnitNSHT]>  { let Latency = 1; }
351def M3WriteNSHT2   : SchedWriteRes<[M3UnitNSHT]>  { let Latency = 2; }
352def M3WriteNSHT3   : SchedWriteRes<[M3UnitNSHT]>  { let Latency = 3; }
353def M3WriteVLDA    : SchedWriteRes<[M3UnitL,
354                                    M3UnitL]>     { let Latency = 5;
355                                                    let NumMicroOps = 2; }
356def M3WriteVLDB    : SchedWriteRes<[M3UnitL,
357                                    M3UnitL,
358                                    M3UnitL]>     { let Latency = 6;
359                                                    let NumMicroOps = 3; }
360def M3WriteVLDC    : SchedWriteRes<[M3UnitL,
361                                    M3UnitL,
362                                    M3UnitL,
363                                    M3UnitL]>     { let Latency = 6;
364                                                    let NumMicroOps = 4; }
365def M3WriteVLDD    : SchedWriteRes<[M3UnitL,
366                                    M3UnitNALU]>  { let Latency = 7;
367                                                    let NumMicroOps = 2;
368                                                    let ResourceCycles = [2, 1]; }
369def M3WriteVLDE    : SchedWriteRes<[M3UnitL,
370                                    M3UnitNALU]>  { let Latency = 6;
371                                                    let NumMicroOps = 2;
372                                                    let ResourceCycles = [2, 1]; }
373def M3WriteVLDF    : SchedWriteRes<[M3UnitL,
374                                    M3UnitL]>     { let Latency = 10;
375                                                    let NumMicroOps = 2;
376                                                    let ResourceCycles = [5, 5]; }
377def M3WriteVLDG    : SchedWriteRes<[M3UnitL,
378                                    M3UnitNALU,
379                                    M3UnitNALU]>  { let Latency = 7;
380                                                    let NumMicroOps = 3;
381                                                    let ResourceCycles = [2, 1, 1]; }
382def M3WriteVLDH    : SchedWriteRes<[M3UnitL,
383                                    M3UnitNALU,
384                                    M3UnitNALU]>  { let Latency = 6;
385                                                    let NumMicroOps = 3;
386                                                    let ResourceCycles = [2, 1, 1]; }
387def M3WriteVLDI    : SchedWriteRes<[M3UnitL,
388                                    M3UnitL,
389                                    M3UnitL]>     { let Latency = 12;
390                                                    let NumMicroOps = 3;
391                                                    let ResourceCycles = [6, 6, 6]; }
392def M3WriteVLDJ    : SchedWriteRes<[M3UnitL,
393                                    M3UnitNALU,
394                                    M3UnitNALU,
395                                    M3UnitNALU]>  { let Latency = 7;
396                                                    let NumMicroOps = 4;
397                                                    let ResourceCycles = [2, 1, 1, 1]; }
398def M3WriteVLDK    : SchedWriteRes<[M3UnitL,
399                                    M3UnitNALU,
400                                    M3UnitNALU,
401                                    M3UnitNALU,
402                                    M3UnitNALU]>  { let Latency = 9;
403                                                    let NumMicroOps = 5;
404                                                    let ResourceCycles = [4, 1, 1, 1, 1]; }
405def M3WriteVLDL    : SchedWriteRes<[M3UnitL,
406                                    M3UnitNALU,
407                                    M3UnitNALU,
408                                    M3UnitL,
409                                    M3UnitNALU]>  { let Latency = 6;
410                                                    let NumMicroOps = 5;
411                                                    let ResourceCycles = [6, 1, 1, 6, 1]; }
412def M3WriteVLDM    : SchedWriteRes<[M3UnitL,
413                                    M3UnitNALU,
414                                    M3UnitNALU,
415                                    M3UnitL,
416                                    M3UnitNALU,
417                                    M3UnitNALU]>  { let Latency = 7;
418                                                    let NumMicroOps = 6;
419                                                    let ResourceCycles = [6, 1, 1, 6, 1, 1]; }
420def M3WriteVLDN    : SchedWriteRes<[M3UnitL,
421                                    M3UnitL,
422                                    M3UnitL,
423                                    M3UnitL]>     { let Latency = 14;
424                                                    let NumMicroOps = 4;
425                                                    let ResourceCycles = [6, 6, 6, 6]; }
426def M3WriteVSTA    : WriteSequence<[WriteVST], 2>;
427def M3WriteVSTB    : WriteSequence<[WriteVST], 3>;
428def M3WriteVSTC    : WriteSequence<[WriteVST], 4>;
429def M3WriteVSTD    : SchedWriteRes<[M3UnitS,
430                                    M3UnitFST,
431                                    M3UnitS,
432                                    M3UnitFST]>   { let Latency = 7;
433                                                    let NumMicroOps = 4;
434                                                    let ResourceCycles = [1, 3, 1, 3]; }
435def M3WriteVSTE    : SchedWriteRes<[M3UnitS,
436                                    M3UnitFST,
437                                    M3UnitS,
438                                    M3UnitFST,
439                                    M3UnitS,
440                                    M3UnitFST]>   { let Latency = 8;
441                                                    let NumMicroOps = 6;
442                                                    let ResourceCycles = [1, 3, 1, 3, 1, 3]; }
443def M3WriteVSTF    : SchedWriteRes<[M3UnitNALU,
444                                    M3UnitFST,
445                                    M3UnitFST,
446                                    M3UnitS,
447                                    M3UnitFST,
448                                    M3UnitS,
449                                    M3UnitFST]>   { let Latency = 15;
450                                                    let NumMicroOps = 7;
451                                                    let ResourceCycles = [1, 3, 3, 1, 3, 1, 3]; }
452def M3WriteVSTG    : SchedWriteRes<[M3UnitNALU,
453                                    M3UnitFST,
454                                    M3UnitFST,
455                                    M3UnitS,
456                                    M3UnitFST,
457                                    M3UnitS,
458                                    M3UnitFST,
459                                    M3UnitS,
460                                    M3UnitFST]>   { let Latency = 16;
461                                                    let NumMicroOps = 9;
462                                                    let ResourceCycles = [1, 3, 3, 1, 3, 1, 3, 1, 3]; }
463def M3WriteVSTH    : SchedWriteRes<[M3UnitNALU,
464                                    M3UnitFST,
465                                    M3UnitFST,
466                                    M3UnitS,
467                                    M3UnitFST]>   { let Latency = 14;
468                                                    let NumMicroOps = 5;
469                                                    let ResourceCycles = [1, 3, 3, 1, 3]; }
470def M3WriteVSTI    : SchedWriteRes<[M3UnitNALU,
471                                    M3UnitFST,
472                                    M3UnitFST,
473                                    M3UnitS,
474                                    M3UnitFST,
475                                    M3UnitS,
476                                    M3UnitFST,
477                                    M3UnitS,
478                                    M3UnitFST]>   { let Latency = 17;
479                                                    let NumMicroOps = 9;
480                                                    let ResourceCycles = [1, 3, 3, 1, 3, 1, 3, 1, 3]; }
481
482// Special cases.
483def M3WriteAES     : SchedWriteRes<[M3UnitNCRY]>  { let Latency = 1; }
484def M3ReadAES      : SchedReadAdvance<1, [M3WriteAES]>;
485def M3ReadFMAC     : SchedReadAdvance<1, [M3WriteFMAC4,
486                                          M3WriteFMAC5]>;
487def M3WriteMOVI    : SchedWriteVariant<[SchedVar<M3ResetFastPred, [M3WriteZ0]>,
488                                        SchedVar<NoSchedPred,     [M3WriteNALU1]>]>;
489def M3ReadNMUL     : SchedReadAdvance<1, [M3WriteNMUL3]>;
490
491// Branch instructions
492def : InstRW<[M3WriteB1], (instrs Bcc)>;
493def : InstRW<[M3WriteA1], (instrs BL)>;
494def : InstRW<[M3WriteBX], (instrs BLR)>;
495def : InstRW<[M3WriteC1], (instregex "^CBN?Z[WX]")>;
496def : InstRW<[M3WriteAD], (instregex "^TBN?Z[WX]")>;
497
498// Arithmetic and logical integer instructions.
499def : InstRW<[M3WriteA1], (instrs COPY)>;
500def : InstRW<[M3WriteAX], (instregex "^(ADD|SUB)S?Xrx64")>;
501def : InstRW<[M3WriteAX], (instregex "^(ADD|AND|BIC|EON|EOR|ORN|ORR|SUB)[WX]r[sx]$")>;
502def : InstRW<[M3WriteAX], (instregex "^(ADD|BIC|SUB)S[WX]r[sx]$")>;
503def : InstRW<[M3WriteAX], (instregex "^(ADD|AND|EOR|ORR|SUB)[WX]ri")>;
504
505// Move instructions.
506def : InstRW<[M3WriteZ0], (instrs ADR, ADRP)>;
507def : InstRW<[M3WriteZ0], (instregex "^MOV[NZ][WX]i")>;
508
509// Divide and multiply instructions.
510
511// Miscellaneous instructions.
512def : InstRW<[M3WriteAY], (instrs EXTRWrri, EXTRXrri)>;
513
514// Load instructions.
515def : InstRW<[M3WriteLD,
516              WriteLDHi,
517              WriteAdr],    (instregex "^LDP(SW|W|X)(post|pre)")>;
518def : InstRW<[M3WriteLX,
519              ReadAdrBase], (instregex "^PRFMro[WX]")>;
520
521// Store instructions.
522
523// FP data instructions.
524def : InstRW<[M3WriteNSHF1],  (instregex "^FABS[DS]r")>;
525def : InstRW<[M3WriteFADD2],  (instregex "^F(ADD|SUB)[DS]rr")>;
526def : InstRW<[M3WriteFDIV10], (instrs FDIVSrr)>;
527def : InstRW<[M3WriteFDIV12], (instrs FDIVDrr)>;
528def : InstRW<[M3WriteNMSC1],  (instregex "^F(MAX|MIN).+rr")>;
529def : InstRW<[M3WriteFMAC3],  (instregex "^FN?MUL[DS]rr")>;
530def : InstRW<[M3WriteFMAC4,
531              M3ReadFMAC],    (instregex "^FN?M(ADD|SUB)[DS]rrr")>;
532def : InstRW<[M3WriteNALU1],  (instregex "^FNEG[DS]r")>;
533def : InstRW<[M3WriteFCVT3A], (instregex "^FRINT.+r")>;
534def : InstRW<[M3WriteNEONH],  (instregex "^FCSEL[DS]rrr")>;
535def : InstRW<[M3WriteFSQR17], (instrs FSQRTSr)>;
536def : InstRW<[M3WriteFSQR25], (instrs FSQRTDr)>;
537
538// FP miscellaneous instructions.
539def : InstRW<[M3WriteFCVT3],  (instregex "^FCVT[DHS][DHS]r")>;
540def : InstRW<[M3WriteFCVT4A], (instregex "^[SU]CVTF[SU][XW][DHS]ri")>;
541def : InstRW<[M3WriteFCVT3A], (instregex "^FCVT[AMNPZ][SU]U[XW][DHS]r")>;
542def : InstRW<[M3WriteFCVT3A], (instregex "^FCVTZ[SU][dhs]")>;
543def : InstRW<[M3WriteNALU1],  (instregex "^FMOV[DS][ir]")>;
544def : InstRW<[M3WriteFCVT4],  (instregex "^[FU](RECP|RSQRT)Ev1")>;
545def : InstRW<[M3WriteNMSC1],  (instregex "^FRECPXv1")>;
546def : InstRW<[M3WriteFMAC4,
547              M3ReadFMAC],    (instregex "^F(RECP|RSQRT)S(16|32|64)")>;
548def : InstRW<[M3WriteNALU1],  (instregex "^FMOV[WX][DS]r")>;
549def : InstRW<[M3WriteNALU1],  (instregex "^FMOV[DS][WX]r")>;
550def : InstRW<[M3WriteNEONI],  (instregex "^FMOV(DX|XD)Highr")>;
551
552// FP load instructions.
553def : InstRW<[WriteVLD],    (instregex "^LDR[DSQ]l")>;
554def : InstRW<[WriteVLD],    (instregex "^LDUR[BDHSQ]i")>;
555def : InstRW<[WriteVLD,
556              WriteAdr],    (instregex "^LDR[BDHSQ](post|pre)")>;
557def : InstRW<[WriteVLD],    (instregex "^LDR[BDHSQ]ui")>;
558def : InstRW<[M3WriteLX,
559              ReadAdrBase], (instregex "^LDR[BDHS]ro[WX]")>;
560def : InstRW<[M3WriteLB,
561              ReadAdrBase], (instregex "^LDRQro[WX]")>;
562def : InstRW<[WriteVLD,
563              M3WriteLH],   (instregex "^LDN?P[DS]i")>;
564def : InstRW<[M3WriteLA,
565              M3WriteLH],   (instregex "^LDN?PQi")>;
566def : InstRW<[M3WriteLB,
567              M3WriteLH,
568              WriteAdr],    (instregex "^LDP[DS](post|pre)")>;
569def : InstRW<[M3WriteLC,
570              M3WriteLH,
571              WriteAdr],    (instregex "^LDPQ(post|pre)")>;
572
573// FP store instructions.
574def : InstRW<[WriteVST],    (instregex "^STUR[BDHSQ]i")>;
575def : InstRW<[WriteVST,
576              WriteAdr],    (instregex "^STR[BDHSQ](post|pre)")>;
577def : InstRW<[WriteVST],    (instregex "^STR[BDHSQ]ui")>;
578def : InstRW<[M3WriteSY,
579              ReadAdrBase], (instregex "^STR[BDHS]ro[WX]")>;
580def : InstRW<[M3WriteSA,
581              ReadAdrBase], (instregex "^STRQro[WX]")>;
582def : InstRW<[WriteVST],    (instregex "^STN?P[DSQ]i")>;
583def : InstRW<[WriteVST,
584              WriteAdr],    (instregex "^STP[DS](post|pre)")>;
585def : InstRW<[M3WriteSA,
586              WriteAdr],    (instregex "^STPQ(post|pre)")>;
587
588// ASIMD instructions.
589def : InstRW<[M3WriteNMSC3], (instregex "^[SU]ABAL?v")>;
590def : InstRW<[M3WriteNMSC1], (instregex "^[SU]ABDL?v")>;
591def : InstRW<[M3WriteNMSC1], (instregex "^(SQ)?(ABS|NEG)v")>;
592def : InstRW<[M3WriteNALU1], (instregex "^(ADD|NEG|SUB)v")>;
593def : InstRW<[M3WriteNMSC3], (instregex "^[SU]?ADDL?Pv")>;
594def : InstRW<[M3WriteNMSC3], (instregex "^[SU]H(ADD|SUB)v")>;
595def : InstRW<[M3WriteNMSC3], (instregex "^[SU](ADD|SUB)[LW]V?v")>;
596def : InstRW<[M3WriteNMSC3], (instregex "^R?(ADD|SUB)HN2?v")>;
597def : InstRW<[M3WriteNMSC3], (instregex "^[SU]Q(ADD|SUB)v")>;
598def : InstRW<[M3WriteNMSC3], (instregex "^(SU|US)QADDv")>;
599def : InstRW<[M3WriteNMSC3], (instregex "^[SU]RHADDv")>;
600def : InstRW<[M3WriteNMSC3], (instregex "^[SU]?ADDL?Vv")>;
601def : InstRW<[M3WriteNMSC1], (instregex "^CM(EQ|GE|GT|HI|HS|LE|LT)v")>;
602def : InstRW<[M3WriteNALU1], (instregex "^CMTSTv")>;
603def : InstRW<[M3WriteNALU1], (instregex "^(AND|BIC|EOR|MVNI|NOT|ORN|ORR)v")>;
604def : InstRW<[M3WriteNMSC1], (instregex "^[SU](MIN|MAX)v")>;
605def : InstRW<[M3WriteNMSC2], (instregex "^[SU](MIN|MAX)Pv")>;
606def : InstRW<[M3WriteNMSC3], (instregex "^[SU](MIN|MAX)Vv")>;
607def : InstRW<[M3WriteNMUL3], (instregex "^(MUL|SQR?DMULH)v")>;
608def : InstRW<[M3WriteNMUL3,
609              M3ReadNMUL],   (instregex "^ML[AS]v")>;
610def : InstRW<[M3WriteNMUL3], (instregex "^[SU]ML[AS]Lv")>;
611def : InstRW<[M3WriteNMUL3], (instregex "^SQDML[AS]L")>;
612def : InstRW<[M3WriteNMUL3], (instregex "^(S|U|SQD)MULLv")>;
613def : InstRW<[M3WriteNMSC3], (instregex "^[SU]ADALPv")>;
614def : InstRW<[M3WriteNSHT3], (instregex "^[SU]R?SRAv")>;
615def : InstRW<[M3WriteNSHT1], (instregex "^SHL[dv]")>;
616def : InstRW<[M3WriteNSHT1], (instregex "^[SU]SH[LR][dv]")>;
617def : InstRW<[M3WriteNSHT1], (instregex "^S[RS]I[dv]")>;
618def : InstRW<[M3WriteNSHT2], (instregex "^[SU]?SHLLv")>;
619def : InstRW<[M3WriteNSHT3], (instregex "^(([SU]Q)?R)?SHRU?N[bhsv]")>;
620def : InstRW<[M3WriteNSHT3], (instregex "^[SU]RSH[LR][dv]")>;
621def : InstRW<[M3WriteNSHT3], (instregex "^[SU]QR?SHLU?[bdhsv]")>;
622
623// ASIMD FP instructions.
624def : InstRW<[M3WriteNSHF1],  (instregex "^FABSv")>;
625def : InstRW<[M3WriteFADD2],  (instregex "^F(ABD|ADD|SUB)v")>;
626def : InstRW<[M3WriteNEONA],  (instregex "^FADDP")>;
627def : InstRW<[M3WriteNMSC1],  (instregex "^F(AC|CM)(EQ|GE|GT|LE|LT)v[^1]")>;
628def : InstRW<[M3WriteFCVT3],  (instregex "^FCVT(L|N|XN)v")>;
629def : InstRW<[M3WriteFCVT2],  (instregex "^FCVT[AMNPZ][SU]v")>;
630def : InstRW<[M3WriteFCVT2],  (instregex "^[SU]CVTFv")>;
631def : InstRW<[M3WriteFDIV10], (instrs FDIVv2f32)>;
632def : InstRW<[M3WriteNEONV],  (instrs FDIVv4f32)>;
633def : InstRW<[M3WriteNEONW],  (instrs FDIVv2f64)>;
634def : InstRW<[M3WriteNMSC1],  (instregex "^F(MAX|MIN)(NM)?v")>;
635def : InstRW<[M3WriteNMSC2],  (instregex "^F(MAX|MIN)(NM)?Pv")>;
636def : InstRW<[M3WriteNEONZ],  (instregex "^F(MAX|MIN)(NM)?Vv")>;
637def : InstRW<[M3WriteFMAC3],  (instregex "^FMULX?v.[fi]")>;
638def : InstRW<[M3WriteFMAC4,
639              M3ReadFMAC],    (instregex "^FML[AS]v.f")>;
640def : InstRW<[M3WriteFMAC5,
641              M3ReadFMAC],    (instregex "^FML[AS]v.i")>;
642def : InstRW<[M3WriteNALU1],  (instregex "^FNEGv")>;
643def : InstRW<[M3WriteFCVT3A], (instregex "^FRINT[AIMNPXZ]v")>;
644def : InstRW<[M3WriteFSQR17], (instrs FSQRTv2f32)>;
645def : InstRW<[M3WriteNEONX],  (instrs FSQRTv4f32)>;
646def : InstRW<[M3WriteNEONY],  (instrs FSQRTv2f64)>;
647
648// ASIMD miscellaneous instructions.
649def : InstRW<[M3WriteNALU1], (instregex "^RBITv")>;
650def : InstRW<[M3WriteNALU1], (instregex "^(BIF|BIT|BSL)v")>;
651def : InstRW<[M3WriteNEONB], (instregex "^DUPv.+gpr")>;
652def : InstRW<[M3WriteNSHF1], (instregex "^DUPv.+lane")>;
653def : InstRW<[M3WriteNSHF1], (instregex "^EXTv")>;
654def : InstRW<[M3WriteNSHF1], (instregex "^[SU]?Q?XTU?Nv")>;
655def : InstRW<[M3WriteNSHF1], (instregex "^CPY")>;
656def : InstRW<[M3WriteNSHF1], (instregex "^INSv.+lane")>;
657def : InstRW<[M3WriteMOVI],  (instregex "^MOVI")>;
658def : InstRW<[M3WriteNALU1], (instregex "^FMOVv")>;
659def : InstRW<[M3WriteFCVT4], (instregex "^[FU](RECP|RSQRT)Ev[248]")>;
660def : InstRW<[M3WriteFMAC4,
661              M3ReadFMAC],   (instregex "^F(RECP|RSQRT)Sv")>;
662def : InstRW<[M3WriteNSHF1], (instregex "^REV(16|32|64)v")>;
663def : InstRW<[M3WriteNSHF1], (instregex "^TB[LX]v")>;
664def : InstRW<[M3WriteNEOND], (instregex "^[SU]MOVv")>;
665def : InstRW<[M3WriteNSHF3], (instregex "^INSv.+gpr")>;
666def : InstRW<[M3WriteNSHF1], (instregex "^(TRN|UZP|ZIP)[12]v")>;
667
668// ASIMD load instructions.
669def : InstRW<[M3WriteL5],   (instregex "LD1Onev(8b|4h|2s|1d)$")>;
670def : InstRW<[M3WriteL5,
671              WriteAdr],    (instregex "LD1Onev(8b|4h|2s|1d)_POST")>;
672def : InstRW<[M3WriteL5],   (instregex "LD1Onev(16b|8h|4s|2d)$")>;
673def : InstRW<[M3WriteL5,
674              WriteAdr],    (instregex "LD1Onev(16b|8h|4s|2d)_POST")>;
675
676def : InstRW<[M3WriteVLDA], (instregex "LD1Twov(8b|4h|2s|1d)$")>;
677def : InstRW<[M3WriteVLDA,
678              WriteAdr],    (instregex "LD1Twov(8b|4h|2s|1d)_POST")>;
679def : InstRW<[M3WriteVLDA], (instregex "LD1Twov(16b|8h|4s|2d)$")>;
680def : InstRW<[M3WriteVLDA,
681              WriteAdr],    (instregex "LD1Twov(16b|8h|4s|2d)_POST")>;
682
683def : InstRW<[M3WriteVLDB], (instregex "LD1Threev(8b|4h|2s|1d)$")>;
684def : InstRW<[M3WriteVLDB,
685              WriteAdr],    (instregex "LD1Threev(8b|4h|2s|1d)_POST")>;
686def : InstRW<[M3WriteVLDB], (instregex "LD1Threev(16b|8h|4s|2d)$")>;
687def : InstRW<[M3WriteVLDB,
688              WriteAdr],    (instregex "LD1Threev(16b|8h|4s|2d)_POST")>;
689
690def : InstRW<[M3WriteVLDC], (instregex "LD1Fourv(8b|4h|2s|1d)$")>;
691def : InstRW<[M3WriteVLDC,
692              WriteAdr],    (instregex "LD1Fourv(8b|4h|2s|1d)_POST")>;
693def : InstRW<[M3WriteVLDC], (instregex "LD1Fourv(16b|8h|4s|2d)$")>;
694def : InstRW<[M3WriteVLDC,
695              WriteAdr],    (instregex "LD1Fourv(16b|8h|4s|2d)_POST")>;
696
697def : InstRW<[M3WriteVLDD], (instregex "LD1i(8|16|32)$")>;
698def : InstRW<[M3WriteVLDD,
699              WriteAdr],    (instregex "LD1i(8|16|32)_POST")>;
700def : InstRW<[M3WriteVLDE], (instregex "LD1i(64)$")>;
701def : InstRW<[M3WriteVLDE,
702              WriteAdr],    (instregex "LD1i(64)_POST")>;
703
704def : InstRW<[M3WriteL5],   (instregex "LD1Rv(8b|4h|2s|1d)$")>;
705def : InstRW<[M3WriteL5,
706              WriteAdr],    (instregex "LD1Rv(8b|4h|2s|1d)_POST")>;
707def : InstRW<[M3WriteL5],   (instregex "LD1Rv(16b|8h|4s|2d)$")>;
708def : InstRW<[M3WriteL5,
709              WriteAdr],    (instregex "LD1Rv(16b|8h|4s|2d)_POST")>;
710
711def : InstRW<[M3WriteVLDF], (instregex "LD2Twov(8b|4h|2s)$")>;
712def : InstRW<[M3WriteVLDF,
713              WriteAdr],    (instregex "LD2Twov(8b|4h|2s)_POST")>;
714def : InstRW<[M3WriteVLDF], (instregex "LD2Twov(16b|8h|4s|2d)$")>;
715def : InstRW<[M3WriteVLDF,
716              WriteAdr],    (instregex "LD2Twov(16b|8h|4s|2d)_POST")>;
717
718def : InstRW<[M3WriteVLDG], (instregex "LD2i(8|16|32)$")>;
719def : InstRW<[M3WriteVLDG,
720              WriteAdr],    (instregex "LD2i(8|16|32)_POST")>;
721def : InstRW<[M3WriteVLDH], (instregex "LD2i(64)$")>;
722def : InstRW<[M3WriteVLDH,
723              WriteAdr],    (instregex "LD2i(64)_POST")>;
724
725def : InstRW<[M3WriteVLDA], (instregex "LD2Rv(8b|4h|2s|1d)$")>;
726def : InstRW<[M3WriteVLDA,
727              WriteAdr],    (instregex "LD2Rv(8b|4h|2s|1d)_POST")>;
728def : InstRW<[M3WriteVLDA], (instregex "LD2Rv(16b|8h|4s|2d)$")>;
729def : InstRW<[M3WriteVLDA,
730              WriteAdr],    (instregex "LD2Rv(16b|8h|4s|2d)_POST")>;
731
732def : InstRW<[M3WriteVLDI], (instregex "LD3Threev(8b|4h|2s)$")>;
733def : InstRW<[M3WriteVLDI,
734              WriteAdr],    (instregex "LD3Threev(8b|4h|2s)_POST")>;
735def : InstRW<[M3WriteVLDI], (instregex "LD3Threev(16b|8h|4s|2d)$")>;
736def : InstRW<[M3WriteVLDI,
737              WriteAdr],    (instregex "LD3Threev(16b|8h|4s|2d)_POST")>;
738
739def : InstRW<[M3WriteVLDJ], (instregex "LD3i(8|16|32)$")>;
740def : InstRW<[M3WriteVLDJ,
741              WriteAdr],    (instregex "LD3i(8|16|32)_POST")>;
742def : InstRW<[M3WriteVLDL], (instregex "LD3i(64)$")>;
743def : InstRW<[M3WriteVLDL,
744              WriteAdr],    (instregex "LD3i(64)_POST")>;
745
746def : InstRW<[M3WriteVLDB], (instregex "LD3Rv(8b|4h|2s|1d)$")>;
747def : InstRW<[M3WriteVLDB,
748              WriteAdr],    (instregex "LD3Rv(8b|4h|2s|1d)_POST")>;
749def : InstRW<[M3WriteVLDB], (instregex "LD3Rv(16b|8h|4s|2d)$")>;
750def : InstRW<[M3WriteVLDB,
751              WriteAdr],    (instregex "LD3Rv(16b|8h|4s|2d)_POST")>;
752
753def : InstRW<[M3WriteVLDN], (instregex "LD4Fourv(8b|4h|2s)$")>;
754def : InstRW<[M3WriteVLDN,
755              WriteAdr],    (instregex "LD4Fourv(8b|4h|2s)_POST")>;
756def : InstRW<[M3WriteVLDN], (instregex "LD4Fourv(16b|8h|4s|2d)$")>;
757def : InstRW<[M3WriteVLDN,
758              WriteAdr],    (instregex "LD4Fourv(16b|8h|4s|2d)_POST")>;
759
760def : InstRW<[M3WriteVLDK], (instregex "LD4i(8|16|32)$")>;
761def : InstRW<[M3WriteVLDK,
762              WriteAdr],    (instregex "LD4i(8|16|32)_POST")>;
763def : InstRW<[M3WriteVLDM], (instregex "LD4i(64)$")>;
764def : InstRW<[M3WriteVLDM,
765              WriteAdr],    (instregex "LD4i(64)_POST")>;
766
767def : InstRW<[M3WriteVLDC], (instregex "LD4Rv(8b|4h|2s|1d)$")>;
768def : InstRW<[M3WriteVLDC,
769              WriteAdr],    (instregex "LD4Rv(8b|4h|2s|1d)_POST")>;
770def : InstRW<[M3WriteVLDC], (instregex "LD4Rv(16b|8h|4s|2d)$")>;
771def : InstRW<[M3WriteVLDC,
772              WriteAdr],    (instregex "LD4Rv(16b|8h|4s|2d)_POST")>;
773
774// ASIMD store instructions.
775def : InstRW<[WriteVST],    (instregex "ST1Onev(8b|4h|2s|1d)$")>;
776def : InstRW<[WriteVST,
777              WriteAdr],    (instregex "ST1Onev(8b|4h|2s|1d)_POST")>;
778def : InstRW<[WriteVST],    (instregex "ST1Onev(16b|8h|4s|2d)$")>;
779def : InstRW<[WriteVST,
780              WriteAdr],    (instregex "ST1Onev(16b|8h|4s|2d)_POST")>;
781
782def : InstRW<[M3WriteVSTA], (instregex "ST1Twov(8b|4h|2s|1d)$")>;
783def : InstRW<[M3WriteVSTA,
784              WriteAdr],    (instregex "ST1Twov(8b|4h|2s|1d)_POST")>;
785def : InstRW<[M3WriteVSTA], (instregex "ST1Twov(16b|8h|4s|2d)$")>;
786def : InstRW<[M3WriteVSTA,
787              WriteAdr],    (instregex "ST1Twov(16b|8h|4s|2d)_POST")>;
788
789def : InstRW<[M3WriteVSTB], (instregex "ST1Threev(8b|4h|2s|1d)$")>;
790def : InstRW<[M3WriteVSTB,
791              WriteAdr],    (instregex "ST1Threev(8b|4h|2s|1d)_POST")>;
792def : InstRW<[M3WriteVSTB], (instregex "ST1Threev(16b|8h|4s|2d)$")>;
793def : InstRW<[M3WriteVSTB,
794              WriteAdr],    (instregex "ST1Threev(16b|8h|4s|2d)_POST")>;
795
796def : InstRW<[M3WriteVSTC], (instregex "ST1Fourv(8b|4h|2s|1d)$")>;
797def : InstRW<[M3WriteVSTC,
798              WriteAdr],    (instregex "ST1Fourv(8b|4h|2s|1d)_POST")>;
799def : InstRW<[M3WriteVSTC], (instregex "ST1Fourv(16b|8h|4s|2d)$")>;
800def : InstRW<[M3WriteVSTC,
801              WriteAdr],    (instregex "ST1Fourv(16b|8h|4s|2d)_POST")>;
802
803def : InstRW<[M3WriteVSTD], (instregex "ST1i(8|16|32|64)$")>;
804def : InstRW<[M3WriteVSTD,
805              WriteAdr],    (instregex "ST1i(8|16|32|64)_POST")>;
806
807def : InstRW<[M3WriteVSTD], (instregex "ST2Twov(8b|4h|2s)$")>;
808def : InstRW<[M3WriteVSTD,
809              WriteAdr],    (instregex "ST2Twov(8b|4h|2s)_POST")>;
810def : InstRW<[M3WriteVSTE], (instregex "ST2Twov(16b|8h|4s|2d)$")>;
811def : InstRW<[M3WriteVSTE,
812              WriteAdr],    (instregex "ST2Twov(16b|8h|4s|2d)_POST")>;
813
814def : InstRW<[M3WriteVSTD], (instregex "ST2i(8|16|32)$")>;
815def : InstRW<[M3WriteVSTD,
816              WriteAdr],    (instregex "ST2i(8|16|32)_POST")>;
817def : InstRW<[M3WriteVSTD], (instregex "ST2i(64)$")>;
818def : InstRW<[M3WriteVSTD,
819              WriteAdr],    (instregex "ST2i(64)_POST")>;
820
821def : InstRW<[M3WriteVSTF], (instregex "ST3Threev(8b|4h|2s)$")>;
822def : InstRW<[M3WriteVSTF,
823              WriteAdr],    (instregex "ST3Threev(8b|4h|2s)_POST")>;
824def : InstRW<[M3WriteVSTG], (instregex "ST3Threev(16b|8h|4s|2d)$")>;
825def : InstRW<[M3WriteVSTG,
826              WriteAdr],    (instregex "ST3Threev(16b|8h|4s|2d)_POST")>;
827
828def : InstRW<[M3WriteVSTH], (instregex "ST3i(8|16|32)$")>;
829def : InstRW<[M3WriteVSTH,
830              WriteAdr],    (instregex "ST3i(8|16|32)_POST")>;
831def : InstRW<[M3WriteVSTF], (instregex "ST3i(64)$")>;
832def : InstRW<[M3WriteVSTF,
833              WriteAdr],    (instregex "ST3i(64)_POST")>;
834
835def : InstRW<[M3WriteVSTF], (instregex "ST4Fourv(8b|4h|2s)$")>;
836def : InstRW<[M3WriteVSTF,
837              WriteAdr],    (instregex "ST4Fourv(8b|4h|2s)_POST")>;
838def : InstRW<[M3WriteVSTI], (instregex "ST4Fourv(16b|8h|4s|2d)$")>;
839def : InstRW<[M3WriteVSTI,
840              WriteAdr],    (instregex "ST4Fourv(16b|8h|4s|2d)_POST")>;
841
842def : InstRW<[M3WriteVSTF], (instregex "ST4i(8|16|32|64)$")>;
843def : InstRW<[M3WriteVSTF,
844              WriteAdr],    (instregex "ST4i(8|16|32|64)_POST")>;
845
846// Cryptography instructions.
847def : InstRW<[M3WriteAES],    (instregex "^AES[DE]")>;
848def : InstRW<[M3WriteAES,
849              M3ReadAES],     (instregex "^AESI?MC")>;
850
851def : InstRW<[M3WriteNCRY3A], (instregex "^PMULL?v")>;
852
853def : InstRW<[M3WriteNCRY1A], (instregex "^SHA1([CHMP]|SU[01])")>;
854def : InstRW<[M3WriteNCRY1A], (instregex "^SHA256SU0")>;
855def : InstRW<[M3WriteNCRY5A], (instregex "^SHA256(H2?|SU1)")>;
856
857// CRC instructions.
858def : InstRW<[M3WriteC2], (instregex "^CRC32")>;
859
860} // SchedModel = ExynosM3Model
861