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