xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedThunderX3T110.td (revision d5b0e70f7e04d971691517ce1304d86a1e367e2e)
1//=- AArch64SchedThunderX3T110.td - Marvell ThunderX3 T110 ---*- tablegen -*-=//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines the scheduling model for Marvell ThunderX3T110
10// family of processors.
11//
12//===----------------------------------------------------------------------===//
13
14//===----------------------------------------------------------------------===//
15// Pipeline Description.
16
17def ThunderX3T110Model : SchedMachineModel {
18  let IssueWidth            =   4; // 4 micro-ops dispatched at a time.
19  let MicroOpBufferSize     =  70; // 70 entries in micro-op re-order buffer.
20  let LoadLatency           =   4; // Optimistic load latency.
21  let MispredictPenalty     =  12; // Extra cycles for mispredicted branch.
22  // Determined via a mix of micro-arch details and experimentation.
23  let LoopMicroOpBufferSize = 128; // FIXME: might be much bigger in TX3.
24  let PostRAScheduler       =   1; // Using PostRA sched.
25  let CompleteModel         =   1;
26
27  list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
28                                                    PAUnsupported.F);
29  // FIXME: Remove when all errors have been fixed.
30  let FullInstRWOverlapCheck = 0;
31}
32
33let SchedModel = ThunderX3T110Model in {
34
35// Issue ports.
36
37// Port 0: ALU.
38def THX3T110P0 : ProcResource<1>;
39
40// Port 1: ALU.
41def THX3T110P1 : ProcResource<1>;
42
43// Port 2: ALU/Branch.
44def THX3T110P2 : ProcResource<1>;
45
46// Port 3: ALU/Branch.
47def THX3T110P3 : ProcResource<1>;
48
49// Port 4: Load/Store.
50def THX3T110P4 : ProcResource<1>;
51
52// Port 5: Load/store.
53def THX3T110P5 : ProcResource<1>;
54
55// Port 6: FP/Neon/SIMD/Crypto.
56def THX3T110P6FP0 : ProcResource<1>;
57
58// Port 7: FP/Neon/SIMD/Crypto.
59def THX3T110P7FP1 : ProcResource<1>;
60
61// Port 8: FP/Neon/SIMD/Crypto.
62def THX3T110P8FP2 : ProcResource<1>;
63
64// Port 9: FP/Neon/SIMD/Crypto.
65def THX3T110P9FP3 : ProcResource<1>;
66
67// Port 10: Store Data Unit.
68def THX3T110SD0 : ProcResource<1>;
69
70// Define groups for the functional units on each issue port.  Each group
71// created will be used by a WriteRes.
72
73// Integer divide/mulhi micro-ops only on port I1.
74def THX3T110I1 : ProcResGroup<[THX3T110P1]>;
75
76// Branch micro-ops on ports I2/I3.
77def THX3T110I23 : ProcResGroup<[THX3T110P2, THX3T110P3]>;
78
79// Branch micro-ops on ports I1/I2/I3.
80def THX3T110I123 : ProcResGroup<[THX3T110P1, THX3T110P2, THX3T110P3]>;
81
82// Integer micro-ops on ports I0/I1/I2.
83def THX3T110I012 : ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2]>;
84
85// Integer micro-ops on ports I0/I1/I2/I3.
86def THX3T110I0123 : ProcResGroup<[THX3T110P0, THX3T110P1,
87                                  THX3T110P2, THX3T110P3]>;
88
89// FP micro-ops on ports FP0/FP1/FP2/FP3.
90def THX3T110FP0123 : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1,
91                                   THX3T110P8FP2, THX3T110P9FP3]>;
92
93// FP micro-ops on ports FP2/FP3.
94def THX3T110FP23 : ProcResGroup<[THX3T110P8FP2, THX3T110P9FP3]>;
95
96// ASIMD micro-ops on ports FP0/FP1/FP2/FP3.
97def THX3T110SIMD : ProcResGroup<[THX3T110P6FP0, THX3T110P7FP1,
98                                 THX3T110P8FP2, THX3T110P9FP3]>;
99
100// Store data micro-ops only on port 10.
101def THX3T110SD : ProcResGroup<[THX3T110SD0]>;
102
103// Load/store micro-ops on ports P4/P5.
104def THX3T110LS : ProcResGroup<[THX3T110P4, THX3T110P5]>;
105
106// 70 entry unified scheduler.
107def THX3T110ANY: ProcResGroup<[THX3T110P0, THX3T110P1, THX3T110P2,
108                               THX3T110P3, THX3T110P4, THX3T110P5,
109                               THX3T110P6FP0, THX3T110P7FP1,
110                               THX3T110P8FP2, THX3T110P9FP3]> {
111  let BufferSize = 70;
112}
113
114// Define commonly used write types for InstRW specializations.
115// All definitions follow the format: THX3T110Write_<NumCycles>Cyc_<Resources>.
116
117// 3 cycles on I1.
118def THX3T110Write_3Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
119  let Latency = 3;
120  let NumMicroOps = 2;
121}
122
123// 4 cycles on I1.
124def THX3T110Write_4Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
125  let Latency = 4;
126  let NumMicroOps = 2;
127}
128
129// 5 cycles on I1.
130def THX3T110Write_5Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
131  let Latency = 5;
132  let NumMicroOps = 2;
133}
134
135// 7 cycles on I1.
136def THX3T110Write_7Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
137  let Latency = 7;
138  let NumMicroOps = 3;
139}
140
141// 23 cycles on I1.
142def THX3T110Write_23Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
143  let Latency = 23;
144  let ResourceCycles = [13, 23];
145  let NumMicroOps = 4;
146}
147
148// 39 cycles on I1.
149def THX3T110Write_39Cyc_I1 : SchedWriteRes<[THX3T110I1]> {
150  let Latency = 39;
151  let ResourceCycles = [13, 39];
152  let NumMicroOps = 4;
153}
154
155// 1 cycle on I2/I3
156def THX3T110Write_1Cyc_I23 : SchedWriteRes<[THX3T110I23]> {
157  let Latency = 1;
158  let NumMicroOps = 2;
159}
160
161// 8 cycles on I2/I3
162def THX3T110Write_8Cyc_I23 : SchedWriteRes<[THX3T110I23]> {
163  let Latency = 8;
164  let NumMicroOps = 3;
165}
166
167// 1 cycle on I1/I2/I3
168def THX3T110Write_1Cyc_I123 : SchedWriteRes<[THX3T110I123]> {
169  let Latency = 1;
170  let NumMicroOps = 2;
171}
172
173// 8 cycles on I1/I2/I3
174def THX3T110Write_8Cyc_I123 : SchedWriteRes<[THX3T110I123]> {
175  let Latency = 8;
176  let NumMicroOps = 3;
177}
178
179// 1 cycle on I0/I1/I2/I3.
180def THX3T110Write_1Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
181  let Latency = 1;
182  let NumMicroOps = 2;
183}
184
185// 2 cycles on I0/I1/I2/I3.
186def THX3T110Write_2Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
187  let Latency = 2;
188  let NumMicroOps = 2;
189}
190
191// 3 cycles on I0/I1/I2/I3.
192def THX3T110Write_3Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
193  let Latency = 3;
194  let NumMicroOps = 2;
195}
196
197// 4 cycles on I0/I1/I2/I3.
198def THX3T110Write_4Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
199  let Latency = 4;
200  let NumMicroOps = 3;
201}
202
203// 5 cycles on I0/I1/I2/I3.
204def THX3T110Write_5Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
205  let Latency = 5;
206  let NumMicroOps = 3;
207}
208
209// 6 cycles on I0/I1/I2/I3.
210def THX3T110Write_6Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
211  let Latency = 6;
212  let NumMicroOps = 3;
213}
214
215// 8 cycles on I0/I1/I2/I3.
216def THX3T110Write_8Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
217  let Latency = 8;
218  let NumMicroOps = 4;
219}
220
221// 13 cycles on I0/I1/I2/I3.
222def THX3T110Write_13Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
223  let Latency = 13;
224  let NumMicroOps = 3;
225}
226
227// 23 cycles on I0/I1/I2/I3.
228def THX3T110Write_23Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
229  let Latency = 23;
230  let NumMicroOps = 3;
231}
232
233// 39 cycles on I0/I1/I2/I3.
234def THX3T110Write_39Cyc_I0123 : SchedWriteRes<[THX3T110I0123]> {
235  let Latency = 39;
236  let NumMicroOps = 3;
237}
238
239// 4 cycles on F2/F3.
240def THX3T110Write_4Cyc_F23 : SchedWriteRes<[THX3T110FP23]> {
241  let Latency = 4;
242  let NumMicroOps = 2;
243}
244
245// 5 cycles on F0/F1/F2/F3.
246def THX3T110Write_5Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
247  let Latency = 5;
248  let NumMicroOps = 2;
249}
250
251// 6 cycles on F0/F1/F2/F3.
252def THX3T110Write_6Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
253  let Latency = 6;
254  let NumMicroOps = 3;
255}
256
257// 7 cycles on F0/F1/F2/F3.
258def THX3T110Write_7Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
259  let Latency = 7;
260  let NumMicroOps = 3;
261}
262
263// 8 cycles on F0/F1/F2/F3.
264def THX3T110Write_8Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
265  let Latency = 8;
266  let NumMicroOps = 3;
267}
268
269// 10 cycles on F0/F1/F2/F3.
270def THX3T110Write_10Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
271  let Latency = 10;
272  let NumMicroOps = 3;
273}
274
275// 16 cycles on F0/F1/F2/F3.
276def THX3T110Write_16Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
277  let Latency = 16;
278  let NumMicroOps = 3;
279  let ResourceCycles = [8];
280}
281
282// 23 cycles on F0/F1/F2/F3.
283def THX3T110Write_23Cyc_F01 : SchedWriteRes<[THX3T110FP0123]> {
284  let Latency = 23;
285  let NumMicroOps = 3;
286  let ResourceCycles = [11];
287}
288
289// 1 cycle on LS0/LS1.
290def THX3T110Write_1Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
291  let Latency = 1;
292  let NumMicroOps = 1;
293}
294
295// 2 cycles on LS0/LS1.
296def THX3T110Write_2Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
297  let Latency = 2;
298  let NumMicroOps = 2;
299}
300
301// 4 cycles on LS0/LS1.
302def THX3T110Write_4Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
303  let Latency = 4;
304  let NumMicroOps = 2;
305  let ResourceCycles = [2];
306}
307
308// 5 cycles on LS0/LS1.
309def THX3T110Write_5Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
310  let Latency = 5;
311  let NumMicroOps = 3;
312}
313
314// 6 cycles on LS0/LS1.
315def THX3T110Write_6Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
316  let Latency = 6;
317  let NumMicroOps = 3;
318}
319
320// 4 + 5 cycles on LS0/LS1.
321// First resource is available after 4 cycles.
322// Second resource is available after 5 cycles.
323// Load vector pair, immed offset, Q-form [LDP/LDNP].
324def THX3T110Write_4_5Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
325  let Latency = 4;
326  let NumMicroOps = 2;
327  let ResourceCycles = [4, 5];
328}
329
330// 4 + 8 cycles on LS0/LS1.
331// First resource is available after 4 cycles.
332// Second resource is available after 8 cycles.
333// Load vector pair, immed offset, S/D-form [LDP/LDNP].
334def THX3T110Write_4_8Cyc_LS01 : SchedWriteRes<[THX3T110LS]> {
335  let Latency = 4;
336  let NumMicroOps = 2;
337  let ResourceCycles = [4, 8];
338}
339
340// 11 cycles on LS0/LS1 and I1.
341def THX3T110Write_11Cyc_LS01_I1 :
342  SchedWriteRes<[THX3T110LS, THX3T110I1]> {
343  let Latency = 11;
344  let NumMicroOps = 4;
345}
346
347// 1 cycles on LS0/LS1 and I0/I1/I2/I3.
348def THX3T110Write_1Cyc_LS01_I0123 :
349  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
350  let Latency = 1;
351  let NumMicroOps = 2;
352}
353
354// 1 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
355def THX3T110Write_1Cyc_LS01_I0123_I0123 :
356  SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
357  let Latency = 1;
358  let NumMicroOps = 3;
359}
360
361// 4 cycles on LS0/LS1 and I0/I1/I2/I3.
362def THX3T110Write_4Cyc_LS01_I0123 :
363  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
364  let Latency = 4;
365  let NumMicroOps = 3;
366}
367
368// 4 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
369def THX3T110Write_4Cyc_LS01_I0123_I0123 :
370  SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
371  let Latency = 4;
372  let NumMicroOps = 3;
373}
374
375// 5 cycles on LS0/LS1 and I0/I1/I2/I3.
376def THX3T110Write_5Cyc_LS01_I0123 :
377  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
378  let Latency = 5;
379  let NumMicroOps = 3;
380}
381
382// 5 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
383def THX3T110Write_5Cyc_LS01_I0123_I0123 :
384  SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
385  let Latency = 5;
386  let NumMicroOps = 3;
387}
388
389// 6 cycles on LS0/LS1 and I0/I1/I2/I3.
390def THX3T110Write_6Cyc_LS01_I012 :
391  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
392  let Latency = 6;
393  let NumMicroOps = 4;
394}
395
396// 6 cycles on LS0/LS1 and 2 of I0/I1/I2/I3.
397def THX3T110Write_6Cyc_LS01_I0123_I0123 :
398  SchedWriteRes<[THX3T110LS, THX3T110I0123, THX3T110I0123]> {
399  let Latency = 6;
400  let NumMicroOps = 3;
401}
402
403// 1 cycle on LS0/LS1 and SD.
404def THX3T110Write_1Cyc_LS01_SD :
405  SchedWriteRes<[THX3T110LS, THX3T110SD]> {
406  let Latency = 1;
407  let NumMicroOps = 2;
408}
409
410// 2 cycles on LS0/LS1 and SD.
411def THX3T110Write_2Cyc_LS01_SD :
412  SchedWriteRes<[THX3T110LS, THX3T110SD]> {
413  let Latency = 2;
414  let NumMicroOps = 2;
415}
416
417// 4 cycles on LS0/LS1 and SD.
418def THX3T110Write_4Cyc_LS01_SD :
419  SchedWriteRes<[THX3T110LS, THX3T110SD]> {
420  let Latency = 4;
421  let NumMicroOps = 3;
422}
423
424// 5 cycles on LS0/LS1 and SD.
425def THX3T110Write_5Cyc_LS01_SD :
426  SchedWriteRes<[THX3T110LS, THX3T110SD]> {
427  let Latency = 5;
428  let NumMicroOps = 4;
429}
430
431// 6 cycles on LS0/LS1 and SD.
432def THX3T110Write_6Cyc_LS01_SD :
433  SchedWriteRes<[THX3T110LS, THX3T110SD]> {
434  let Latency = 6;
435  let NumMicroOps = 5;
436}
437
438// 1 cycle on LS0/LS1, SD and I0/I1/I2/I3.
439def THX3T110Write_1Cyc_LS01_SD_I0123 :
440  SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
441  let Latency = 1;
442  let NumMicroOps = 2;
443}
444
445// 2 cycles on LS0/LS1, SD and I0/I1/I2/I3.
446def THX3T110Write_2Cyc_LS01_SD_I0123 :
447  SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
448  let Latency = 2;
449  let NumMicroOps = 2;
450}
451
452// 4 cycles on LS0/LS1, SD and I0/I1/I2/I3.
453def THX3T110Write_4Cyc_LS01_SD_I0123 :
454  SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
455  let Latency = 4;
456  let NumMicroOps = 3;
457}
458
459// 5 cycles on LS0/LS1, SD and I0/I1/I2/I3.
460def THX3T110Write_5Cyc_LS01_SD_I0123 :
461  SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
462  let Latency = 5;
463  let NumMicroOps = 4;
464}
465
466// 6 cycles on LS0/LS1, SD and I0/I1/I2/I3.
467def THX3T110Write_6Cyc_LS01_SD_I0123 :
468  SchedWriteRes<[THX3T110LS, THX3T110SD, THX3T110I0123]> {
469  let Latency = 6;
470  let NumMicroOps = 5;
471}
472
473// 1 cycles on LS0/LS1 and F0/F1/F2/F3.
474def THX3T110Write_1Cyc_LS01_F0123 :
475  SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
476  let Latency = 1;
477  let NumMicroOps = 2;
478}
479
480// 5 cycles on LS0/LS1 and F0/F1/F2/F3.
481def THX3T110Write_5Cyc_LS01_F0123 :
482  SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
483  let Latency = 5;
484  let NumMicroOps = 3;
485}
486
487// 6 cycles on LS0/LS1 and F0/F1/F2/F3.
488def THX3T110Write_6Cyc_LS01_F0123 :
489  SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
490  let Latency = 6;
491  let NumMicroOps = 3;
492}
493
494// 7 cycles on LS0/LS1 and F0/F1/F2/F3.
495def THX3T110Write_7Cyc_LS01_F0123 :
496  SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
497  let Latency = 7;
498  let NumMicroOps = 3;
499}
500
501// 8 cycles on LS0/LS1 and F0/F1/F2/F3.
502def THX3T110Write_8Cyc_LS01_F0123 :
503  SchedWriteRes<[THX3T110LS, THX3T110FP0123]> {
504  let Latency = 8;
505  let NumMicroOps = 3;
506}
507
508// 8 cycles on LS0/LS1 and I0/I1/I2/I3.
509def THX3T110Write_8Cyc_LS01_I0123 :
510  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
511  let Latency = 8;
512  let NumMicroOps = 3;
513}
514
515// 12 cycles on LS0/LS1 and I0/I1/I2/I3.
516def THX3T110Write_12Cyc_LS01_I0123 :
517  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
518  let Latency = 12;
519  let NumMicroOps = 4;
520}
521
522// 16 cycles on LS0/LS1 and I0/I1/I2/I3.
523def THX3T110Write_16Cyc_LS01_I0123 :
524  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
525  let Latency = 16;
526  let NumMicroOps = 5;
527}
528
529// 24 cycles on LS0/LS1 and I0/I1/I2/I3.
530def THX3T110Write_24Cyc_LS01_I0123 :
531  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
532  let Latency = 24;
533  let NumMicroOps = 10;
534}
535
536// 32 cycles on LS0/LS1 and I0/I1/I2/I3.
537def THX3T110Write_32Cyc_LS01_I0123 :
538  SchedWriteRes<[THX3T110LS, THX3T110I0123]> {
539  let Latency = 32;
540  let NumMicroOps = 14;
541}
542
543// 3 cycles on F0/F1/F2/F3.
544def THX3T110Write_3Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
545  let Latency = 3;
546  let NumMicroOps = 2;
547}
548
549// 4 cycles on F0/F1/F2/F3.
550def THX3T110Write_4Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
551  let Latency = 4;
552  let NumMicroOps = 2;
553}
554
555// 5 cycles on F0/F1/F2/F3.
556def THX3T110Write_5Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
557  let Latency = 5;
558  let NumMicroOps = 2;
559}
560
561// 10 cycles on F0/F1/F2/F3.
562def THX3T110Write_10Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
563  let Latency = 10;
564  let NumMicroOps = 4;
565}
566
567// 15 cycles on F0/F1/F2/F3.
568def THX3T110Write_15Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
569  let Latency = 15;
570  let NumMicroOps = 7;
571}
572
573// 16 cycles on F0/F1/F2/F3.
574def THX3T110Write_16Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
575  let Latency = 16;
576  let NumMicroOps = 3;
577}
578
579// 18 cycles on F0/F1/F2/F3.
580def THX3T110Write_18Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
581  let Latency = 18;
582  let NumMicroOps = 3;
583}
584
585// 19 cycles on F0/F1/F2/F3.
586def THX3T110Write_19Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
587  let Latency = 19;
588  let NumMicroOps = 4;
589}
590
591// 20 cycles on F0/F1/F2/F3.
592def THX3T110Write_20Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
593  let Latency = 20;
594  let NumMicroOps = 4;
595}
596
597// 23 cycles on F0/F1/F2/F3.
598def THX3T110Write_23Cyc_F0123 : SchedWriteRes<[THX3T110FP0123]> {
599  let Latency = 23;
600  let NumMicroOps = 4;
601}
602
603// 3 cycles on F2/F3 and 4 cycles on F0/F1/F2/F3.
604def THX3T110Write_3_4Cyc_F23_F0123 :
605  SchedWriteRes<[THX3T110FP23, THX3T110FP0123]> {
606  let Latency = 3;
607  let NumMicroOps = 2;
608  let ResourceCycles = [3, 4];
609}
610
611
612// Define commonly used read types.
613
614// No forwarding is provided for these types.
615def : ReadAdvance<ReadI,       0>;
616def : ReadAdvance<ReadISReg,   0>;
617def : ReadAdvance<ReadIEReg,   0>;
618def : ReadAdvance<ReadIM,      0>;
619def : ReadAdvance<ReadIMA,     0>;
620def : ReadAdvance<ReadID,      0>;
621def : ReadAdvance<ReadExtrHi,  0>;
622def : ReadAdvance<ReadAdrBase, 0>;
623def : ReadAdvance<ReadVLD,     0>;
624def : ReadAdvance<ReadST,      0>;
625
626//===----------------------------------------------------------------------===//
627// 3. Instruction Tables.
628
629//---
630// 3.1 Branch Instructions
631//---
632
633// Branch, immed
634// Branch and link, immed
635// Compare and branch
636def : WriteRes<WriteBr,      [THX3T110I23]> {
637  let Latency = 1;
638  let NumMicroOps = 2;
639}
640
641// Branch, register
642// Branch and link, register != LR
643// Branch and link, register = LR
644def : WriteRes<WriteBrReg,   [THX3T110I23]> {
645  let Latency = 1;
646  let NumMicroOps = 2;
647}
648
649def : WriteRes<WriteSys,     []> { let Latency = 1; }
650def : WriteRes<WriteBarrier, []> { let Latency = 1; }
651def : WriteRes<WriteHint,    []> { let Latency = 1; }
652
653def : WriteRes<WriteAtomic,  []> {
654  let Latency = 4;
655  let NumMicroOps = 2;
656}
657
658//---
659// Branch
660//---
661def : InstRW<[THX3T110Write_1Cyc_I23], (instrs B, BL, BR, BLR)>;
662def : InstRW<[THX3T110Write_1Cyc_I23], (instrs Bcc)>;
663def : InstRW<[THX3T110Write_1Cyc_I23], (instrs RET)>;
664def : InstRW<[THX3T110Write_1Cyc_I23],
665            (instrs CBZW, CBZX, CBNZW, CBNZX, TBZW, TBZX, TBNZW, TBNZX)>;
666
667//---
668// 3.2 Arithmetic and Logical Instructions
669// 3.3 Move and Shift Instructions
670//---
671
672
673// ALU, basic
674// Conditional compare
675// Conditional select
676// Address generation
677def : WriteRes<WriteI,       [THX3T110I0123]> {
678  let Latency = 1;
679  let ResourceCycles = [1];
680  let NumMicroOps = 2;
681}
682
683def : InstRW<[WriteI],
684            (instregex "ADD?(W|X)r(i|r|s|x)",   "ADDS?(W|X)r(i|r|s|x)(64)?",
685                       "AND?(W|X)r(i|r|s|x)",   "ANDS?(W|X)r(i|r|s|x)",
686                       "ADC(W|X)r",
687                       "BIC?(W|X)r(i|r|s|x)",   "BICS?(W|X)r(i|r|s|x)",
688                       "EON?(W|X)r(i|r|s|x)",   "ORN?(W|X)r(i|r|s|x)",
689                       "ORR?(W|X)r(i|r|s|x)",   "SUB?(W|X)r(i|r|s|x)",
690                       "SUBS?(W|X)r(i|r|s|x)",  "SBC(W|X)r",
691                       "SBCS(W|X)r",            "CCMN(W|X)(i|r)",
692                       "CCMP(W|X)(i|r)",        "CSEL(W|X)r",
693                       "CSINC(W|X)r",           "CSINV(W|X)r",
694                       "CSNEG(W|X)r")>;
695
696def : InstRW<[WriteI], (instrs COPY)>;
697
698// ALU, extend and/or shift
699def : WriteRes<WriteISReg,   [THX3T110I0123]> {
700  let Latency = 2;
701  let ResourceCycles = [2];
702  let NumMicroOps = 2;
703}
704
705def : InstRW<[WriteISReg],
706            (instregex "ADD?(W|X)r(i|r|s|x)",   "ADDS?(W|X)r(i|r|s|x)(64)?",
707                       "AND?(W|X)r(i|r|s|x)",   "ANDS?(W|X)r(i|r|s|x)",
708                       "ADC(W|X)r",
709                       "BIC?(W|X)r(i|r|s|x)",   "BICS?(W|X)r(i|r|s|x)",
710                       "EON?(W|X)r(i|r|s|x)",   "ORN?(W|X)r(i|r|s|x)",
711                       "ORR?(W|X)r(i|r|s|x)",   "SUB?(W|X)r(i|r|s|x)",
712                       "SUBS?(W|X)r(i|r|s|x)",  "SBC(W|X)r",
713                       "SBCS(W|X)r",            "CCMN(W|X)(i|r)",
714                       "CCMP(W|X)(i|r)",        "CSEL(W|X)r",
715                       "CSINC(W|X)r",           "CSINV(W|X)r",
716                       "CSNEG(W|X)r")>;
717
718def : WriteRes<WriteIEReg,   [THX3T110I0123]> {
719  let Latency = 1;
720  let ResourceCycles = [1];
721  let NumMicroOps = 2;
722}
723
724def : InstRW<[WriteIEReg],
725            (instregex "ADD?(W|X)r(i|r|s|x)",   "ADDS?(W|X)r(i|r|s|x)(64)?",
726                       "AND?(W|X)r(i|r|s|x)",   "ANDS?(W|X)r(i|r|s|x)",
727                       "ADC(W|X)r",
728                       "BIC?(W|X)r(i|r|s|x)",   "BICS?(W|X)r(i|r|s|x)",
729                       "EON?(W|X)r(i|r|s|x)",   "ORN?(W|X)r(i|r|s|x)",
730                       "ORR?(W|X)r(i|r|s|x)",   "SUB?(W|X)r(i|r|s|x)",
731                       "SUBS?(W|X)r(i|r|s|x)",  "SBC(W|X)r",
732                       "SBCS(W|X)r",            "CCMN(W|X)(i|r)",
733                       "CCMP(W|X)(i|r)",        "CSEL(W|X)r",
734                       "CSINC(W|X)r",           "CSINV(W|X)r",
735                       "CSNEG(W|X)r")>;
736
737// Move immed
738def : WriteRes<WriteImm,     [THX3T110I0123]> {
739  let Latency = 1;
740  let NumMicroOps = 2;
741}
742
743def : InstRW<[THX3T110Write_1Cyc_I0123],
744            (instrs MOVKWi, MOVKXi, MOVNWi, MOVNXi, MOVZWi, MOVZXi)>;
745
746def : InstRW<[THX3T110Write_1Cyc_I0123],
747            (instrs ASRVWr, ASRVXr, LSLVWr, LSLVXr, RORVWr, RORVXr)>;
748
749// Variable shift
750def : WriteRes<WriteIS,      [THX3T110I0123]> {
751  let Latency = 1;
752  let NumMicroOps = 2;
753}
754
755//---
756// 3.4 Divide and Multiply Instructions
757//---
758
759// Divide, W-form
760// Latency range of 13-23/13-39.
761def : WriteRes<WriteID32,    [THX3T110I1]> {
762  let Latency = 39;
763  let ResourceCycles = [39];
764  let NumMicroOps = 4;
765}
766
767// Divide, X-form
768def : WriteRes<WriteID64,    [THX3T110I1]> {
769  let Latency = 23;
770  let ResourceCycles = [23];
771  let NumMicroOps = 4;
772}
773
774// Multiply accumulate, W-form
775def : WriteRes<WriteIM32,    [THX3T110I0123]> {
776  let Latency = 5;
777  let NumMicroOps = 3;
778}
779
780// Multiply accumulate, X-form
781def : WriteRes<WriteIM64,    [THX3T110I0123]> {
782  let Latency = 5;
783  let NumMicroOps = 3;
784}
785
786//def : InstRW<[WriteIM32, ReadIM, ReadIM, ReadIMA, THX3T110Write_5Cyc_I012],
787//             (instrs MADDWrrr, MSUBWrrr)>;
788def : InstRW<[WriteIM32], (instrs MADDWrrr, MSUBWrrr)>;
789def : InstRW<[WriteIM32], (instrs MADDXrrr, MSUBXrrr)>;
790def : InstRW<[THX3T110Write_5Cyc_I0123],
791            (instregex "(S|U)(MADDL|MSUBL)rrr")>;
792
793def : InstRW<[WriteID32], (instrs SDIVWr, UDIVWr)>;
794def : InstRW<[WriteID64], (instrs SDIVXr, UDIVXr)>;
795
796// Bitfield extract, two reg
797def : WriteRes<WriteExtr,    [THX3T110I0123]> {
798  let Latency = 1;
799  let NumMicroOps = 2;
800}
801
802// Multiply high
803def : InstRW<[THX3T110Write_4Cyc_I1], (instrs SMULHrr, UMULHrr)>;
804
805// Miscellaneous Data-Processing Instructions
806// Bitfield extract
807def : InstRW<[THX3T110Write_1Cyc_I0123], (instrs EXTRWrri, EXTRXrri)>;
808
809// Bitifield move - basic
810def : InstRW<[THX3T110Write_1Cyc_I0123],
811            (instrs SBFMWri, SBFMXri, UBFMWri, UBFMXri)>;
812
813// Bitfield move, insert
814def : InstRW<[THX3T110Write_1Cyc_I0123], (instregex "^BFM")>;
815def : InstRW<[THX3T110Write_1Cyc_I0123], (instregex "(S|U)?BFM.*")>;
816
817// Count leading
818def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
819            (instregex "^CLS(W|X)r$", "^CLZ(W|X)r$")>;
820
821// Reverse bits
822def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instrs RBITWr, RBITXr)>;
823
824// Cryptography Extensions
825def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^AES[DE]")>;
826def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^AESI?MC")>;
827def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^PMULL")>;
828def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1SU0")>;
829def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1(H|SU1)")>;
830def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1[CMP]")>;
831def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA256SU0")>;
832def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA256(H|H2|SU1)")>;
833
834// CRC Instructions
835// def : InstRW<[THX3T110Write_4Cyc_I1], (instregex "^CRC32", "^CRC32C")>;
836def : InstRW<[THX3T110Write_4Cyc_I1],
837            (instrs CRC32Brr, CRC32Hrr, CRC32Wrr, CRC32Xrr)>;
838
839def : InstRW<[THX3T110Write_4Cyc_I1],
840            (instrs CRC32CBrr, CRC32CHrr, CRC32CWrr, CRC32CXrr)>;
841
842// Reverse bits/bytes
843// NOTE: Handled by WriteI.
844
845//---
846// 3.6 Load Instructions
847// 3.10 FP Load Instructions
848//---
849
850// Load register, literal
851// Load register, unscaled immed
852// Load register, immed unprivileged
853// Load register, unsigned immed
854def : WriteRes<WriteLD,      [THX3T110LS]> {
855  let Latency = 4;
856  let NumMicroOps = 4;
857}
858
859// Load register, immed post-index
860// NOTE: Handled by WriteLD, WriteI.
861// Load register, immed pre-index
862// NOTE: Handled by WriteLD, WriteAdr.
863def : WriteRes<WriteAdr,     [THX3T110I0123]> {
864  let Latency = 1;
865  let NumMicroOps = 2;
866}
867
868// Load pair, immed offset, normal
869// Load pair, immed offset, signed words, base != SP
870// Load pair, immed offset signed words, base = SP
871// LDP only breaks into *one* LS micro-op.  Thus
872// the resources are handled by WriteLD.
873def : WriteRes<WriteLDHi,    []> {
874  let Latency = 4;
875  let NumMicroOps = 4;
876}
877
878// Load register offset, basic
879// Load register, register offset, scale by 4/8
880// Load register, register offset, scale by 2
881// Load register offset, extend
882// Load register, register offset, extend, scale by 4/8
883// Load register, register offset, extend, scale by 2
884def THX3T110WriteLDIdx : SchedWriteVariant<[
885  SchedVar<ScaledIdxPred, [THX3T110Write_4Cyc_LS01_I0123_I0123]>,
886  SchedVar<NoSchedPred,   [THX3T110Write_4Cyc_LS01_I0123]>]>;
887def : SchedAlias<WriteLDIdx, THX3T110WriteLDIdx>;
888
889def THX3T110ReadAdrBase : SchedReadVariant<[
890  SchedVar<ScaledIdxPred, [ReadDefault]>,
891  SchedVar<NoSchedPred,   [ReadDefault]>]>;
892def : SchedAlias<ReadAdrBase, THX3T110ReadAdrBase>;
893
894// Load pair, immed pre-index, normal
895// Load pair, immed pre-index, signed words
896// Load pair, immed post-index, normal
897// Load pair, immed post-index, signed words
898def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPDi)>;
899def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPQi)>;
900def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPSi)>;
901def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPWi)>;
902def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPXi)>;
903
904def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPDi)>;
905def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPQi)>;
906def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPSi)>;
907def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPSWi)>;
908def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPWi)>;
909def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPXi)>;
910
911def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRBui)>;
912def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRDui)>;
913def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRHui)>;
914def : InstRW<[THX3T110Write_5Cyc_LS01], (instrs LDRQui)>;
915def : InstRW<[THX3T110Write_5Cyc_LS01], (instrs LDRSui)>;
916
917def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRDl)>;
918def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRQl)>;
919def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRWl)>;
920def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRXl)>;
921
922def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRBi)>;
923def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRHi)>;
924def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRWi)>;
925def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRXi)>;
926
927def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSBWi)>;
928def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSBXi)>;
929def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSHWi)>;
930def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSHXi)>;
931def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSWi)>;
932
933def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
934            (instrs LDPDpre)>;
935def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
936            (instrs LDPQpre)>;
937def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
938            (instrs LDPSpre)>;
939def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
940            (instrs LDPWpre)>;
941def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
942            (instrs LDPWpre)>;
943
944def : InstRW<[THX3T110Write_4Cyc_LS01, WriteAdr],
945            (instrs LDRBpre, LDRDpre, LDRHpre, LDRQpre,
946                    LDRSpre, LDRWpre, LDRXpre,
947                    LDRSBWpre, LDRSBXpre, LDRSBWpost, LDRSBXpost,
948                    LDRSHWpre, LDRSHXpre, LDRSHWpost, LDRSHXpost,
949                    LDRBBpre, LDRBBpost, LDRHHpre, LDRHHpost)>;
950
951def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
952            (instrs LDPDpost, LDPQpost, LDPSpost, LDPWpost, LDPXpost)>;
953
954def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteI],
955            (instrs LDRBpost, LDRDpost, LDRHpost,
956                    LDRQpost, LDRSpost, LDRWpost, LDRXpost)>;
957
958def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteLDHi, WriteAdr],
959            (instrs LDPDpre, LDPQpre, LDPSpre, LDPWpre, LDPXpre)>;
960
961def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteAdr],
962            (instrs LDRBpre, LDRDpre, LDRHpre, LDRQpre,
963                    LDRSpre, LDRWpre, LDRXpre)>;
964
965def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteLDHi, WriteAdr],
966            (instrs LDPDpost, LDPQpost, LDPSpost, LDPWpost, LDPXpost)>;
967
968def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteI],
969            (instrs LDRBpost, LDRDpost, LDRHpost, LDRQpost,
970                    LDRSpost, LDRWpost, LDRXpost)>;
971
972def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRBroW)>;
973def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRDroW)>;
974def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHroW)>;
975def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHHroW)>;
976def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRQroW)>;
977def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSroW)>;
978def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHWroW)>;
979def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHXroW)>;
980def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRWroW)>;
981def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRXroW)>;
982
983def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRBroX)>;
984def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRDroX)>;
985def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHHroX)>;
986def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHroX)>;
987def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRQroX)>;
988def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSroX)>;
989def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHWroX)>;
990def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHXroX)>;
991def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRWroX)>;
992def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRXroX)>;
993
994def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURBi)>;
995def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURBBi)>;
996def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURDi)>;
997def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURHi)>;
998def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURHHi)>;
999def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURQi)>;
1000def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSi)>;
1001def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURXi)>;
1002def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSBWi)>;
1003def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSBXi)>;
1004def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSHWi)>;
1005def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSHXi)>;
1006def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSWi)>;
1007
1008// Load exclusive
1009def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAR(B|H|W|X)$")>;
1010def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAXR(B|H|W|X)$")>;
1011def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDXR(B|H|W|X)$")>;
1012def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAXP(W|X)$")>;
1013def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDXP(W|X)$")>;
1014
1015//---
1016// Prefetch
1017//---
1018def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMl)>;
1019def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFUMi)>;
1020def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMui)>;
1021def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMroW)>;
1022def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMroX)>;
1023
1024//--
1025// 3.7 Store Instructions
1026// 3.11 FP Store Instructions
1027//--
1028
1029// Store register, unscaled immed
1030// Store register, immed unprivileged
1031// Store register, unsigned immed
1032def : WriteRes<WriteST,      [THX3T110LS, THX3T110SD]> {
1033  let Latency = 1;
1034  let NumMicroOps = 2;
1035}
1036
1037// Store register, immed post-index
1038// NOTE: Handled by WriteAdr, WriteST, ReadAdrBase
1039
1040// Store register, immed pre-index
1041// NOTE: Handled by WriteAdr, WriteST
1042
1043// Store register, register offset, basic
1044// Store register, register offset, scaled by 4/8
1045// Store register, register offset, scaled by 2
1046// Store register, register offset, extend
1047// Store register, register offset, extend, scale by 4/8
1048// Store register, register offset, extend, scale by 1
1049def : WriteRes<WriteSTIdx, [THX3T110LS, THX3T110SD, THX3T110I0123]> {
1050  let Latency = 1;
1051  let NumMicroOps = 2;
1052}
1053
1054// Store pair, immed offset, W-form
1055// Store pair, immed offset, X-form
1056def : WriteRes<WriteSTP,     [THX3T110LS, THX3T110SD]> {
1057  let Latency = 1;
1058  let NumMicroOps = 2;
1059}
1060
1061// Store pair, immed post-index, W-form
1062// Store pair, immed post-index, X-form
1063// Store pair, immed pre-index, W-form
1064// Store pair, immed pre-index, X-form
1065// NOTE: Handled by WriteAdr, WriteSTP.
1066def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURBi)>;
1067def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURBBi)>;
1068def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURDi)>;
1069def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURHi)>;
1070def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURHHi)>;
1071def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURQi)>;
1072def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURSi)>;
1073def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURWi)>;
1074def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURXi)>;
1075
1076def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRBi)>;
1077def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRHi)>;
1078def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRWi)>;
1079def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRXi)>;
1080
1081def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPDi)>;
1082def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPQi)>;
1083def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPXi)>;
1084def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPWi)>;
1085
1086def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPDi)>;
1087def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPQi)>;
1088def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPXi)>;
1089def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPWi)>;
1090
1091def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRBui)>;
1092def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRDui)>;
1093def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRHui)>;
1094def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRQui)>;
1095def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRXui)>;
1096def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRWui)>;
1097
1098def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRBui)>;
1099def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRDui)>;
1100def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRHui)>;
1101def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRQui)>;
1102def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRXui)>;
1103def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRWui)>;
1104
1105def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRBui)>;
1106def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRDui)>;
1107def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRHui)>;
1108def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRQui)>;
1109def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRXui)>;
1110def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRWui)>;
1111
1112def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1113            (instrs STPDpre, STPDpost)>;
1114def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1115            (instrs STPDpre, STPDpost)>;
1116def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1117            (instrs STPQpre, STPQpost)>;
1118def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1119            (instrs STPQpre, STPQpost)>;
1120def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1121            (instrs STPSpre, STPSpost)>;
1122def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1123            (instrs STPSpre, STPSpost)>;
1124def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1125            (instrs STPWpre, STPWpost)>;
1126def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1127            (instrs STPWpre, STPWpost)>;
1128def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1129            (instrs STPXpre, STPXpost)>;
1130def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1131            (instrs STPXpre, STPXpost)>;
1132def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1133            (instrs STRBpre, STRBpost)>;
1134def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1135            (instrs STRBpre, STRBpost)>;
1136def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1137            (instrs STRBBpre, STRBBpost)>;
1138def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1139            (instrs STRBBpre, STRBBpost)>;
1140def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1141            (instrs STRDpre, STRDpost)>;
1142def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1143            (instrs STRDpre, STRDpost)>;
1144def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1145            (instrs STRHpre, STRHpost)>;
1146def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1147            (instrs STRHpre, STRHpost)>;
1148def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1149            (instrs STRHHpre, STRHHpost)>;
1150def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1151            (instrs STRHHpre, STRHHpost)>;
1152def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1153            (instrs STRQpre, STRQpost)>;
1154def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1155            (instrs STRQpre, STRQpost)>;
1156def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1157            (instrs STRSpre, STRSpost)>;
1158def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1159            (instrs STRSpre, STRSpost)>;
1160def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1161            (instrs STRWpre, STRWpost)>;
1162def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1163            (instrs STRWpre, STRWpost)>;
1164def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1165            (instrs STRXpre, STRXpost)>;
1166def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1167            (instrs STRXpre, STRXpost)>;
1168def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1169            (instrs STRBroW, STRBroX)>;
1170def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1171            (instrs STRBBroW, STRBBroX)>;
1172def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1173            (instrs STRDroW, STRDroX)>;
1174def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1175            (instrs STRHroW, STRHroX)>;
1176def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1177            (instrs STRHHroW, STRHHroX)>;
1178def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1179            (instrs STRQroW, STRQroX)>;
1180def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1181            (instrs STRSroW, STRSroX)>;
1182def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1183            (instrs STRWroW, STRWroX)>;
1184def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1185            (instrs STRXroW, STRXroX)>;
1186
1187// Store exclusive
1188def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instrs STNPWi, STNPXi)>;
1189def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLR(B|H|W|X)$")>;
1190def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STXP(W|X)$")>;
1191def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STXR(B|H|W|X)$")>;
1192def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLXP(W|X)$")>;
1193def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLXR(B|H|W|X)$")>;
1194
1195//---
1196// 3.8 FP Data Processing Instructions
1197//---
1198
1199// FP absolute value
1200// FP min/max
1201// FP negate
1202def : WriteRes<WriteF,       [THX3T110FP0123]> {
1203  let Latency = 5;
1204  let NumMicroOps = 2;
1205}
1206
1207// FP arithmetic
1208def : InstRW<[THX3T110Write_6Cyc_F01], (instregex "^FADD", "^FSUB")>;
1209
1210// FP compare
1211def : WriteRes<WriteFCmp,    [THX3T110FP0123]> {
1212  let Latency = 5;
1213  let NumMicroOps = 2;
1214}
1215
1216// FP Mul, Div, Sqrt
1217def : WriteRes<WriteFDiv, [THX3T110FP0123]> {
1218  let Latency = 22;
1219  let ResourceCycles = [19];
1220}
1221
1222def THX3T110XWriteFDiv : SchedWriteRes<[THX3T110FP0123]> {
1223  let Latency = 16;
1224  let ResourceCycles = [8];
1225  let NumMicroOps = 4;
1226}
1227
1228def THX3T110XWriteFDivSP : SchedWriteRes<[THX3T110FP0123]> {
1229  let Latency = 16;
1230  let ResourceCycles = [8];
1231  let NumMicroOps = 4;
1232}
1233
1234def THX3T110XWriteFDivDP : SchedWriteRes<[THX3T110FP0123]> {
1235  let Latency = 23;
1236  let ResourceCycles = [12];
1237  let NumMicroOps = 4;
1238}
1239
1240def THX3T110XWriteFSqrtSP : SchedWriteRes<[THX3T110FP0123]> {
1241  let Latency = 16;
1242  let ResourceCycles = [8];
1243  let NumMicroOps = 4;
1244}
1245
1246def THX3T110XWriteFSqrtDP : SchedWriteRes<[THX3T110FP0123]> {
1247  let Latency = 23;
1248  let ResourceCycles = [12];
1249  let NumMicroOps = 4;
1250}
1251
1252// FP divide, S-form
1253// FP square root, S-form
1254def : InstRW<[THX3T110XWriteFDivSP], (instrs FDIVSrr)>;
1255def : InstRW<[THX3T110XWriteFSqrtSP], (instrs FSQRTSr)>;
1256def : InstRW<[THX3T110XWriteFDivSP], (instregex "^FDIVv.*32$")>;
1257def : InstRW<[THX3T110XWriteFSqrtSP], (instregex "^.*SQRT.*32$")>;
1258def : InstRW<[THX3T110Write_16Cyc_F01], (instregex "^FDIVSrr", "^FSQRTSr")>;
1259
1260// FP divide, D-form
1261// FP square root, D-form
1262def : InstRW<[THX3T110XWriteFDivDP], (instrs FDIVDrr)>;
1263def : InstRW<[THX3T110XWriteFSqrtDP], (instrs FSQRTDr)>;
1264def : InstRW<[THX3T110XWriteFDivDP], (instregex "^FDIVv.*64$")>;
1265def : InstRW<[THX3T110XWriteFSqrtDP], (instregex "^.*SQRT.*64$")>;
1266def : InstRW<[THX3T110Write_23Cyc_F01], (instregex "^FDIVDrr", "^FSQRTDr")>;
1267
1268// FP multiply
1269// FP multiply accumulate
1270def : WriteRes<WriteFMul, [THX3T110FP0123]> {
1271  let Latency = 6;
1272  let ResourceCycles = [2];
1273  let NumMicroOps = 3;
1274}
1275
1276def THX3T110XWriteFMul : SchedWriteRes<[THX3T110FP0123]> {
1277  let Latency = 6;
1278  let ResourceCycles = [2];
1279  let NumMicroOps = 3;
1280}
1281
1282def THX3T110XWriteFMulAcc : SchedWriteRes<[THX3T110FP0123]> {
1283  let Latency = 6;
1284  let ResourceCycles = [2];
1285  let NumMicroOps = 3;
1286}
1287
1288def : InstRW<[THX3T110XWriteFMul], (instregex "^FMUL", "^FNMUL")>;
1289def : InstRW<[THX3T110XWriteFMulAcc],
1290            (instregex "^FMADD", "^FMSUB", "^FNMADD", "^FNMSUB")>;
1291
1292// FP round to integral
1293def : InstRW<[THX3T110Write_7Cyc_F01],
1294            (instregex "^FRINT(A|I|M|N|P|X|Z)(Sr|Dr)")>;
1295
1296// FP select
1297def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FCSEL")>;
1298
1299//---
1300// 3.9 FP Miscellaneous Instructions
1301//---
1302
1303// FP convert, from vec to vec reg
1304// FP convert, from gen to vec reg
1305// FP convert, from vec to gen reg
1306def : WriteRes<WriteFCvt, [THX3T110FP0123]> {
1307  let Latency = 7;
1308  let NumMicroOps = 3;
1309}
1310
1311// FP move, immed
1312// FP move, register
1313def : WriteRes<WriteFImm, [THX3T110FP0123]> {
1314  let Latency = 4;
1315  let NumMicroOps = 2;
1316}
1317
1318// FP transfer, from gen to vec reg
1319// FP transfer, from vec to gen reg
1320def : WriteRes<WriteFCopy, [THX3T110FP0123]> {
1321  let Latency = 4;
1322  let NumMicroOps = 2;
1323}
1324
1325def : InstRW<[THX3T110Write_5Cyc_F01], (instrs FMOVXDHighr, FMOVDXHighr)>;
1326
1327//---
1328// 3.12 ASIMD Integer Instructions
1329//---
1330
1331// ASIMD absolute diff, D-form
1332// ASIMD absolute diff, Q-form
1333// ASIMD absolute diff accum, D-form
1334// ASIMD absolute diff accum, Q-form
1335// ASIMD absolute diff accum long
1336// ASIMD absolute diff long
1337// ASIMD arith, basic
1338// ASIMD arith, complex
1339// ASIMD compare
1340// ASIMD logical (AND, BIC, EOR)
1341// ASIMD max/min, basic
1342// ASIMD max/min, reduce, 4H/4S
1343// ASIMD max/min, reduce, 8B/8H
1344// ASIMD max/min, reduce, 16B
1345// ASIMD multiply, D-form
1346// ASIMD multiply, Q-form
1347// ASIMD multiply accumulate long
1348// ASIMD multiply accumulate saturating long
1349// ASIMD multiply long
1350// ASIMD pairwise add and accumulate
1351// ASIMD shift accumulate
1352// ASIMD shift by immed, basic
1353// ASIMD shift by immed and insert, basic, D-form
1354// ASIMD shift by immed and insert, basic, Q-form
1355// ASIMD shift by immed, complex
1356// ASIMD shift by register, basic, D-form
1357// ASIMD shift by register, basic, Q-form
1358// ASIMD shift by register, complex, D-form
1359// ASIMD shift by register, complex, Q-form
1360def : WriteRes<WriteVd, [THX3T110FP0123]> {
1361  let Latency = 5;
1362  let NumMicroOps = 4;
1363  let ResourceCycles = [4];
1364}
1365def : WriteRes<WriteVq, [THX3T110FP0123]> {
1366  let Latency = 5;
1367  let NumMicroOps = 4;
1368  let ResourceCycles = [4];
1369}
1370
1371// ASIMD arith, reduce, 4H/4S
1372// ASIMD arith, reduce, 8B/8H
1373// ASIMD arith, reduce, 16B
1374
1375// ASIMD logical (MVN (alias for NOT), ORN, ORR)
1376def : InstRW<[THX3T110Write_5Cyc_F0123],
1377            (instregex "^ANDv", "^BICv", "^EORv", "^ORRv", "^ORNv", "^NOTv")>;
1378
1379// ASIMD arith, reduce
1380def : InstRW<[THX3T110Write_5Cyc_F0123],
1381            (instregex "^ADDVv", "^SADDLVv", "^UADDLVv")>;
1382
1383// ASIMD polynomial (8x8) multiply long
1384def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^(S|U|SQD)MULL")>;
1385def : InstRW<[THX3T110Write_5Cyc_F0123],
1386            (instregex "(S|U|SQD)(MLAL|MLSL|MULL)v.*")>;
1387def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^PMULL(v8i8|v16i8)")>;
1388def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^PMULL(v1i64|v2i64)")>;
1389
1390// ASIMD absolute diff accum, D-form
1391def : InstRW<[THX3T110Write_5Cyc_F0123],
1392            (instregex "^[SU]ABA(v8i8|v4i16|v2i32)$")>;
1393// ASIMD absolute diff accum, Q-form
1394def : InstRW<[THX3T110Write_5Cyc_F0123],
1395            (instregex "^[SU]ABA(v16i8|v8i16|v4i32)$")>;
1396// ASIMD absolute diff accum long
1397def : InstRW<[THX3T110Write_5Cyc_F0123],
1398            (instregex "^[SU]ABAL")>;
1399// ASIMD arith, reduce, 4H/4S
1400def : InstRW<[THX3T110Write_5Cyc_F0123],
1401            (instregex "^[SU]?ADDL?V(v8i8|v4i16|v2i32)v$")>;
1402// ASIMD arith, reduce, 8B
1403def : InstRW<[THX3T110Write_5Cyc_F0123],
1404            (instregex "^[SU]?ADDL?V(v8i16|v4i32)v$")>;
1405// ASIMD arith, reduce, 16B/16H
1406def : InstRW<[THX3T110Write_10Cyc_F0123],
1407            (instregex "^[SU]?ADDL?Vv16i8v$")>;
1408// ASIMD max/min, reduce, 4H/4S
1409def : InstRW<[THX3T110Write_5Cyc_F0123],
1410            (instregex "^[SU](MIN|MAX)V(v4i16|v4i32)v$")>;
1411// ASIMD max/min, reduce, 8B/8H
1412def : InstRW<[THX3T110Write_5Cyc_F0123],
1413            (instregex "^[SU](MIN|MAX)V(v8i8|v8i16)v$")>;
1414// ASIMD max/min, reduce, 16B/16H
1415def : InstRW<[THX3T110Write_5Cyc_F0123],
1416            (instregex "^[SU](MIN|MAX)Vv16i8v$")>;
1417// ASIMD multiply, D-form
1418def : InstRW<[THX3T110Write_5Cyc_F0123],
1419            (instregex "^(P?MUL|SQR?DMULH)" #
1420                       "(v8i8|v4i16|v2i32|v1i8|v1i16|v1i32|v1i64)" #
1421                       "(_indexed)?$")>;
1422// ASIMD multiply, Q-form
1423def : InstRW<[THX3T110Write_5Cyc_F0123],
1424            (instregex "^(P?MUL|SQR?DMULH)(v16i8|v8i16|v4i32)(_indexed)?$")>;
1425// ASIMD multiply accumulate, D-form
1426def : InstRW<[THX3T110Write_5Cyc_F0123],
1427            (instregex "^ML[AS](v8i8|v4i16|v2i32)(_indexed)?$")>;
1428// ASIMD multiply accumulate, Q-form
1429def : InstRW<[THX3T110Write_5Cyc_F0123],
1430            (instregex "^ML[AS](v16i8|v8i16|v4i32)(_indexed)?$")>;
1431// ASIMD shift accumulate
1432def : InstRW<[THX3T110Write_5Cyc_F0123],
1433            (instregex "SRSRAv","SSRAv","URSRAv","USRAv")>;
1434
1435// ASIMD shift by immed, basic
1436def : InstRW<[THX3T110Write_5Cyc_F0123],
1437            (instregex "RSHRNv","SHRNv", "SQRSHRNv","SQRSHRUNv",
1438                       "SQSHRNv","SQSHRUNv", "UQRSHRNv",
1439                       "UQSHRNv","SQXTNv","SQXTUNv","UQXTNv")>;
1440// ASIMD shift by immed, complex
1441def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]?(Q|R){1,2}SHR")>;
1442def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SQSHLU")>;
1443// ASIMD shift by register, basic, Q-form
1444def : InstRW<[THX3T110Write_5Cyc_F01],
1445            (instregex "^[SU]SHL(v16i8|v8i16|v4i32|v2i64)")>;
1446// ASIMD shift by register, complex, D-form
1447def : InstRW<[THX3T110Write_5Cyc_F0123],
1448            (instregex "^[SU][QR]{1,2}SHL" #
1449                       "(v1i8|v1i16|v1i32|v1i64|v8i8|v4i16|v2i32|b|d|h|s)")>;
1450// ASIMD shift by register, complex, Q-form
1451def : InstRW<[THX3T110Write_5Cyc_F0123],
1452            (instregex "^[SU][QR]{1,2}SHL(v16i8|v8i16|v4i32|v2i64)")>;
1453
1454// ASIMD Arithmetic
1455def : InstRW<[THX3T110Write_5Cyc_F0123],
1456            (instregex "(ADD|SUB)(v8i8|v4i16|v2i32|v1i64)")>;
1457def : InstRW<[THX3T110Write_5Cyc_F0123],
1458            (instregex "(ADD|SUB)(v16i8|v8i16|v4i32|v2i64)")>;
1459def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(ADD|SUB)HNv.*")>;
1460def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(RADD|RSUB)HNv.*")>;
1461def : InstRW<[THX3T110Write_5Cyc_F0123],
1462            (instregex "^SQADD", "^SQNEG", "^SQSUB", "^SRHADD",
1463                       "^SUQADD", "^UQADD", "^UQSUB", "^URHADD", "^USQADD")>;
1464def : InstRW<[THX3T110Write_5Cyc_F0123],
1465            (instregex "ADDP(v16i8|v8i16|v4i32|v2i64)")>;
1466def : InstRW<[THX3T110Write_5Cyc_F0123],
1467            (instregex "((AND|ORN|EOR|EON)S?(Xr[rsi]|v16i8|v8i16|v4i32)|" #
1468                       "(ORR|BIC)S?(Xr[rs]|v16i8|v8i16|v4i32))")>;
1469def : InstRW<[THX3T110Write_5Cyc_F0123],
1470            (instregex "(CLS|CLZ|CNT)(v4i32|v8i16|v16i8)")>;
1471def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADALP","^UADALP")>;
1472def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADDLPv","^UADDLPv")>;
1473def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADDLV","^UADDLV")>;
1474def : InstRW<[THX3T110Write_5Cyc_F0123],
1475             (instregex "^ADDVv","^SMAXVv","^UMAXVv","^SMINVv","^UMINVv")>;
1476def : InstRW<[THX3T110Write_5Cyc_F0123],
1477             (instregex "^SABAv","^UABAv","^SABALv","^UABALv")>;
1478def : InstRW<[THX3T110Write_5Cyc_F0123],
1479            (instregex "^SQADDv","^SQSUBv","^UQADDv","^UQSUBv")>;
1480def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SUQADDv","^USQADDv")>;
1481def : InstRW<[THX3T110Write_5Cyc_F0123],
1482            (instregex "^ADDHNv","^RADDHNv", "^RSUBHNv",
1483                       "^SQABS", "^SQADD", "^SQNEG", "^SQSUB",
1484                       "^SRHADD", "^SUBHNv", "^SUQADD",
1485                       "^UQADD", "^UQSUB", "^URHADD", "^USQADD")>;
1486def : InstRW<[THX3T110Write_5Cyc_F0123],
1487            (instregex "^CMEQv","^CMGEv","^CMGTv",
1488                       "^CMLEv","^CMLTv", "^CMHIv","^CMHSv")>;
1489def : InstRW<[THX3T110Write_5Cyc_F0123],
1490            (instregex "^SMAXv","^SMINv","^UMAXv","^UMINv",
1491                       "^SMAXPv","^SMINPv","^UMAXPv","^UMINPv")>;
1492def : InstRW<[THX3T110Write_5Cyc_F0123],
1493            (instregex "^SABDv","^UABDv", "^SABDLv","^UABDLv")>;
1494
1495//---
1496// 3.13 ASIMD Floating-point Instructions
1497//---
1498
1499// ASIMD FP absolute value
1500def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FABSv")>;
1501
1502// ASIMD FP arith, normal, D-form
1503// ASIMD FP arith, normal, Q-form
1504def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
1505            (instregex "^FABDv", "^FADDv", "^FSUBv")>;
1506
1507// ASIMD FP arith,pairwise, D-form
1508// ASIMD FP arith, pairwise, Q-form
1509def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FADDPv")>;
1510
1511// ASIMD FP compare, D-form
1512// ASIMD FP compare, Q-form
1513def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FACGEv", "^FACGTv")>;
1514def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FCMEQv", "^FCMGEv",
1515                                                 "^FCMGTv", "^FCMLEv",
1516                                                 "^FCMLTv")>;
1517
1518// ASIMD FP round, D-form
1519def : InstRW<[THX3T110Write_5Cyc_F0123],
1520            (instregex "^FRINT[AIMNPXZ](v2f32)")>;
1521// ASIMD FP round, Q-form
1522def : InstRW<[THX3T110Write_5Cyc_F0123],
1523            (instregex "^FRINT[AIMNPXZ](v4f32|v2f64)")>;
1524
1525// ASIMD FP convert, long
1526// ASIMD FP convert, narrow
1527// ASIMD FP convert, other, D-form
1528// ASIMD FP convert, other, Q-form
1529// NOTE: Handled by WriteV.
1530
1531// ASIMD FP convert, long and narrow
1532def : InstRW<[THX3T110Write_5Cyc_F01], (instregex "^FCVT(L|N|XN)v")>;
1533// ASIMD FP convert, other, D-form
1534def : InstRW<[THX3T110Write_5Cyc_F01],
1535      (instregex "^[FVSU]CVT([AMNPZ][SU])?(_Int)?(v2f32|v1i32|v2i32|v1i64)")>;
1536// ASIMD FP convert, other, Q-form
1537def : InstRW<[THX3T110Write_5Cyc_F01],
1538      (instregex "^[FVSU]CVT([AMNPZ][SU])?(_Int)?(v4f32|v2f64|v4i32|v2i64)")>;
1539
1540// ASIMD FP divide, D-form, F32
1541def : InstRW<[THX3T110Write_16Cyc_F0123], (instrs FDIVv2f32)>;
1542def : InstRW<[THX3T110Write_16Cyc_F0123], (instregex "FDIVv2f32")>;
1543
1544// ASIMD FP divide, Q-form, F32
1545def : InstRW<[THX3T110Write_16Cyc_F0123], (instrs FDIVv4f32)>;
1546def : InstRW<[THX3T110Write_16Cyc_F0123], (instregex "FDIVv4f32")>;
1547
1548// ASIMD FP divide, Q-form, F64
1549def : InstRW<[THX3T110Write_23Cyc_F0123], (instrs FDIVv2f64)>;
1550def : InstRW<[THX3T110Write_23Cyc_F0123], (instregex "FDIVv2f64")>;
1551
1552// ASIMD FP max/min, normal, D-form
1553// ASIMD FP max/min, normal, Q-form
1554def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXv", "^FMAXNMv",
1555                                                "^FMINv", "^FMINNMv")>;
1556
1557// ASIMD FP max/min, pairwise, D-form
1558// ASIMD FP max/min, pairwise, Q-form
1559def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXPv", "^FMAXNMPv",
1560                                                "^FMINPv", "^FMINNMPv")>;
1561
1562// ASIMD FP max/min, reduce
1563def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXVv", "^FMAXNMVv",
1564                                                "^FMINVv", "^FMINNMVv")>;
1565
1566// ASIMD FP multiply, D-form, FZ
1567// ASIMD FP multiply, D-form, no FZ
1568// ASIMD FP multiply, Q-form, FZ
1569// ASIMD FP multiply, Q-form, no FZ
1570def : InstRW<[THX3T110Write_5Cyc_F0123],
1571            (instregex "^FMULv", "^FMULXv")>;
1572def : InstRW<[THX3T110Write_5Cyc_F0123],
1573            (instregex "^FMULX?(v2f32|v1i32|v2i32|v1i64|32|64)")>;
1574def : InstRW<[THX3T110Write_5Cyc_F0123],
1575            (instregex "^FMULX?(v4f32|v2f64|v4i32|v2i64)")>;
1576
1577// ASIMD FP multiply accumulate, Dform, FZ
1578// ASIMD FP multiply accumulate, Dform, no FZ
1579// ASIMD FP multiply accumulate, Qform, FZ
1580// ASIMD FP multiply accumulate, Qform, no FZ
1581def : InstRW<[THX3T110Write_5Cyc_F0123],
1582            (instregex "^FMLAv", "^FMLSv")>;
1583def : InstRW<[THX3T110Write_5Cyc_F0123],
1584            (instregex "^FML[AS](v2f32|v1i32|v2i32|v1i64)")>;
1585def : InstRW<[THX3T110Write_5Cyc_F0123],
1586            (instregex "^FML[AS](v4f32|v2f64|v4i32|v2i64)")>;
1587
1588// ASIMD FP negate
1589def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FNEGv")>;
1590
1591//--
1592// 3.14 ASIMD Miscellaneous Instructions
1593//--
1594
1595// ASIMD bit reverse
1596def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^RBITv")>;
1597
1598// ASIMD bitwise insert, D-form
1599// ASIMD bitwise insert, Q-form
1600def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
1601            (instregex "^BIFv", "^BITv", "^BSLv")>;
1602
1603// ASIMD count, D-form
1604// ASIMD count, Q-form
1605def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
1606            (instregex "^CLSv", "^CLZv", "^CNTv")>;
1607
1608// ASIMD duplicate, gen reg
1609// ASIMD duplicate, element
1610def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUPv")>;
1611def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUP(i8|i16|i32|i64)$")>;
1612def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUPv.+gpr")>;
1613
1614// ASIMD extract
1615def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^EXTv")>;
1616
1617// ASIMD extract narrow
1618def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^XTNv")>;
1619
1620// ASIMD extract narrow, saturating
1621def : InstRW<[THX3T110Write_5Cyc_F0123],
1622            (instregex "^SQXTNv", "^SQXTUNv", "^UQXTNv")>;
1623
1624// ASIMD insert, element to element
1625def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^INSv")>;
1626
1627// ASIMD transfer, element to gen reg
1628def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]MOVv")>;
1629
1630// ASIMD move, integer immed
1631def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^MOVIv")>;
1632
1633// ASIMD move, FP immed
1634def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FMOVv")>;
1635
1636// ASIMD transpose
1637def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^TRN1", "^TRN2")>;
1638
1639// ASIMD unzip/zip
1640def : InstRW<[THX3T110Write_5Cyc_F0123],
1641            (instregex "^UZP1", "^UZP2", "^ZIP1", "^ZIP2")>;
1642
1643// ASIMD reciprocal estimate, D-form
1644// ASIMD reciprocal estimate, Q-form
1645def : InstRW<[THX3T110Write_5Cyc_F0123],
1646            (instregex "^FRECPEv", "^FRECPXv", "^URECPEv",
1647                       "^FRSQRTEv", "^URSQRTEv")>;
1648
1649// ASIMD reciprocal step, D-form, FZ
1650// ASIMD reciprocal step, D-form, no FZ
1651// ASIMD reciprocal step, Q-form, FZ
1652// ASIMD reciprocal step, Q-form, no FZ
1653def : InstRW<[THX3T110Write_5Cyc_F0123],
1654              (instregex "^FRECPSv", "^FRSQRTSv")>;
1655
1656// ASIMD reverse
1657def : InstRW<[THX3T110Write_5Cyc_F0123],
1658            (instregex "^REV16v", "^REV32v", "^REV64v")>;
1659
1660// ASIMD table lookup, D-form
1661// ASIMD table lookup, Q-form
1662def : InstRW<[THX3T110Write_5Cyc_F0123],
1663            (instrs TBLv8i8One, TBLv16i8One, TBXv8i8One, TBXv16i8One)>;
1664def : InstRW<[THX3T110Write_10Cyc_F0123],
1665            (instrs TBLv8i8Two, TBLv16i8Two, TBXv8i8Two, TBXv16i8Two)>;
1666def : InstRW<[THX3T110Write_15Cyc_F0123],
1667            (instrs TBLv8i8Three, TBLv16i8Three, TBXv8i8Three, TBXv16i8Three)>;
1668def : InstRW<[THX3T110Write_20Cyc_F0123],
1669            (instrs TBLv8i8Four, TBLv16i8Four, TBXv8i8Four, TBXv16i8Four)>;
1670
1671// ASIMD transfer, element to word or word
1672def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]MOVv")>;
1673
1674// ASIMD transfer, element to gen reg
1675def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(S|U)MOVv.*")>;
1676
1677// ASIMD transfer gen reg to element
1678def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^INSv")>;
1679
1680// ASIMD transpose
1681def : InstRW<[THX3T110Write_5Cyc_F0123],
1682              (instregex "^TRN1v", "^TRN2v", "^UZP1v", "^UZP2v")>;
1683
1684// ASIMD unzip/zip
1685def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^ZIP1v", "^ZIP2v")>;
1686
1687//--
1688// 3.15 ASIMD Load Instructions
1689//--
1690
1691// ASIMD load, 1 element, multiple, 1 reg, D-form
1692// ASIMD load, 1 element, multiple, 1 reg, Q-form
1693def : InstRW<[THX3T110Write_4Cyc_LS01],
1694            (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1695def : InstRW<[THX3T110Write_4Cyc_LS01, WriteAdr],
1696            (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1697
1698// ASIMD load, 1 element, multiple, 2 reg, D-form
1699// ASIMD load, 1 element, multiple, 2 reg, Q-form
1700def : InstRW<[THX3T110Write_4Cyc_LS01],
1701            (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1702def : InstRW<[THX3T110Write_4Cyc_LS01, WriteAdr],
1703            (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1704
1705// ASIMD load, 1 element, multiple, 3 reg, D-form
1706// ASIMD load, 1 element, multiple, 3 reg, Q-form
1707def : InstRW<[THX3T110Write_5Cyc_LS01],
1708            (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1709def : InstRW<[THX3T110Write_5Cyc_LS01, WriteAdr],
1710            (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1711
1712// ASIMD load, 1 element, multiple, 4 reg, D-form
1713// ASIMD load, 1 element, multiple, 4 reg, Q-form
1714def : InstRW<[THX3T110Write_6Cyc_LS01],
1715            (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1716def : InstRW<[THX3T110Write_6Cyc_LS01, WriteAdr],
1717            (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1718
1719// ASIMD load, 1 element, one lane, B/H/S
1720// ASIMD load, 1 element, one lane, D
1721def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1722            (instregex "^LD1i(8|16|32|64)$")>;
1723def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
1724            (instregex "^LD1i(8|16|32|64)_POST$")>;
1725
1726// ASIMD load, 1 element, all lanes, D-form, B/H/S
1727// ASIMD load, 1 element, all lanes, D-form, D
1728// ASIMD load, 1 element, all lanes, Q-form
1729def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1730            (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1731def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
1732            (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1733
1734// ASIMD load, 2 element, multiple, D-form, B/H/S
1735// ASIMD load, 2 element, multiple, Q-form, D
1736def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1737            (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
1738def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
1739            (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
1740
1741// ASIMD load, 2 element, one lane, B/H
1742// ASIMD load, 2 element, one lane, S
1743// ASIMD load, 2 element, one lane, D
1744def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1745            (instregex "^LD2i(8|16|32|64)$")>;
1746def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
1747            (instregex "^LD2i(8|16|32|64)_POST$")>;
1748
1749// ASIMD load, 2 element, all lanes, D-form, B/H/S
1750// ASIMD load, 2 element, all lanes, D-form, D
1751// ASIMD load, 2 element, all lanes, Q-form
1752def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1753            (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1754def : InstRW<[THX3T110Write_5Cyc_LS01_F0123, WriteAdr],
1755            (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1756
1757// ASIMD load, 3 element, multiple, D-form, B/H/S
1758// ASIMD load, 3 element, multiple, Q-form, B/H/S
1759// ASIMD load, 3 element, multiple, Q-form, D
1760def : InstRW<[THX3T110Write_8Cyc_LS01_F0123],
1761            (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
1762def : InstRW<[THX3T110Write_8Cyc_LS01_F0123, WriteAdr],
1763            (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
1764
1765// ASIMD load, 3 element, one lone, B/H
1766// ASIMD load, 3 element, one lane, S
1767// ASIMD load, 3 element, one lane, D
1768def : InstRW<[THX3T110Write_7Cyc_LS01_F0123],
1769            (instregex "^LD3i(8|16|32|64)$")>;
1770def : InstRW<[THX3T110Write_7Cyc_LS01_F0123, WriteAdr],
1771            (instregex "^LD3i(8|16|32|64)_POST$")>;
1772
1773// ASIMD load, 3 element, all lanes, D-form, B/H/S
1774// ASIMD load, 3 element, all lanes, D-form, D
1775// ASIMD load, 3 element, all lanes, Q-form, B/H/S
1776// ASIMD load, 3 element, all lanes, Q-form, D
1777def : InstRW<[THX3T110Write_7Cyc_LS01_F0123],
1778            (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1779def : InstRW<[THX3T110Write_7Cyc_LS01_F0123, WriteAdr],
1780            (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1781
1782// ASIMD load, 4 element, multiple, D-form, B/H/S
1783// ASIMD load, 4 element, multiple, Q-form, B/H/S
1784// ASIMD load, 4 element, multiple, Q-form, D
1785def : InstRW<[THX3T110Write_8Cyc_LS01_F0123],
1786            (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
1787def : InstRW<[THX3T110Write_8Cyc_LS01_F0123, WriteAdr],
1788            (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
1789
1790// ASIMD load, 4 element, one lane, B/H
1791// ASIMD load, 4 element, one lane, S
1792// ASIMD load, 4 element, one lane, D
1793def : InstRW<[THX3T110Write_6Cyc_LS01_F0123],
1794            (instregex "^LD4i(8|16|32|64)$")>;
1795def : InstRW<[THX3T110Write_6Cyc_LS01_F0123, WriteAdr],
1796            (instregex "^LD4i(8|16|32|64)_POST$")>;
1797
1798// ASIMD load, 4 element, all lanes, D-form, B/H/S
1799// ASIMD load, 4 element, all lanes, D-form, D
1800// ASIMD load, 4 element, all lanes, Q-form, B/H/S
1801// ASIMD load, 4 element, all lanes, Q-form, D
1802def : InstRW<[THX3T110Write_6Cyc_LS01_F0123],
1803            (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1804def : InstRW<[THX3T110Write_6Cyc_LS01_F0123, WriteAdr],
1805            (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1806
1807//--
1808// 3.16 ASIMD Store Instructions
1809//--
1810
1811// ASIMD store, 1 element, multiple, 1 reg, D-form
1812// ASIMD store, 1 element, multiple, 1 reg, Q-form
1813def : InstRW<[THX3T110Write_1Cyc_LS01],
1814            (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1815def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
1816            (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1817
1818// ASIMD store, 1 element, multiple, 2 reg, D-form
1819// ASIMD store, 1 element, multiple, 2 reg, Q-form
1820def : InstRW<[THX3T110Write_1Cyc_LS01],
1821            (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1822def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
1823            (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1824
1825// ASIMD store, 1 element, multiple, 3 reg, D-form
1826// ASIMD store, 1 element, multiple, 3 reg, Q-form
1827def : InstRW<[THX3T110Write_1Cyc_LS01],
1828            (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1829def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
1830            (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1831
1832// ASIMD store, 1 element, multiple, 4 reg, D-form
1833// ASIMD store, 1 element, multiple, 4 reg, Q-form
1834def : InstRW<[THX3T110Write_1Cyc_LS01],
1835            (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1836def : InstRW<[THX3T110Write_1Cyc_LS01, WriteAdr],
1837            (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
1838
1839// ASIMD store, 1 element, one lane, B/H/S
1840// ASIMD store, 1 element, one lane, D
1841def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1842            (instregex "^ST1i(8|16|32|64)$")>;
1843def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1844            (instregex "^ST1i(8|16|32|64)_POST$")>;
1845
1846// ASIMD store, 2 element, multiple, D-form, B/H/S
1847// ASIMD store, 2 element, multiple, Q-form, B/H/S
1848// ASIMD store, 2 element, multiple, Q-form, D
1849def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1850            (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
1851def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1852            (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
1853
1854// ASIMD store, 2 element, one lane, B/H/S
1855// ASIMD store, 2 element, one lane, D
1856def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1857            (instregex "^ST2i(8|16|32|64)$")>;
1858def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1859            (instregex "^ST2i(8|16|32|64)_POST$")>;
1860
1861// ASIMD store, 3 element, multiple, D-form, B/H/S
1862// ASIMD store, 3 element, multiple, Q-form, B/H/S
1863// ASIMD store, 3 element, multiple, Q-form, D
1864def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1865            (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
1866def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1867            (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
1868
1869// ASIMD store, 3 element, one lane, B/H
1870// ASIMD store, 3 element, one lane, S
1871// ASIMD store, 3 element, one lane, D
1872def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1873            (instregex "^ST3i(8|16|32|64)$")>;
1874def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1875            (instregex "^ST3i(8|16|32|64)_POST$")>;
1876
1877// ASIMD store, 4 element, multiple, D-form, B/H/S
1878// ASIMD store, 4 element, multiple, Q-form, B/H/S
1879// ASIMD store, 4 element, multiple, Q-form, D
1880def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1881            (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
1882def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1883            (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
1884
1885// ASIMD store, 4 element, one lane, B/H
1886// ASIMD store, 4 element, one lane, S
1887// ASIMD store, 4 element, one lane, D
1888def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1889            (instregex "^ST4i(8|16|32|64)$")>;
1890def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1891            (instregex "^ST4i(8|16|32|64)_POST$")>;
1892
1893// V8.1a Atomics (LSE)
1894def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1895            (instrs CASB, CASH, CASW, CASX)>;
1896
1897def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1898            (instrs CASAB, CASAH, CASAW, CASAX)>;
1899
1900def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1901            (instrs CASLB, CASLH, CASLW, CASLX)>;
1902
1903def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1904            (instrs CASALB, CASALH, CASALW, CASALX)>;
1905
1906def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1907            (instrs LDLARB, LDLARH, LDLARW, LDLARX)>;
1908
1909def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1910            (instrs LDADDB, LDADDH, LDADDW, LDADDX)>;
1911
1912def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1913            (instrs LDADDAB, LDADDAH, LDADDAW, LDADDAX)>;
1914
1915def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1916            (instrs LDADDLB, LDADDLH, LDADDLW, LDADDLX)>;
1917
1918def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1919            (instrs LDADDALB, LDADDALH, LDADDALW, LDADDALX)>;
1920
1921def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1922            (instrs LDCLRB, LDCLRH, LDCLRW, LDCLRX)>;
1923
1924def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1925            (instrs LDCLRAB, LDCLRAH, LDCLRAW, LDCLRAX)>;
1926
1927def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1928            (instrs LDCLRLB, LDCLRLH, LDCLRLW, LDCLRLX)>;
1929
1930def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1931            (instrs LDCLRALB, LDCLRALH, LDCLRALW, LDCLRALX)>;
1932
1933def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1934            (instrs LDEORB, LDEORH, LDEORW, LDEORX)>;
1935
1936def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1937            (instrs LDEORAB, LDEORAH, LDEORAW, LDEORAX)>;
1938
1939def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1940            (instrs LDEORLB, LDEORLH, LDEORLW, LDEORLX)>;
1941
1942def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1943            (instrs LDEORALB, LDEORALH, LDEORALW, LDEORALX)>;
1944
1945def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1946            (instrs LDSETB, LDSETH, LDSETW, LDSETX)>;
1947
1948def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1949            (instrs LDSETAB, LDSETAH, LDSETAW, LDSETAX)>;
1950
1951def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1952            (instrs LDSETLB, LDSETLH, LDSETLW, LDSETLX)>;
1953
1954def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1955            (instrs LDSETALB, LDSETALH, LDSETALW, LDSETALX)>;
1956
1957def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1958            (instrs LDSMAXB, LDSMAXH, LDSMAXW, LDSMAXX,
1959             LDSMAXAB, LDSMAXAH, LDSMAXAW, LDSMAXAX,
1960             LDSMAXLB, LDSMAXLH, LDSMAXLW, LDSMAXLX,
1961             LDSMAXALB, LDSMAXALH, LDSMAXALW, LDSMAXALX)>;
1962
1963def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1964            (instrs LDSMINB, LDSMINH, LDSMINW, LDSMINX,
1965             LDSMINAB, LDSMINAH, LDSMINAW, LDSMINAX,
1966             LDSMINLB, LDSMINLH, LDSMINLW, LDSMINLX,
1967             LDSMINALB, LDSMINALH, LDSMINALW, LDSMINALX)>;
1968
1969def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1970            (instrs LDUMAXB, LDUMAXH, LDUMAXW, LDUMAXX,
1971             LDUMAXAB, LDUMAXAH, LDUMAXAW, LDUMAXAX,
1972             LDUMAXLB, LDUMAXLH, LDUMAXLW, LDUMAXLX,
1973             LDUMAXALB, LDUMAXALH, LDUMAXALW, LDUMAXALX)>;
1974
1975def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1976            (instrs LDUMINB, LDUMINH, LDUMINW, LDUMINX,
1977             LDUMINAB, LDUMINAH, LDUMINAW, LDUMINAX,
1978             LDUMINLB, LDUMINLH, LDUMINLW, LDUMINLX,
1979             LDUMINALB, LDUMINALH, LDUMINALW, LDUMINALX)>;
1980
1981def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1982            (instrs SWPB, SWPH, SWPW, SWPX)>;
1983
1984def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1985            (instrs SWPAB, SWPAH, SWPAW, SWPAX)>;
1986
1987def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1988            (instrs SWPLB, SWPLH, SWPLW, SWPLX)>;
1989
1990def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1991            (instrs SWPALB, SWPALH, SWPALW, SWPALX)>;
1992
1993def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1994            (instrs STLLRB, STLLRH, STLLRW, STLLRX)>;
1995
1996// V8.3a PAC
1997def : InstRW<[THX3T110Write_11Cyc_LS01_I1], (instregex "^LDRAA", "^LDRAB")>;
1998def : InstRW<[THX3T110Write_8Cyc_I123],
1999            (instrs BLRAA, BLRAAZ, BLRAB, BLRABZ,
2000                    BRAA, BRAAZ, BRAB, BRABZ)>;
2001def : InstRW<[THX3T110Write_8Cyc_I123], (instrs RETAA, RETAB)>;
2002
2003} // SchedModel = ThunderX3T110Model
2004