Debian Codegraph @

suite/synctools/tablegen/AArch64/AArch64SchedThunderX3T110.td

raw
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 def : 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
636 def : 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
644 def : WriteRes<WriteBrReg, [THX3T110I23]> {
645 let Latency = 1;
646 let NumMicroOps = 2;
647 }
648
649 def : WriteRes<WriteSys, []> { let Latency = 1; }
650 def : WriteRes<WriteBarrier, []> { let Latency = 1; }
651 def : WriteRes<WriteHint, []> { let Latency = 1; }
652
653 def : WriteRes<WriteAtomic, []> {
654 let Latency = 4;
655 let NumMicroOps = 2;
656 }
657
658 //---
659 // Branch
660 //---
661 def : InstRW<[THX3T110Write_1Cyc_I23], (instrs B, BL, BR, BLR)>;
662 def : InstRW<[THX3T110Write_1Cyc_I23], (instrs Bcc)>;
663 def : InstRW<[THX3T110Write_1Cyc_I23], (instrs RET)>;
664 def : 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
677 def : WriteRes<WriteI, [THX3T110I0123]> {
678 let Latency = 1;
679 let ResourceCycles = [1];
680 let NumMicroOps = 2;
681 }
682
683 def : 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
696 def : InstRW<[WriteI], (instrs COPY)>;
697
698 // ALU, extend and/or shift
699 def : WriteRes<WriteISReg, [THX3T110I0123]> {
700 let Latency = 2;
701 let ResourceCycles = [2];
702 let NumMicroOps = 2;
703 }
704
705 def : 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
718 def : WriteRes<WriteIEReg, [THX3T110I0123]> {
719 let Latency = 1;
720 let ResourceCycles = [1];
721 let NumMicroOps = 2;
722 }
723
724 def : 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
738 def : WriteRes<WriteImm, [THX3T110I0123]> {
739 let Latency = 1;
740 let NumMicroOps = 2;
741 }
742
743 def : InstRW<[THX3T110Write_1Cyc_I0123],
744 (instrs MOVKWi, MOVKXi, MOVNWi, MOVNXi, MOVZWi, MOVZXi)>;
745
746 def : InstRW<[THX3T110Write_1Cyc_I0123],
747 (instrs ASRVWr, ASRVXr, LSLVWr, LSLVXr, RORVWr, RORVXr)>;
748
749 // Variable shift
750 def : 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.
761 def : WriteRes<WriteID32, [THX3T110I1]> {
762 let Latency = 39;
763 let ResourceCycles = [39];
764 let NumMicroOps = 4;
765 }
766
767 // Divide, X-form
768 def : WriteRes<WriteID64, [THX3T110I1]> {
769 let Latency = 23;
770 let ResourceCycles = [23];
771 let NumMicroOps = 4;
772 }
773
774 // Multiply accumulate, W-form
775 def : WriteRes<WriteIM32, [THX3T110I0123]> {
776 let Latency = 5;
777 let NumMicroOps = 3;
778 }
779
780 // Multiply accumulate, X-form
781 def : 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)>;
788 def : InstRW<[WriteIM32], (instrs MADDWrrr, MSUBWrrr)>;
789 def : InstRW<[WriteIM32], (instrs MADDXrrr, MSUBXrrr)>;
790 def : InstRW<[THX3T110Write_5Cyc_I0123],
791 (instregex "(S|U)(MADDL|MSUBL)rrr")>;
792
793 def : InstRW<[WriteID32], (instrs SDIVWr, UDIVWr)>;
794 def : InstRW<[WriteID64], (instrs SDIVXr, UDIVXr)>;
795
796 // Bitfield extract, two reg
797 def : WriteRes<WriteExtr, [THX3T110I0123]> {
798 let Latency = 1;
799 let NumMicroOps = 2;
800 }
801
802 // Multiply high
803 def : InstRW<[THX3T110Write_4Cyc_I1], (instrs SMULHrr, UMULHrr)>;
804
805 // Miscellaneous Data-Processing Instructions
806 // Bitfield extract
807 def : InstRW<[THX3T110Write_1Cyc_I0123], (instrs EXTRWrri, EXTRXrri)>;
808
809 // Bitifield move - basic
810 def : InstRW<[THX3T110Write_1Cyc_I0123],
811 (instrs SBFMWri, SBFMXri, UBFMWri, UBFMXri)>;
812
813 // Bitfield move, insert
814 def : InstRW<[THX3T110Write_1Cyc_I0123], (instregex "^BFM")>;
815 def : InstRW<[THX3T110Write_1Cyc_I0123], (instregex "(S|U)?BFM.*")>;
816
817 // Count leading
818 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
819 (instregex "^CLS(W|X)r$", "^CLZ(W|X)r$")>;
820
821 // Reverse bits
822 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instrs RBITWr, RBITXr)>;
823
824 // Cryptography Extensions
825 def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^AES[DE]")>;
826 def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^AESI?MC")>;
827 def : InstRW<[THX3T110Write_4Cyc_F0123], (instregex "^PMULL")>;
828 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1SU0")>;
829 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1(H|SU1)")>;
830 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA1[CMP]")>;
831 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA256SU0")>;
832 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SHA256(H|H2|SU1)")>;
833
834 // CRC Instructions
835 // def : InstRW<[THX3T110Write_4Cyc_I1], (instregex "^CRC32", "^CRC32C")>;
836 def : InstRW<[THX3T110Write_4Cyc_I1],
837 (instrs CRC32Brr, CRC32Hrr, CRC32Wrr, CRC32Xrr)>;
838
839 def : 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
854 def : 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.
863 def : 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.
873 def : 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
884 def THX3T110WriteLDIdx : SchedWriteVariant<[
885 SchedVar<ScaledIdxPred, [THX3T110Write_4Cyc_LS01_I0123_I0123]>,
886 SchedVar<NoSchedPred, [THX3T110Write_4Cyc_LS01_I0123]>]>;
887 def : SchedAlias<WriteLDIdx, THX3T110WriteLDIdx>;
888
889 def THX3T110ReadAdrBase : SchedReadVariant<[
890 SchedVar<ScaledIdxPred, [ReadDefault]>,
891 SchedVar<NoSchedPred, [ReadDefault]>]>;
892 def : 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
898 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPDi)>;
899 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPQi)>;
900 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPSi)>;
901 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPWi)>;
902 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDNPXi)>;
903
904 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPDi)>;
905 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPQi)>;
906 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPSi)>;
907 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPSWi)>;
908 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPWi)>;
909 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, WriteLDHi], (instrs LDPXi)>;
910
911 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRBui)>;
912 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRDui)>;
913 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRHui)>;
914 def : InstRW<[THX3T110Write_5Cyc_LS01], (instrs LDRQui)>;
915 def : InstRW<[THX3T110Write_5Cyc_LS01], (instrs LDRSui)>;
916
917 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRDl)>;
918 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRQl)>;
919 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRWl)>;
920 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDRXl)>;
921
922 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRBi)>;
923 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRHi)>;
924 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRWi)>;
925 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRXi)>;
926
927 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSBWi)>;
928 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSBXi)>;
929 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSHWi)>;
930 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSHXi)>;
931 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDTRSWi)>;
932
933 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
934 (instrs LDPDpre)>;
935 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
936 (instrs LDPQpre)>;
937 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
938 (instrs LDPSpre)>;
939 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
940 (instrs LDPWpre)>;
941 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
942 (instrs LDPWpre)>;
943
944 def : 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
951 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteLDHi, WriteAdr],
952 (instrs LDPDpost, LDPQpost, LDPSpost, LDPWpost, LDPXpost)>;
953
954 def : InstRW<[THX3T110Write_5Cyc_LS01_I0123, WriteI],
955 (instrs LDRBpost, LDRDpost, LDRHpost,
956 LDRQpost, LDRSpost, LDRWpost, LDRXpost)>;
957
958 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteLDHi, WriteAdr],
959 (instrs LDPDpre, LDPQpre, LDPSpre, LDPWpre, LDPXpre)>;
960
961 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteAdr],
962 (instrs LDRBpre, LDRDpre, LDRHpre, LDRQpre,
963 LDRSpre, LDRWpre, LDRXpre)>;
964
965 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteLDHi, WriteAdr],
966 (instrs LDPDpost, LDPQpost, LDPSpost, LDPWpost, LDPXpost)>;
967
968 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123_I0123, WriteI],
969 (instrs LDRBpost, LDRDpost, LDRHpost, LDRQpost,
970 LDRSpost, LDRWpost, LDRXpost)>;
971
972 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRBroW)>;
973 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRDroW)>;
974 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHroW)>;
975 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHHroW)>;
976 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRQroW)>;
977 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSroW)>;
978 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHWroW)>;
979 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHXroW)>;
980 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRWroW)>;
981 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRXroW)>;
982
983 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRBroX)>;
984 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRDroX)>;
985 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHHroX)>;
986 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRHroX)>;
987 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRQroX)>;
988 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSroX)>;
989 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHWroX)>;
990 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRSHXroX)>;
991 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRWroX)>;
992 def : InstRW<[THX3T110Write_4Cyc_LS01_I0123, ReadAdrBase], (instrs LDRXroX)>;
993
994 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURBi)>;
995 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURBBi)>;
996 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURDi)>;
997 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURHi)>;
998 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURHHi)>;
999 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURQi)>;
1000 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSi)>;
1001 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURXi)>;
1002 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSBWi)>;
1003 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSBXi)>;
1004 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSHWi)>;
1005 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSHXi)>;
1006 def : InstRW<[THX3T110Write_4Cyc_LS01], (instrs LDURSWi)>;
1007
1008 // Load exclusive
1009 def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAR(B|H|W|X)$")>;
1010 def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAXR(B|H|W|X)$")>;
1011 def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDXR(B|H|W|X)$")>;
1012 def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDAXP(W|X)$")>;
1013 def : InstRW<[THX3T110Write_4Cyc_LS01], (instregex "^LDXP(W|X)$")>;
1014
1015 //---
1016 // Prefetch
1017 //---
1018 def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMl)>;
1019 def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFUMi)>;
1020 def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMui)>;
1021 def : InstRW<[THX3T110Write_6Cyc_LS01_I012], (instrs PRFMroW)>;
1022 def : 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
1032 def : 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
1049 def : 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
1056 def : 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.
1066 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURBi)>;
1067 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURBBi)>;
1068 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURDi)>;
1069 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURHi)>;
1070 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURHHi)>;
1071 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURQi)>;
1072 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURSi)>;
1073 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURWi)>;
1074 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STURXi)>;
1075
1076 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRBi)>;
1077 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRHi)>;
1078 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRWi)>;
1079 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_SD], (instrs STTRXi)>;
1080
1081 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPDi)>;
1082 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPQi)>;
1083 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPXi)>;
1084 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STNPWi)>;
1085
1086 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPDi)>;
1087 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPQi)>;
1088 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPXi)>;
1089 def : InstRW<[THX3T110Write_1Cyc_LS01_SD], (instrs STPWi)>;
1090
1091 def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRBui)>;
1092 def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRDui)>;
1093 def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRHui)>;
1094 def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRQui)>;
1095 def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRXui)>;
1096 def : InstRW<[THX3T110Write_1Cyc_LS01_I0123], (instrs STRWui)>;
1097
1098 def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRBui)>;
1099 def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRDui)>;
1100 def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRHui)>;
1101 def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRQui)>;
1102 def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRXui)>;
1103 def : InstRW<[WriteSTP, THX3T110Write_1Cyc_LS01_SD], (instrs STRWui)>;
1104
1105 def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRBui)>;
1106 def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRDui)>;
1107 def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRHui)>;
1108 def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRQui)>;
1109 def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRXui)>;
1110 def : InstRW<[WriteSTIdx, THX3T110Write_1Cyc_LS01_SD_I0123], (instrs STRWui)>;
1111
1112 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1113 (instrs STPDpre, STPDpost)>;
1114 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1115 (instrs STPDpre, STPDpost)>;
1116 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1117 (instrs STPQpre, STPQpost)>;
1118 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1119 (instrs STPQpre, STPQpost)>;
1120 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1121 (instrs STPSpre, STPSpost)>;
1122 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1123 (instrs STPSpre, STPSpost)>;
1124 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1125 (instrs STPWpre, STPWpost)>;
1126 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1127 (instrs STPWpre, STPWpost)>;
1128 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1129 (instrs STPXpre, STPXpost)>;
1130 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1131 (instrs STPXpre, STPXpost)>;
1132 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1133 (instrs STRBpre, STRBpost)>;
1134 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1135 (instrs STRBpre, STRBpost)>;
1136 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1137 (instrs STRBBpre, STRBBpost)>;
1138 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1139 (instrs STRBBpre, STRBBpost)>;
1140 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1141 (instrs STRDpre, STRDpost)>;
1142 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1143 (instrs STRDpre, STRDpost)>;
1144 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1145 (instrs STRHpre, STRHpost)>;
1146 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1147 (instrs STRHpre, STRHpost)>;
1148 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1149 (instrs STRHHpre, STRHHpost)>;
1150 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1151 (instrs STRHHpre, STRHHpost)>;
1152 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1153 (instrs STRQpre, STRQpost)>;
1154 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1155 (instrs STRQpre, STRQpost)>;
1156 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1157 (instrs STRSpre, STRSpost)>;
1158 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1159 (instrs STRSpre, STRSpost)>;
1160 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1161 (instrs STRWpre, STRWpost)>;
1162 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1163 (instrs STRWpre, STRWpost)>;
1164 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123],
1165 (instrs STRXpre, STRXpost)>;
1166 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1167 (instrs STRXpre, STRXpost)>;
1168 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1169 (instrs STRBroW, STRBroX)>;
1170 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1171 (instrs STRBBroW, STRBBroX)>;
1172 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1173 (instrs STRDroW, STRDroX)>;
1174 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1175 (instrs STRHroW, STRHroX)>;
1176 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1177 (instrs STRHHroW, STRHHroX)>;
1178 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1179 (instrs STRQroW, STRQroX)>;
1180 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1181 (instrs STRSroW, STRSroX)>;
1182 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1183 (instrs STRWroW, STRWroX)>;
1184 def : InstRW<[WriteAdr, THX3T110Write_1Cyc_LS01_I0123, ReadAdrBase],
1185 (instrs STRXroW, STRXroX)>;
1186
1187 // Store exclusive
1188 def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instrs STNPWi, STNPXi)>;
1189 def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLR(B|H|W|X)$")>;
1190 def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STXP(W|X)$")>;
1191 def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STXR(B|H|W|X)$")>;
1192 def : InstRW<[THX3T110Write_4Cyc_LS01_SD], (instregex "^STLXP(W|X)$")>;
1193 def : 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
1202 def : WriteRes<WriteF, [THX3T110FP0123]> {
1203 let Latency = 5;
1204 let NumMicroOps = 2;
1205 }
1206
1207 // FP arithmetic
1208 def : InstRW<[THX3T110Write_6Cyc_F01], (instregex "^FADD", "^FSUB")>;
1209
1210 // FP compare
1211 def : WriteRes<WriteFCmp, [THX3T110FP0123]> {
1212 let Latency = 5;
1213 let NumMicroOps = 2;
1214 }
1215
1216 // FP Mul, Div, Sqrt
1217 def : WriteRes<WriteFDiv, [THX3T110FP0123]> {
1218 let Latency = 22;
1219 let ResourceCycles = [19];
1220 }
1221
1222 def THX3T110XWriteFDiv : SchedWriteRes<[THX3T110FP0123]> {
1223 let Latency = 16;
1224 let ResourceCycles = [8];
1225 let NumMicroOps = 4;
1226 }
1227
1228 def THX3T110XWriteFDivSP : SchedWriteRes<[THX3T110FP0123]> {
1229 let Latency = 16;
1230 let ResourceCycles = [8];
1231 let NumMicroOps = 4;
1232 }
1233
1234 def THX3T110XWriteFDivDP : SchedWriteRes<[THX3T110FP0123]> {
1235 let Latency = 23;
1236 let ResourceCycles = [12];
1237 let NumMicroOps = 4;
1238 }
1239
1240 def THX3T110XWriteFSqrtSP : SchedWriteRes<[THX3T110FP0123]> {
1241 let Latency = 16;
1242 let ResourceCycles = [8];
1243 let NumMicroOps = 4;
1244 }
1245
1246 def 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
1254 def : InstRW<[THX3T110XWriteFDivSP], (instrs FDIVSrr)>;
1255 def : InstRW<[THX3T110XWriteFSqrtSP], (instrs FSQRTSr)>;
1256 def : InstRW<[THX3T110XWriteFDivSP], (instregex "^FDIVv.*32$")>;
1257 def : InstRW<[THX3T110XWriteFSqrtSP], (instregex "^.*SQRT.*32$")>;
1258 def : InstRW<[THX3T110Write_16Cyc_F01], (instregex "^FDIVSrr", "^FSQRTSr")>;
1259
1260 // FP divide, D-form
1261 // FP square root, D-form
1262 def : InstRW<[THX3T110XWriteFDivDP], (instrs FDIVDrr)>;
1263 def : InstRW<[THX3T110XWriteFSqrtDP], (instrs FSQRTDr)>;
1264 def : InstRW<[THX3T110XWriteFDivDP], (instregex "^FDIVv.*64$")>;
1265 def : InstRW<[THX3T110XWriteFSqrtDP], (instregex "^.*SQRT.*64$")>;
1266 def : InstRW<[THX3T110Write_23Cyc_F01], (instregex "^FDIVDrr", "^FSQRTDr")>;
1267
1268 // FP multiply
1269 // FP multiply accumulate
1270 def : WriteRes<WriteFMul, [THX3T110FP0123]> {
1271 let Latency = 6;
1272 let ResourceCycles = [2];
1273 let NumMicroOps = 3;
1274 }
1275
1276 def THX3T110XWriteFMul : SchedWriteRes<[THX3T110FP0123]> {
1277 let Latency = 6;
1278 let ResourceCycles = [2];
1279 let NumMicroOps = 3;
1280 }
1281
1282 def THX3T110XWriteFMulAcc : SchedWriteRes<[THX3T110FP0123]> {
1283 let Latency = 6;
1284 let ResourceCycles = [2];
1285 let NumMicroOps = 3;
1286 }
1287
1288 def : InstRW<[THX3T110XWriteFMul], (instregex "^FMUL", "^FNMUL")>;
1289 def : InstRW<[THX3T110XWriteFMulAcc],
1290 (instregex "^FMADD", "^FMSUB", "^FNMADD", "^FNMSUB")>;
1291
1292 // FP round to integral
1293 def : InstRW<[THX3T110Write_7Cyc_F01],
1294 (instregex "^FRINT(A|I|M|N|P|X|Z)(Sr|Dr)")>;
1295
1296 // FP select
1297 def : 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
1306 def : WriteRes<WriteFCvt, [THX3T110FP0123]> {
1307 let Latency = 7;
1308 let NumMicroOps = 3;
1309 }
1310
1311 // FP move, immed
1312 // FP move, register
1313 def : 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
1320 def : WriteRes<WriteFCopy, [THX3T110FP0123]> {
1321 let Latency = 4;
1322 let NumMicroOps = 2;
1323 }
1324
1325 def : 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
1360 def : WriteRes<WriteVd, [THX3T110FP0123]> {
1361 let Latency = 5;
1362 let NumMicroOps = 4;
1363 let ResourceCycles = [4];
1364 }
1365 def : 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)
1376 def : InstRW<[THX3T110Write_5Cyc_F0123],
1377 (instregex "^ANDv", "^BICv", "^EORv", "^ORRv", "^ORNv", "^NOTv")>;
1378
1379 // ASIMD arith, reduce
1380 def : InstRW<[THX3T110Write_5Cyc_F0123],
1381 (instregex "^ADDVv", "^SADDLVv", "^UADDLVv")>;
1382
1383 // ASIMD polynomial (8x8) multiply long
1384 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^(S|U|SQD)MULL")>;
1385 def : InstRW<[THX3T110Write_5Cyc_F0123],
1386 (instregex "(S|U|SQD)(MLAL|MLSL|MULL)v.*")>;
1387 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^PMULL(v8i8|v16i8)")>;
1388 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^PMULL(v1i64|v2i64)")>;
1389
1390 // ASIMD absolute diff accum, D-form
1391 def : InstRW<[THX3T110Write_5Cyc_F0123],
1392 (instregex "^[SU]ABA(v8i8|v4i16|v2i32)$")>;
1393 // ASIMD absolute diff accum, Q-form
1394 def : InstRW<[THX3T110Write_5Cyc_F0123],
1395 (instregex "^[SU]ABA(v16i8|v8i16|v4i32)$")>;
1396 // ASIMD absolute diff accum long
1397 def : InstRW<[THX3T110Write_5Cyc_F0123],
1398 (instregex "^[SU]ABAL")>;
1399 // ASIMD arith, reduce, 4H/4S
1400 def : InstRW<[THX3T110Write_5Cyc_F0123],
1401 (instregex "^[SU]?ADDL?V(v8i8|v4i16|v2i32)v$")>;
1402 // ASIMD arith, reduce, 8B
1403 def : InstRW<[THX3T110Write_5Cyc_F0123],
1404 (instregex "^[SU]?ADDL?V(v8i16|v4i32)v$")>;
1405 // ASIMD arith, reduce, 16B/16H
1406 def : InstRW<[THX3T110Write_10Cyc_F0123],
1407 (instregex "^[SU]?ADDL?Vv16i8v$")>;
1408 // ASIMD max/min, reduce, 4H/4S
1409 def : InstRW<[THX3T110Write_5Cyc_F0123],
1410 (instregex "^[SU](MIN|MAX)V(v4i16|v4i32)v$")>;
1411 // ASIMD max/min, reduce, 8B/8H
1412 def : InstRW<[THX3T110Write_5Cyc_F0123],
1413 (instregex "^[SU](MIN|MAX)V(v8i8|v8i16)v$")>;
1414 // ASIMD max/min, reduce, 16B/16H
1415 def : InstRW<[THX3T110Write_5Cyc_F0123],
1416 (instregex "^[SU](MIN|MAX)Vv16i8v$")>;
1417 // ASIMD multiply, D-form
1418 def : 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
1423 def : InstRW<[THX3T110Write_5Cyc_F0123],
1424 (instregex "^(P?MUL|SQR?DMULH)(v16i8|v8i16|v4i32)(_indexed)?$")>;
1425 // ASIMD multiply accumulate, D-form
1426 def : InstRW<[THX3T110Write_5Cyc_F0123],
1427 (instregex "^ML[AS](v8i8|v4i16|v2i32)(_indexed)?$")>;
1428 // ASIMD multiply accumulate, Q-form
1429 def : InstRW<[THX3T110Write_5Cyc_F0123],
1430 (instregex "^ML[AS](v16i8|v8i16|v4i32)(_indexed)?$")>;
1431 // ASIMD shift accumulate
1432 def : InstRW<[THX3T110Write_5Cyc_F0123],
1433 (instregex "SRSRAv","SSRAv","URSRAv","USRAv")>;
1434
1435 // ASIMD shift by immed, basic
1436 def : 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
1441 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]?(Q|R){1,2}SHR")>;
1442 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SQSHLU")>;
1443 // ASIMD shift by register, basic, Q-form
1444 def : InstRW<[THX3T110Write_5Cyc_F01],
1445 (instregex "^[SU]SHL(v16i8|v8i16|v4i32|v2i64)")>;
1446 // ASIMD shift by register, complex, D-form
1447 def : 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
1451 def : InstRW<[THX3T110Write_5Cyc_F0123],
1452 (instregex "^[SU][QR]{1,2}SHL(v16i8|v8i16|v4i32|v2i64)")>;
1453
1454 // ASIMD Arithmetic
1455 def : InstRW<[THX3T110Write_5Cyc_F0123],
1456 (instregex "(ADD|SUB)(v8i8|v4i16|v2i32|v1i64)")>;
1457 def : InstRW<[THX3T110Write_5Cyc_F0123],
1458 (instregex "(ADD|SUB)(v16i8|v8i16|v4i32|v2i64)")>;
1459 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(ADD|SUB)HNv.*")>;
1460 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(RADD|RSUB)HNv.*")>;
1461 def : InstRW<[THX3T110Write_5Cyc_F0123],
1462 (instregex "^SQADD", "^SQNEG", "^SQSUB", "^SRHADD",
1463 "^SUQADD", "^UQADD", "^UQSUB", "^URHADD", "^USQADD")>;
1464 def : InstRW<[THX3T110Write_5Cyc_F0123],
1465 (instregex "ADDP(v16i8|v8i16|v4i32|v2i64)")>;
1466 def : 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))")>;
1469 def : InstRW<[THX3T110Write_5Cyc_F0123],
1470 (instregex "(CLS|CLZ|CNT)(v4i32|v8i16|v16i8)")>;
1471 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADALP","^UADALP")>;
1472 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADDLPv","^UADDLPv")>;
1473 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SADDLV","^UADDLV")>;
1474 def : InstRW<[THX3T110Write_5Cyc_F0123],
1475 (instregex "^ADDVv","^SMAXVv","^UMAXVv","^SMINVv","^UMINVv")>;
1476 def : InstRW<[THX3T110Write_5Cyc_F0123],
1477 (instregex "^SABAv","^UABAv","^SABALv","^UABALv")>;
1478 def : InstRW<[THX3T110Write_5Cyc_F0123],
1479 (instregex "^SQADDv","^SQSUBv","^UQADDv","^UQSUBv")>;
1480 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^SUQADDv","^USQADDv")>;
1481 def : InstRW<[THX3T110Write_5Cyc_F0123],
1482 (instregex "^ADDHNv","^RADDHNv", "^RSUBHNv",
1483 "^SQABS", "^SQADD", "^SQNEG", "^SQSUB",
1484 "^SRHADD", "^SUBHNv", "^SUQADD",
1485 "^UQADD", "^UQSUB", "^URHADD", "^USQADD")>;
1486 def : InstRW<[THX3T110Write_5Cyc_F0123],
1487 (instregex "^CMEQv","^CMGEv","^CMGTv",
1488 "^CMLEv","^CMLTv", "^CMHIv","^CMHSv")>;
1489 def : InstRW<[THX3T110Write_5Cyc_F0123],
1490 (instregex "^SMAXv","^SMINv","^UMAXv","^UMINv",
1491 "^SMAXPv","^SMINPv","^UMAXPv","^UMINPv")>;
1492 def : 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
1500 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FABSv")>;
1501
1502 // ASIMD FP arith, normal, D-form
1503 // ASIMD FP arith, normal, Q-form
1504 def : 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
1509 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FADDPv")>;
1510
1511 // ASIMD FP compare, D-form
1512 // ASIMD FP compare, Q-form
1513 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FACGEv", "^FACGTv")>;
1514 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FCMEQv", "^FCMGEv",
1515 "^FCMGTv", "^FCMLEv",
1516 "^FCMLTv")>;
1517
1518 // ASIMD FP round, D-form
1519 def : InstRW<[THX3T110Write_5Cyc_F0123],
1520 (instregex "^FRINT[AIMNPXZ](v2f32)")>;
1521 // ASIMD FP round, Q-form
1522 def : 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
1532 def : InstRW<[THX3T110Write_5Cyc_F01], (instregex "^FCVT(L|N|XN)v")>;
1533 // ASIMD FP convert, other, D-form
1534 def : InstRW<[THX3T110Write_5Cyc_F01],
1535 (instregex "^[FVSU]CVT([AMNPZ][SU])?(_Int)?(v2f32|v1i32|v2i32|v1i64)")>;
1536 // ASIMD FP convert, other, Q-form
1537 def : InstRW<[THX3T110Write_5Cyc_F01],
1538 (instregex "^[FVSU]CVT([AMNPZ][SU])?(_Int)?(v4f32|v2f64|v4i32|v2i64)")>;
1539
1540 // ASIMD FP divide, D-form, F32
1541 def : InstRW<[THX3T110Write_16Cyc_F0123], (instrs FDIVv2f32)>;
1542 def : InstRW<[THX3T110Write_16Cyc_F0123], (instregex "FDIVv2f32")>;
1543
1544 // ASIMD FP divide, Q-form, F32
1545 def : InstRW<[THX3T110Write_16Cyc_F0123], (instrs FDIVv4f32)>;
1546 def : InstRW<[THX3T110Write_16Cyc_F0123], (instregex "FDIVv4f32")>;
1547
1548 // ASIMD FP divide, Q-form, F64
1549 def : InstRW<[THX3T110Write_23Cyc_F0123], (instrs FDIVv2f64)>;
1550 def : InstRW<[THX3T110Write_23Cyc_F0123], (instregex "FDIVv2f64")>;
1551
1552 // ASIMD FP max/min, normal, D-form
1553 // ASIMD FP max/min, normal, Q-form
1554 def : 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
1559 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FMAXPv", "^FMAXNMPv",
1560 "^FMINPv", "^FMINNMPv")>;
1561
1562 // ASIMD FP max/min, reduce
1563 def : 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
1570 def : InstRW<[THX3T110Write_5Cyc_F0123],
1571 (instregex "^FMULv", "^FMULXv")>;
1572 def : InstRW<[THX3T110Write_5Cyc_F0123],
1573 (instregex "^FMULX?(v2f32|v1i32|v2i32|v1i64|32|64)")>;
1574 def : 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
1581 def : InstRW<[THX3T110Write_5Cyc_F0123],
1582 (instregex "^FMLAv", "^FMLSv")>;
1583 def : InstRW<[THX3T110Write_5Cyc_F0123],
1584 (instregex "^FML[AS](v2f32|v1i32|v2i32|v1i64)")>;
1585 def : InstRW<[THX3T110Write_5Cyc_F0123],
1586 (instregex "^FML[AS](v4f32|v2f64|v4i32|v2i64)")>;
1587
1588 // ASIMD FP negate
1589 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^FNEGv")>;
1590
1591 //--
1592 // 3.14 ASIMD Miscellaneous Instructions
1593 //--
1594
1595 // ASIMD bit reverse
1596 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^RBITv")>;
1597
1598 // ASIMD bitwise insert, D-form
1599 // ASIMD bitwise insert, Q-form
1600 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
1601 (instregex "^BIFv", "^BITv", "^BSLv")>;
1602
1603 // ASIMD count, D-form
1604 // ASIMD count, Q-form
1605 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123],
1606 (instregex "^CLSv", "^CLZv", "^CNTv")>;
1607
1608 // ASIMD duplicate, gen reg
1609 // ASIMD duplicate, element
1610 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUPv")>;
1611 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUP(i8|i16|i32|i64)$")>;
1612 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^DUPv.+gpr")>;
1613
1614 // ASIMD extract
1615 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^EXTv")>;
1616
1617 // ASIMD extract narrow
1618 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^XTNv")>;
1619
1620 // ASIMD extract narrow, saturating
1621 def : InstRW<[THX3T110Write_5Cyc_F0123],
1622 (instregex "^SQXTNv", "^SQXTUNv", "^UQXTNv")>;
1623
1624 // ASIMD insert, element to element
1625 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^INSv")>;
1626
1627 // ASIMD transfer, element to gen reg
1628 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]MOVv")>;
1629
1630 // ASIMD move, integer immed
1631 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^MOVIv")>;
1632
1633 // ASIMD move, FP immed
1634 def : InstRW<[THX3T110Write_3_4Cyc_F23_F0123], (instregex "^FMOVv")>;
1635
1636 // ASIMD transpose
1637 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^TRN1", "^TRN2")>;
1638
1639 // ASIMD unzip/zip
1640 def : InstRW<[THX3T110Write_5Cyc_F0123],
1641 (instregex "^UZP1", "^UZP2", "^ZIP1", "^ZIP2")>;
1642
1643 // ASIMD reciprocal estimate, D-form
1644 // ASIMD reciprocal estimate, Q-form
1645 def : 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
1653 def : InstRW<[THX3T110Write_5Cyc_F0123],
1654 (instregex "^FRECPSv", "^FRSQRTSv")>;
1655
1656 // ASIMD reverse
1657 def : InstRW<[THX3T110Write_5Cyc_F0123],
1658 (instregex "^REV16v", "^REV32v", "^REV64v")>;
1659
1660 // ASIMD table lookup, D-form
1661 // ASIMD table lookup, Q-form
1662 def : InstRW<[THX3T110Write_5Cyc_F0123],
1663 (instrs TBLv8i8One, TBLv16i8One, TBXv8i8One, TBXv16i8One)>;
1664 def : InstRW<[THX3T110Write_10Cyc_F0123],
1665 (instrs TBLv8i8Two, TBLv16i8Two, TBXv8i8Two, TBXv16i8Two)>;
1666 def : InstRW<[THX3T110Write_15Cyc_F0123],
1667 (instrs TBLv8i8Three, TBLv16i8Three, TBXv8i8Three, TBXv16i8Three)>;
1668 def : InstRW<[THX3T110Write_20Cyc_F0123],
1669 (instrs TBLv8i8Four, TBLv16i8Four, TBXv8i8Four, TBXv16i8Four)>;
1670
1671 // ASIMD transfer, element to word or word
1672 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^[SU]MOVv")>;
1673
1674 // ASIMD transfer, element to gen reg
1675 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "(S|U)MOVv.*")>;
1676
1677 // ASIMD transfer gen reg to element
1678 def : InstRW<[THX3T110Write_5Cyc_F0123], (instregex "^INSv")>;
1679
1680 // ASIMD transpose
1681 def : InstRW<[THX3T110Write_5Cyc_F0123],
1682 (instregex "^TRN1v", "^TRN2v", "^UZP1v", "^UZP2v")>;
1683
1684 // ASIMD unzip/zip
1685 def : 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
1693 def : InstRW<[THX3T110Write_4Cyc_LS01],
1694 (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1695 def : 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
1700 def : InstRW<[THX3T110Write_4Cyc_LS01],
1701 (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1702 def : 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
1707 def : InstRW<[THX3T110Write_5Cyc_LS01],
1708 (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1709 def : 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
1714 def : InstRW<[THX3T110Write_6Cyc_LS01],
1715 (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1716 def : 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
1721 def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1722 (instregex "^LD1i(8|16|32|64)$")>;
1723 def : 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
1729 def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1730 (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1731 def : 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
1736 def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1737 (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
1738 def : 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
1744 def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1745 (instregex "^LD2i(8|16|32|64)$")>;
1746 def : 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
1752 def : InstRW<[THX3T110Write_5Cyc_LS01_F0123],
1753 (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1754 def : 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
1760 def : InstRW<[THX3T110Write_8Cyc_LS01_F0123],
1761 (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
1762 def : 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
1768 def : InstRW<[THX3T110Write_7Cyc_LS01_F0123],
1769 (instregex "^LD3i(8|16|32|64)$")>;
1770 def : 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
1777 def : InstRW<[THX3T110Write_7Cyc_LS01_F0123],
1778 (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1779 def : 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
1785 def : InstRW<[THX3T110Write_8Cyc_LS01_F0123],
1786 (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
1787 def : 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
1793 def : InstRW<[THX3T110Write_6Cyc_LS01_F0123],
1794 (instregex "^LD4i(8|16|32|64)$")>;
1795 def : 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
1802 def : InstRW<[THX3T110Write_6Cyc_LS01_F0123],
1803 (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1804 def : 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
1813 def : InstRW<[THX3T110Write_1Cyc_LS01],
1814 (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1815 def : 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
1820 def : InstRW<[THX3T110Write_1Cyc_LS01],
1821 (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1822 def : 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
1827 def : InstRW<[THX3T110Write_1Cyc_LS01],
1828 (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1829 def : 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
1834 def : InstRW<[THX3T110Write_1Cyc_LS01],
1835 (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
1836 def : 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
1841 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1842 (instregex "^ST1i(8|16|32|64)$")>;
1843 def : 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
1849 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1850 (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
1851 def : 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
1856 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1857 (instregex "^ST2i(8|16|32|64)$")>;
1858 def : 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
1864 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1865 (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
1866 def : 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
1872 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1873 (instregex "^ST3i(8|16|32|64)$")>;
1874 def : 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
1880 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1881 (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
1882 def : 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
1888 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123],
1889 (instregex "^ST4i(8|16|32|64)$")>;
1890 def : InstRW<[THX3T110Write_1Cyc_LS01_F0123, WriteAdr],
1891 (instregex "^ST4i(8|16|32|64)_POST$")>;
1892
1893 // V8.1a Atomics (LSE)
1894 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1895 (instrs CASB, CASH, CASW, CASX)>;
1896
1897 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1898 (instrs CASAB, CASAH, CASAW, CASAX)>;
1899
1900 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1901 (instrs CASLB, CASLH, CASLW, CASLX)>;
1902
1903 def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1904 (instrs CASALB, CASALH, CASALW, CASALX)>;
1905
1906 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1907 (instrs LDLARB, LDLARH, LDLARW, LDLARX)>;
1908
1909 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1910 (instrs LDADDB, LDADDH, LDADDW, LDADDX)>;
1911
1912 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1913 (instrs LDADDAB, LDADDAH, LDADDAW, LDADDAX)>;
1914
1915 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1916 (instrs LDADDLB, LDADDLH, LDADDLW, LDADDLX)>;
1917
1918 def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1919 (instrs LDADDALB, LDADDALH, LDADDALW, LDADDALX)>;
1920
1921 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1922 (instrs LDCLRB, LDCLRH, LDCLRW, LDCLRX)>;
1923
1924 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1925 (instrs LDCLRAB, LDCLRAH, LDCLRAW, LDCLRAX)>;
1926
1927 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1928 (instrs LDCLRLB, LDCLRLH, LDCLRLW, LDCLRLX)>;
1929
1930 def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1931 (instrs LDCLRALB, LDCLRALH, LDCLRALW, LDCLRALX)>;
1932
1933 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1934 (instrs LDEORB, LDEORH, LDEORW, LDEORX)>;
1935
1936 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1937 (instrs LDEORAB, LDEORAH, LDEORAW, LDEORAX)>;
1938
1939 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1940 (instrs LDEORLB, LDEORLH, LDEORLW, LDEORLX)>;
1941
1942 def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1943 (instrs LDEORALB, LDEORALH, LDEORALW, LDEORALX)>;
1944
1945 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1946 (instrs LDSETB, LDSETH, LDSETW, LDSETX)>;
1947
1948 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1949 (instrs LDSETAB, LDSETAH, LDSETAW, LDSETAX)>;
1950
1951 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1952 (instrs LDSETLB, LDSETLH, LDSETLW, LDSETLX)>;
1953
1954 def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1955 (instrs LDSETALB, LDSETALH, LDSETALW, LDSETALX)>;
1956
1957 def : 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
1963 def : 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
1969 def : 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
1975 def : 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
1981 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1982 (instrs SWPB, SWPH, SWPW, SWPX)>;
1983
1984 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1985 (instrs SWPAB, SWPAH, SWPAW, SWPAX)>;
1986
1987 def : InstRW<[THX3T110Write_6Cyc_I0123, WriteAtomic],
1988 (instrs SWPLB, SWPLH, SWPLW, SWPLX)>;
1989
1990 def : InstRW<[THX3T110Write_8Cyc_I0123, WriteAtomic],
1991 (instrs SWPALB, SWPALH, SWPALW, SWPALX)>;
1992
1993 def : InstRW<[THX3T110Write_4Cyc_I0123, WriteAtomic],
1994 (instrs STLLRB, STLLRH, STLLRW, STLLRX)>;
1995
1996 // V8.3a PAC
1997 def : InstRW<[THX3T110Write_11Cyc_LS01_I1], (instregex "^LDRAA", "^LDRAB")>;
1998 def : InstRW<[THX3T110Write_8Cyc_I123],
1999 (instrs BLRAA, BLRAAZ, BLRAB, BLRABZ,
2000 BRAA, BRAAZ, BRAB, BRABZ)>;
2001 def : InstRW<[THX3T110Write_8Cyc_I123], (instrs RETAA, RETAB)>;
2002
2003 } // SchedModel = ThunderX3T110Model