]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AArch64/AArch64SchedVulcan.td
MFV r319948: 5428 provide fts(), reallocarray(), and strtonum()
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AArch64 / AArch64SchedVulcan.td
1 //=- AArch64SchedVulcan.td - Vulcan Scheduling Defs ----------*- tablegen -*-=//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 // 1. Introduction
10 //
11 // This file defines the machine model for Broadcom Vulcan to support
12 // instruction scheduling and other instruction cost heuristics.
13 //
14 //===----------------------------------------------------------------------===//
15
16 //===----------------------------------------------------------------------===//
17 // 2. Pipeline Description.
18
19 def VulcanModel : SchedMachineModel {
20   let IssueWidth            =   4; // 4 micro-ops dispatched at a time.
21   let MicroOpBufferSize     = 180; // 180 entries in micro-op re-order buffer.
22   let LoadLatency           =   4; // Optimistic load latency.
23   let MispredictPenalty     =  12; // Extra cycles for mispredicted branch.
24   // Determined via a mix of micro-arch details and experimentation.
25   let LoopMicroOpBufferSize =  32; 
26   let PostRAScheduler       =   1; // Using PostRA sched.
27   let CompleteModel         =   1;
28 }
29
30 // Define the issue ports.
31
32 // Port 0: ALU, FP/SIMD.
33 def VulcanP0 : ProcResource<1>;
34
35 // Port 1: ALU, FP/SIMD, integer mul/div.
36 def VulcanP1 : ProcResource<1>;
37
38 // Port 2: ALU, Branch.
39 def VulcanP2 : ProcResource<1>;
40
41 // Port 3: Store data.
42 def VulcanP3 : ProcResource<1>;
43
44 // Port 4: Load/store.
45 def VulcanP4 : ProcResource<1>;
46
47 // Port 5: Load/store.
48 def VulcanP5 : ProcResource<1>;
49
50 let SchedModel = VulcanModel in {
51
52 // Define groups for the functional units on each issue port.  Each group
53 // created will be used by a WriteRes later on.
54 //
55 // NOTE: Some groups only contain one member.  This is a way to create names for
56 // the various functional units that share a single issue port.  For example,
57 // "VulcanI1" for ALU ops on port 1 and "VulcanF1" for FP ops on port 1.
58
59 // Integer divide and multiply micro-ops only on port 1.
60 def VulcanI1 : ProcResGroup<[VulcanP1]>;
61
62 // Branch micro-ops only on port 2.
63 def VulcanI2 : ProcResGroup<[VulcanP2]>;
64
65 // ALU micro-ops on ports 0, 1, and 2.
66 def VulcanI012 : ProcResGroup<[VulcanP0, VulcanP1, VulcanP2]>;
67
68 // Crypto FP/SIMD micro-ops only on port 1.
69 def VulcanF1 : ProcResGroup<[VulcanP1]>;
70
71 // FP/SIMD micro-ops on ports 0 and 1.
72 def VulcanF01 : ProcResGroup<[VulcanP0, VulcanP1]>;
73
74 // Store data micro-ops only on port 3.
75 def VulcanSD : ProcResGroup<[VulcanP3]>;
76
77 // Load/store micro-ops on ports 4 and 5.
78 def VulcanLS01 : ProcResGroup<[VulcanP4, VulcanP5]>;
79
80 // 60 entry unified scheduler.
81 def VulcanAny : ProcResGroup<[VulcanP0, VulcanP1, VulcanP2,
82                               VulcanP3, VulcanP4, VulcanP5]> {
83   let BufferSize=60;
84 }
85
86 // Define commonly used write types for InstRW specializations.
87 // All definitions follow the format: VulcanWrite_<NumCycles>Cyc_<Resources>.
88
89 // 3 cycles on I1.
90 def VulcanWrite_3Cyc_I1 : SchedWriteRes<[VulcanI1]> { let Latency = 3; }
91
92 // 4 cycles on I1.
93 def VulcanWrite_4Cyc_I1 : SchedWriteRes<[VulcanI1]> { let Latency = 4; }
94
95 // 1 cycle on I0, I1, or I2.
96 def VulcanWrite_1Cyc_I012 : SchedWriteRes<[VulcanI012]> { let Latency = 1; }
97
98 // 5 cycles on F1.
99 def VulcanWrite_5Cyc_F1 : SchedWriteRes<[VulcanF1]> { let Latency = 5; }
100
101 // 7 cycles on F1.
102 def VulcanWrite_7Cyc_F1 : SchedWriteRes<[VulcanF1]> { let Latency = 7; }
103
104 // 4 cycles on F0 or F1.
105 def VulcanWrite_4Cyc_F01 : SchedWriteRes<[VulcanF01]> { let Latency = 4; }
106
107 // 5 cycles on F0 or F1.
108 def VulcanWrite_5Cyc_F01 : SchedWriteRes<[VulcanF01]> { let Latency = 5; }
109
110 // 6 cycles on F0 or F1.
111 def VulcanWrite_6Cyc_F01 : SchedWriteRes<[VulcanF01]> { let Latency = 6; }
112
113 // 7 cycles on F0 or F1.
114 def VulcanWrite_7Cyc_F01 : SchedWriteRes<[VulcanF01]> { let Latency = 7; }
115
116 // 8 cycles on F0 or F1.
117 def VulcanWrite_8Cyc_F01 : SchedWriteRes<[VulcanF01]> { let Latency = 8; }
118
119 // 16 cycles on F0 or F1.
120 def VulcanWrite_16Cyc_F01 : SchedWriteRes<[VulcanF01]> {
121   let Latency = 16;
122   let ResourceCycles = [8];
123 }
124
125 // 23 cycles on F0 or F1.
126 def VulcanWrite_23Cyc_F01 : SchedWriteRes<[VulcanF01]> {
127   let Latency = 23;
128   let ResourceCycles = [11];
129 }
130
131 // 1 cycles on LS0 or LS1.
132 def VulcanWrite_1Cyc_LS01 : SchedWriteRes<[VulcanLS01]> { let Latency = 1; }
133
134 // 4 cycles on LS0 or LS1.
135 def VulcanWrite_4Cyc_LS01 : SchedWriteRes<[VulcanLS01]> { let Latency = 4; }
136
137 // 5 cycles on LS0 or LS1.
138 def VulcanWrite_5Cyc_LS01 : SchedWriteRes<[VulcanLS01]> { let Latency = 5; }
139
140 // 6 cycles on LS0 or LS1.
141 def VulcanWrite_6Cyc_LS01 : SchedWriteRes<[VulcanLS01]> { let Latency = 6; }
142
143 // 5 cycles on LS0 or LS1 and I0, I1, or I2.
144 def VulcanWrite_5Cyc_LS01_I012 : SchedWriteRes<[VulcanLS01, VulcanI012]> {
145   let Latency = 5;
146   let NumMicroOps = 2;
147 }
148
149 // 5 cycles on LS0 or LS1 and 2 of I0, I1, or I2.
150 def VulcanWrite_6Cyc_LS01_I012_I012 : 
151   SchedWriteRes<[VulcanLS01, VulcanI012, VulcanI012]> {
152   let Latency = 6;
153   let NumMicroOps = 3;
154 }
155
156 // 1 cycles on LS0 or LS1 and F0 or F1.
157 def VulcanWrite_1Cyc_LS01_F01 : SchedWriteRes<[VulcanLS01, VulcanF01]> {
158   let Latency = 1;
159   let NumMicroOps = 2;
160 }
161
162 // 5 cycles on LS0 or LS1 and F0 or F1.
163 def VulcanWrite_5Cyc_LS01_F01 : SchedWriteRes<[VulcanLS01, VulcanF01]> {
164   let Latency = 5;
165   let NumMicroOps = 2;
166 }
167
168 // 6 cycles on LS0 or LS1 and F0 or F1.
169 def VulcanWrite_6Cyc_LS01_F01 : SchedWriteRes<[VulcanLS01, VulcanF01]> {
170   let Latency = 6;
171   let NumMicroOps = 2;
172 }
173
174 // 7 cycles on LS0 or LS1 and F0 or F1.
175 def VulcanWrite_7Cyc_LS01_F01 : SchedWriteRes<[VulcanLS01, VulcanF01]> {
176   let Latency = 7;
177   let NumMicroOps = 2;
178 }
179
180 // 8 cycles on LS0 or LS1 and F0 or F1.
181 def VulcanWrite_8Cyc_LS01_F01 : SchedWriteRes<[VulcanLS01, VulcanF01]> {
182   let Latency = 8;
183   let NumMicroOps = 2;
184 }
185
186 // Define commonly used read types.
187
188 // No forwarding is provided for these types.
189 def : ReadAdvance<ReadI,       0>;
190 def : ReadAdvance<ReadISReg,   0>;
191 def : ReadAdvance<ReadIEReg,   0>;
192 def : ReadAdvance<ReadIM,      0>;
193 def : ReadAdvance<ReadIMA,     0>;
194 def : ReadAdvance<ReadID,      0>;
195 def : ReadAdvance<ReadExtrHi,  0>;
196 def : ReadAdvance<ReadAdrBase, 0>;
197 def : ReadAdvance<ReadVLD,     0>;
198
199 }
200
201
202 //===----------------------------------------------------------------------===//
203 // 3. Instruction Tables.
204
205 let SchedModel = VulcanModel in {
206
207 //---
208 // 3.1 Branch Instructions
209 //---
210
211 // Branch, immed
212 // Branch and link, immed
213 // Compare and branch
214 def : WriteRes<WriteBr,      [VulcanI2]> { let Latency = 1; }
215
216 def : WriteRes<WriteSys,     []> { let Latency = 1; }
217 def : WriteRes<WriteBarrier, []> { let Latency = 1; }
218 def : WriteRes<WriteHint,    []> { let Latency = 1; }
219
220 def : WriteRes<WriteAtomic,  []> { let Unsupported = 1; }
221
222 // Branch, register
223 // Branch and link, register != LR
224 // Branch and link, register = LR
225 def : WriteRes<WriteBrReg,   [VulcanI2]> { let Latency = 1; }
226
227 //---
228 // 3.2 Arithmetic and Logical Instructions
229 // 3.3 Move and Shift Instructions
230 //---
231
232 // ALU, basic
233 // Conditional compare
234 // Conditional select
235 // Address generation
236 def : WriteRes<WriteI,       [VulcanI012]> { let Latency = 1; }
237 def : InstRW<[WriteI], (instrs COPY)>;
238
239 // ALU, extend and/or shift
240 def : WriteRes<WriteISReg,   [VulcanI012]> {
241   let Latency = 2;
242   let ResourceCycles = [2];
243 }
244
245 def : WriteRes<WriteIEReg,   [VulcanI012]> {
246   let Latency = 2;
247   let ResourceCycles = [2];
248 }
249
250 // Move immed
251 def : WriteRes<WriteImm,     [VulcanI012]> { let Latency = 1; }
252
253 // Variable shift
254 def : WriteRes<WriteIS,      [VulcanI012]> { let Latency = 1; }
255
256 //---
257 // 3.4 Divide and Multiply Instructions
258 //---
259
260 // Divide, W-form
261 // Latency range of 13-23.  Take the average.
262 def : WriteRes<WriteID32,    [VulcanI1]> {
263   let Latency = 18;
264   let ResourceCycles = [18];
265 }
266
267 // Divide, X-form
268 // Latency range of 13-39.  Take the average.
269 def : WriteRes<WriteID64,    [VulcanI1]> {
270   let Latency = 26;
271   let ResourceCycles = [26];
272 }
273
274 // Multiply accumulate, W-form
275 def : WriteRes<WriteIM32,    [VulcanI012]> { let Latency = 5; }
276
277 // Multiply accumulate, X-form
278 def : WriteRes<WriteIM64,    [VulcanI012]> { let Latency = 5; }
279
280 // Bitfield extract, two reg
281 def : WriteRes<WriteExtr,    [VulcanI012]> { let Latency = 1; }
282
283 // Bitfield move, basic
284 // Bitfield move, insert
285 // NOTE: Handled by WriteIS.
286
287 // Count leading
288 def : InstRW<[VulcanWrite_3Cyc_I1], (instregex "^CLS(W|X)r$",
289                                                "^CLZ(W|X)r$")>;
290
291 // Reverse bits/bytes
292 // NOTE: Handled by WriteI.
293
294 //---
295 // 3.6 Load Instructions 
296 // 3.10 FP Load Instructions
297 //---
298
299 // Load register, literal
300 // Load register, unscaled immed
301 // Load register, immed unprivileged
302 // Load register, unsigned immed
303 def : WriteRes<WriteLD,      [VulcanLS01]> { let Latency = 4; }
304
305 // Load register, immed post-index
306 // NOTE: Handled by WriteLD, WriteI.
307 // Load register, immed pre-index
308 // NOTE: Handled by WriteLD, WriteAdr.
309 def : WriteRes<WriteAdr,     [VulcanI012]> { let Latency = 1; }
310
311 // Load register offset, basic
312 // Load register, register offset, scale by 4/8
313 // Load register, register offset, scale by 2
314 // Load register offset, extend
315 // Load register, register offset, extend, scale by 4/8
316 // Load register, register offset, extend, scale by 2
317 def VulcanWriteLDIdx : SchedWriteVariant<[
318   SchedVar<ScaledIdxPred, [VulcanWrite_6Cyc_LS01_I012_I012]>,
319   SchedVar<NoSchedPred,   [VulcanWrite_5Cyc_LS01_I012]>]>;
320 def : SchedAlias<WriteLDIdx, VulcanWriteLDIdx>;
321
322 def VulcanReadAdrBase : SchedReadVariant<[
323   SchedVar<ScaledIdxPred, [ReadDefault]>,
324   SchedVar<NoSchedPred,   [ReadDefault]>]>;
325 def : SchedAlias<ReadAdrBase, VulcanReadAdrBase>;
326
327 // Load pair, immed offset, normal
328 // Load pair, immed offset, signed words, base != SP
329 // Load pair, immed offset signed words, base = SP
330 // LDP only breaks into *one* LS micro-op.  Thus
331 // the resources are handling by WriteLD.
332 def : WriteRes<WriteLDHi,    []> {
333   let Latency = 5;
334 }
335
336 // Load pair, immed pre-index, normal
337 // Load pair, immed pre-index, signed words
338 // Load pair, immed post-index, normal
339 // Load pair, immed post-index, signed words
340 // NOTE: Handled by WriteLD, WriteLDHi, WriteAdr.
341
342 //--
343 // 3.7 Store Instructions 
344 // 3.11 FP Store Instructions
345 //--
346
347 // Store register, unscaled immed
348 // Store register, immed unprivileged
349 // Store register, unsigned immed
350 def : WriteRes<WriteST,      [VulcanLS01, VulcanSD]> {
351   let Latency = 1;
352   let NumMicroOps = 2;
353 }
354
355 // Store register, immed post-index
356 // NOTE: Handled by WriteAdr, WriteST, ReadAdrBase
357
358 // Store register, immed pre-index
359 // NOTE: Handled by WriteAdr, WriteST
360
361 // Store register, register offset, basic
362 // Store register, register offset, scaled by 4/8
363 // Store register, register offset, scaled by 2
364 // Store register, register offset, extend
365 // Store register, register offset, extend, scale by 4/8
366 // Store register, register offset, extend, scale by 1
367 def : WriteRes<WriteSTIdx, [VulcanLS01, VulcanSD, VulcanI012]> {
368   let Latency = 1;
369   let NumMicroOps = 3;
370 }
371
372 // Store pair, immed offset, W-form
373 // Store pair, immed offset, X-form
374 def : WriteRes<WriteSTP,     [VulcanLS01, VulcanSD]> {
375   let Latency = 1;
376   let NumMicroOps = 2;
377 }
378
379 // Store pair, immed post-index, W-form
380 // Store pair, immed post-index, X-form
381 // Store pair, immed pre-index, W-form
382 // Store pair, immed pre-index, X-form
383 // NOTE: Handled by WriteAdr, WriteSTP.
384
385 //---
386 // 3.8 FP Data Processing Instructions
387 //---
388
389 // FP absolute value
390 // FP min/max
391 // FP negate
392 def : WriteRes<WriteF,       [VulcanF01]> { let Latency = 5; }
393
394 // FP arithmetic
395 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^FADD", "^FSUB")>;
396
397 // FP compare
398 def : WriteRes<WriteFCmp,    [VulcanF01]> { let Latency = 5; }
399
400 // FP divide, S-form
401 // FP square root, S-form
402 def : WriteRes<WriteFDiv,    [VulcanF01]> {
403   let Latency = 16;
404   let ResourceCycles = [8];
405 }
406
407 // FP divide, D-form
408 // FP square root, D-form
409 def : InstRW<[VulcanWrite_23Cyc_F01], (instrs FDIVDrr, FSQRTDr)>;
410
411 // FP multiply
412 // FP multiply accumulate
413 def : WriteRes<WriteFMul, [VulcanF01]> { let Latency = 6; }
414
415 // FP round to integral
416 def : InstRW<[VulcanWrite_7Cyc_F01],
417             (instregex "^FRINT(A|I|M|N|P|X|Z)(Sr|Dr)")>;
418
419 // FP select
420 def : InstRW<[VulcanWrite_4Cyc_F01], (instregex "^FCSEL")>;
421
422 //---
423 // 3.9 FP Miscellaneous Instructions
424 //---
425
426 // FP convert, from vec to vec reg
427 // FP convert, from gen to vec reg
428 // FP convert, from vec to gen reg
429 def : WriteRes<WriteFCvt, [VulcanF01]> { let Latency = 7; }
430
431 // FP move, immed
432 // FP move, register
433 def : WriteRes<WriteFImm, [VulcanF01]> { let Latency = 4; }
434
435 // FP transfer, from gen to vec reg
436 // FP transfer, from vec to gen reg
437 def : WriteRes<WriteFCopy, [VulcanF01]> { let Latency = 4; }
438 def : InstRW<[VulcanWrite_5Cyc_F01], (instrs FMOVXDHighr, FMOVDXHighr)>;
439
440 //---
441 // 3.12 ASIMD Integer Instructions
442 //---
443
444 // ASIMD absolute diff, D-form
445 // ASIMD absolute diff, Q-form
446 // ASIMD absolute diff accum, D-form
447 // ASIMD absolute diff accum, Q-form
448 // ASIMD absolute diff accum long
449 // ASIMD absolute diff long
450 // ASIMD arith, basic
451 // ASIMD arith, complex
452 // ASIMD compare
453 // ASIMD logical (AND, BIC, EOR)
454 // ASIMD max/min, basic
455 // ASIMD max/min, reduce, 4H/4S
456 // ASIMD max/min, reduce, 8B/8H
457 // ASIMD max/min, reduce, 16B
458 // ASIMD multiply, D-form
459 // ASIMD multiply, Q-form
460 // ASIMD multiply accumulate long
461 // ASIMD multiply accumulate saturating long
462 // ASIMD multiply long
463 // ASIMD pairwise add and accumulate
464 // ASIMD shift accumulate
465 // ASIMD shift by immed, basic
466 // ASIMD shift by immed and insert, basic, D-form
467 // ASIMD shift by immed and insert, basic, Q-form
468 // ASIMD shift by immed, complex
469 // ASIMD shift by register, basic, D-form
470 // ASIMD shift by register, basic, Q-form
471 // ASIMD shift by register, complex, D-form
472 // ASIMD shift by register, complex, Q-form
473 def : WriteRes<WriteV, [VulcanF01]> { let Latency = 7; }
474
475 // ASIMD arith, reduce, 4H/4S
476 // ASIMD arith, reduce, 8B/8H
477 // ASIMD arith, reduce, 16B
478 def : InstRW<[VulcanWrite_5Cyc_F01], 
479             (instregex "^ADDVv", "^SADDLVv", "^UADDLVv")>;
480
481 // ASIMD logical (MOV, MVN, ORN, ORR)
482 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^ORRv", "^ORNv", "^NOTv")>;
483
484 // ASIMD polynomial (8x8) multiply long
485 def : InstRW<[VulcanWrite_5Cyc_F01], (instrs PMULLv8i8, PMULLv16i8)>;
486
487 //---
488 // 3.13 ASIMD Floating-point Instructions
489 //---
490
491 // ASIMD FP absolute value
492 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FABSv")>;
493
494 // ASIMD FP arith, normal, D-form
495 // ASIMD FP arith, normal, Q-form
496 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^FABDv", "^FADDv", "^FSUBv")>;
497
498 // ASIMD FP arith,pairwise, D-form
499 // ASIMD FP arith, pairwise, Q-form
500 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^FADDPv")>;
501
502 // ASIMD FP compare, D-form
503 // ASIMD FP compare, Q-form
504 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FACGEv", "^FACGTv")>;
505 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FCMEQv", "^FCMGEv",
506                                                 "^FCMGTv", "^FCMLEv",
507                                                 "^FCMLTv")>;
508
509 // ASIMD FP convert, long
510 // ASIMD FP convert, narrow
511 // ASIMD FP convert, other, D-form
512 // ASIMD FP convert, other, Q-form
513 // NOTE: Handled by WriteV.
514
515 // ASIMD FP divide, D-form, F32
516 def : InstRW<[VulcanWrite_16Cyc_F01], (instrs FDIVv2f32)>;
517
518 // ASIMD FP divide, Q-form, F32
519 def : InstRW<[VulcanWrite_16Cyc_F01], (instrs FDIVv4f32)>;
520
521 // ASIMD FP divide, Q-form, F64
522 def : InstRW<[VulcanWrite_23Cyc_F01], (instrs FDIVv2f64)>;
523
524 // ASIMD FP max/min, normal, D-form
525 // ASIMD FP max/min, normal, Q-form
526 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FMAXv", "^FMAXNMv",
527                                                 "^FMINv", "^FMINNMv")>;
528
529 // ASIMD FP max/min, pairwise, D-form
530 // ASIMD FP max/min, pairwise, Q-form
531 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FMAXPv", "^FMAXNMPv",
532                                                 "^FMINPv", "^FMINNMPv")>;
533
534 // ASIMD FP max/min, reduce
535 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FMAXVv", "^FMAXNMVv",
536                                                 "^FMINVv", "^FMINNMVv")>;
537
538 // ASIMD FP multiply, D-form, FZ
539 // ASIMD FP multiply, D-form, no FZ
540 // ASIMD FP multiply, Q-form, FZ
541 // ASIMD FP multiply, Q-form, no FZ
542 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^FMULv", "^FMULXv")>;
543
544 // ASIMD FP multiply accumulate, Dform, FZ
545 // ASIMD FP multiply accumulate, Dform, no FZ
546 // ASIMD FP multiply accumulate, Qform, FZ
547 // ASIMD FP multiply accumulate, Qform, no FZ
548 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^FMLAv", "^FMLSv")>;
549
550 // ASIMD FP negate
551 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FNEGv")>;
552
553 // ASIMD FP round, D-form
554 // ASIMD FP round, Q-form
555 // NOTE: Handled by WriteV.
556
557 //--
558 // 3.14 ASIMD Miscellaneous Instructions
559 //--
560
561 // ASIMD bit reverse
562 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^RBITv")>;
563
564 // ASIMD bitwise insert, D-form
565 // ASIMD bitwise insert, Q-form
566 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^BIFv", "^BITv", "^BSLv")>;
567
568 // ASIMD count, D-form
569 // ASIMD count, Q-form
570 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^CLSv", "^CLZv", "^CNTv")>;
571
572 // ASIMD duplicate, gen reg
573 // ASIMD duplicate, element
574 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^DUPv")>;
575
576 // ASIMD extract
577 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^EXTv")>;
578
579 // ASIMD extract narrow
580 // ASIMD extract narrow, saturating
581 // NOTE: Handled by WriteV.
582
583 // ASIMD insert, element to element
584 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^INSv")>;
585
586 // ASIMD move, integer immed
587 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^MOVIv", "^MOVIDv")>;
588
589 // ASIMD move, FP immed
590 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^FMOVv")>;
591
592 // ASIMD reciprocal estimate, D-form
593 // ASIMD reciprocal estimate, Q-form
594 def : InstRW<[VulcanWrite_5Cyc_F01], 
595             (instregex "^FRECPEv", "^FRECPXv", "^URECPEv",
596                                    "^FRSQRTEv", "^URSQRTEv")>;
597
598 // ASIMD reciprocal step, D-form, FZ
599 // ASIMD reciprocal step, D-form, no FZ
600 // ASIMD reciprocal step, Q-form, FZ
601 // ASIMD reciprocal step, Q-form, no FZ
602 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^FRECPSv", "^FRSQRTSv")>;
603
604 // ASIMD reverse
605 def : InstRW<[VulcanWrite_5Cyc_F01], 
606             (instregex "^REV16v", "^REV32v", "^REV64v")>;
607
608 // ASIMD table lookup, D-form
609 // ASIMD table lookup, Q-form
610 def : InstRW<[VulcanWrite_8Cyc_F01], (instregex "^TBLv", "^TBXv")>;
611
612 // ASIMD transfer, element to word or word
613 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^UMOVv")>;
614
615 // ASIMD transfer, element to gen reg
616 def : InstRW<[VulcanWrite_6Cyc_F01], (instregex "^SMOVv", "^UMOVv")>;
617
618 // ASIMD transfer gen reg to element
619 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^INSv")>;
620
621 // ASIMD transpose
622 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^TRN1v", "^TRN2v",
623                                                 "^UZP1v", "^UZP2v")>;
624
625 // ASIMD unzip/zip
626 def : InstRW<[VulcanWrite_5Cyc_F01], (instregex "^ZIP1v", "^ZIP2v")>;
627
628 //--
629 // 3.15 ASIMD Load Instructions 
630 //--
631
632 // ASIMD load, 1 element, multiple, 1 reg, D-form
633 // ASIMD load, 1 element, multiple, 1 reg, Q-form
634 def : InstRW<[VulcanWrite_4Cyc_LS01], 
635             (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
636 def : InstRW<[VulcanWrite_4Cyc_LS01, WriteAdr], 
637             (instregex "^LD1Onev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
638
639 // ASIMD load, 1 element, multiple, 2 reg, D-form
640 // ASIMD load, 1 element, multiple, 2 reg, Q-form
641 def : InstRW<[VulcanWrite_4Cyc_LS01], 
642             (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
643 def : InstRW<[VulcanWrite_4Cyc_LS01, WriteAdr], 
644             (instregex "^LD1Twov(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
645
646 // ASIMD load, 1 element, multiple, 3 reg, D-form
647 // ASIMD load, 1 element, multiple, 3 reg, Q-form
648 def : InstRW<[VulcanWrite_5Cyc_LS01], 
649             (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
650 def : InstRW<[VulcanWrite_5Cyc_LS01, WriteAdr], 
651             (instregex "^LD1Threev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
652
653 // ASIMD load, 1 element, multiple, 4 reg, D-form
654 // ASIMD load, 1 element, multiple, 4 reg, Q-form
655 def : InstRW<[VulcanWrite_6Cyc_LS01], 
656             (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
657 def : InstRW<[VulcanWrite_6Cyc_LS01, WriteAdr], 
658             (instregex "^LD1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
659
660 // ASIMD load, 1 element, one lane, B/H/S
661 // ASIMD load, 1 element, one lane, D
662 def : InstRW<[VulcanWrite_5Cyc_LS01_F01], (instregex "^LD1i(8|16|32|64)$")>;
663 def : InstRW<[VulcanWrite_5Cyc_LS01_F01, WriteAdr], 
664             (instregex "^LD1i(8|16|32|64)_POST$")>;
665
666 // ASIMD load, 1 element, all lanes, D-form, B/H/S
667 // ASIMD load, 1 element, all lanes, D-form, D
668 // ASIMD load, 1 element, all lanes, Q-form
669 def : InstRW<[VulcanWrite_5Cyc_LS01_F01], 
670             (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
671 def : InstRW<[VulcanWrite_5Cyc_LS01_F01, WriteAdr], 
672             (instregex "^LD1Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
673
674 // ASIMD load, 2 element, multiple, D-form, B/H/S
675 // ASIMD load, 2 element, multiple, Q-form, D
676 def : InstRW<[VulcanWrite_5Cyc_LS01_F01], 
677             (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
678 def : InstRW<[VulcanWrite_5Cyc_LS01_F01, WriteAdr], 
679             (instregex "^LD2Twov(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
680
681 // ASIMD load, 2 element, one lane, B/H
682 // ASIMD load, 2 element, one lane, S
683 // ASIMD load, 2 element, one lane, D
684 def : InstRW<[VulcanWrite_5Cyc_LS01_F01], (instregex "^LD2i(8|16|32|64)$")>;
685 def : InstRW<[VulcanWrite_5Cyc_LS01_F01, WriteAdr], 
686             (instregex "^LD2i(8|16|32|64)_POST$")>;
687
688 // ASIMD load, 2 element, all lanes, D-form, B/H/S
689 // ASIMD load, 2 element, all lanes, D-form, D
690 // ASIMD load, 2 element, all lanes, Q-form
691 def : InstRW<[VulcanWrite_5Cyc_LS01_F01], 
692             (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
693 def : InstRW<[VulcanWrite_5Cyc_LS01_F01, WriteAdr], 
694             (instregex "^LD2Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
695
696 // ASIMD load, 3 element, multiple, D-form, B/H/S
697 // ASIMD load, 3 element, multiple, Q-form, B/H/S
698 // ASIMD load, 3 element, multiple, Q-form, D
699 def : InstRW<[VulcanWrite_8Cyc_LS01_F01], 
700             (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
701 def : InstRW<[VulcanWrite_8Cyc_LS01_F01, WriteAdr], 
702             (instregex "^LD3Threev(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
703
704 // ASIMD load, 3 element, one lone, B/H
705 // ASIMD load, 3 element, one lane, S
706 // ASIMD load, 3 element, one lane, D
707 def : InstRW<[VulcanWrite_7Cyc_LS01_F01], (instregex "^LD3i(8|16|32|64)$")>;
708 def : InstRW<[VulcanWrite_7Cyc_LS01_F01, WriteAdr], 
709             (instregex "^LD3i(8|16|32|64)_POST$")>;
710
711 // ASIMD load, 3 element, all lanes, D-form, B/H/S
712 // ASIMD load, 3 element, all lanes, D-form, D
713 // ASIMD load, 3 element, all lanes, Q-form, B/H/S
714 // ASIMD load, 3 element, all lanes, Q-form, D
715 def : InstRW<[VulcanWrite_7Cyc_LS01_F01], 
716             (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
717 def : InstRW<[VulcanWrite_7Cyc_LS01_F01, WriteAdr], 
718             (instregex "^LD3Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
719
720 // ASIMD load, 4 element, multiple, D-form, B/H/S
721 // ASIMD load, 4 element, multiple, Q-form, B/H/S
722 // ASIMD load, 4 element, multiple, Q-form, D
723 def : InstRW<[VulcanWrite_8Cyc_LS01_F01], 
724             (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
725 def : InstRW<[VulcanWrite_8Cyc_LS01_F01, WriteAdr], 
726             (instregex "^LD4Fourv(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
727
728 // ASIMD load, 4 element, one lane, B/H
729 // ASIMD load, 4 element, one lane, S
730 // ASIMD load, 4 element, one lane, D
731 def : InstRW<[VulcanWrite_6Cyc_LS01_F01], (instregex "^LD4i(8|16|32|64)$")>;
732 def : InstRW<[VulcanWrite_6Cyc_LS01_F01, WriteAdr], 
733             (instregex "^LD4i(8|16|32|64)_POST$")>;
734
735 // ASIMD load, 4 element, all lanes, D-form, B/H/S
736 // ASIMD load, 4 element, all lanes, D-form, D
737 // ASIMD load, 4 element, all lanes, Q-form, B/H/S
738 // ASIMD load, 4 element, all lanes, Q-form, D
739 def : InstRW<[VulcanWrite_6Cyc_LS01_F01], 
740             (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
741 def : InstRW<[VulcanWrite_6Cyc_LS01_F01, WriteAdr], 
742             (instregex "^LD4Rv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
743
744 //--
745 // 3.16 ASIMD Store Instructions
746 //--
747
748 // ASIMD store, 1 element, multiple, 1 reg, D-form
749 // ASIMD store, 1 element, multiple, 1 reg, Q-form
750 def : InstRW<[VulcanWrite_1Cyc_LS01], 
751             (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
752 def : InstRW<[VulcanWrite_1Cyc_LS01, WriteAdr], 
753             (instregex "^ST1Onev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
754
755 // ASIMD store, 1 element, multiple, 2 reg, D-form
756 // ASIMD store, 1 element, multiple, 2 reg, Q-form
757 def : InstRW<[VulcanWrite_1Cyc_LS01], 
758             (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
759 def : InstRW<[VulcanWrite_1Cyc_LS01, WriteAdr], 
760             (instregex "^ST1Twov(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
761
762 // ASIMD store, 1 element, multiple, 3 reg, D-form
763 // ASIMD store, 1 element, multiple, 3 reg, Q-form
764 def : InstRW<[VulcanWrite_1Cyc_LS01], 
765             (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
766 def : InstRW<[VulcanWrite_1Cyc_LS01, WriteAdr], 
767             (instregex "^ST1Threev(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
768
769 // ASIMD store, 1 element, multiple, 4 reg, D-form
770 // ASIMD store, 1 element, multiple, 4 reg, Q-form
771 def : InstRW<[VulcanWrite_1Cyc_LS01], 
772             (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)$")>;
773 def : InstRW<[VulcanWrite_1Cyc_LS01, WriteAdr], 
774             (instregex "^ST1Fourv(8b|4h|2s|1d|16b|8h|4s|2d)_POST$")>;
775
776 // ASIMD store, 1 element, one lane, B/H/S
777 // ASIMD store, 1 element, one lane, D
778 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], 
779             (instregex "^ST1i(8|16|32|64)$")>;
780 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
781             (instregex "^ST1i(8|16|32|64)_POST$")>;
782
783 // ASIMD store, 2 element, multiple, D-form, B/H/S
784 // ASIMD store, 2 element, multiple, Q-form, B/H/S
785 // ASIMD store, 2 element, multiple, Q-form, D
786 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], 
787             (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)$")>;
788 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
789             (instregex "^ST2Twov(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
790
791 // ASIMD store, 2 element, one lane, B/H/S
792 // ASIMD store, 2 element, one lane, D
793 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], 
794             (instregex "^ST2i(8|16|32|64)$")>;
795 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
796             (instregex "^ST2i(8|16|32|64)_POST$")>;
797
798 // ASIMD store, 3 element, multiple, D-form, B/H/S
799 // ASIMD store, 3 element, multiple, Q-form, B/H/S
800 // ASIMD store, 3 element, multiple, Q-form, D
801 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], 
802             (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)$")>;
803 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
804             (instregex "^ST3Threev(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
805
806 // ASIMD store, 3 element, one lane, B/H
807 // ASIMD store, 3 element, one lane, S
808 // ASIMD store, 3 element, one lane, D
809 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], (instregex "^ST3i(8|16|32|64)$")>;
810 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
811             (instregex "^ST3i(8|16|32|64)_POST$")>;
812
813 // ASIMD store, 4 element, multiple, D-form, B/H/S
814 // ASIMD store, 4 element, multiple, Q-form, B/H/S
815 // ASIMD store, 4 element, multiple, Q-form, D
816 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], 
817             (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)$")>;
818 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
819             (instregex "^ST4Fourv(8b|4h|2s|16b|8h|4s|2d)_POST$")>;
820
821 // ASIMD store, 4 element, one lane, B/H
822 // ASIMD store, 4 element, one lane, S
823 // ASIMD store, 4 element, one lane, D
824 def : InstRW<[VulcanWrite_1Cyc_LS01_F01], (instregex "^ST4i(8|16|32|64)$")>;
825 def : InstRW<[VulcanWrite_1Cyc_LS01_F01, WriteAdr], 
826             (instregex "^ST4i(8|16|32|64)_POST$")>;
827
828 //--
829 // 3.17 Cryptography Extensions
830 //--
831
832 // Crypto AES ops
833 def : InstRW<[VulcanWrite_5Cyc_F1], (instregex "^AES")>;
834
835 // Crypto polynomial (64x64) multiply long
836 def : InstRW<[VulcanWrite_5Cyc_F1], (instrs PMULLv1i64, PMULLv2i64)>;
837
838 // Crypto SHA1 xor ops
839 // Crypto SHA1 schedule acceleration ops
840 // Crypto SHA256 schedule acceleration op (1 u-op)
841 // Crypto SHA256 schedule acceleration op (2 u-ops)
842 // Crypto SHA256 hash acceleration ops
843 def : InstRW<[VulcanWrite_7Cyc_F1], (instregex "^SHA")>;
844
845 //--
846 // 3.18 CRC
847 //--
848
849 // CRC checksum ops
850 def : InstRW<[VulcanWrite_4Cyc_I1], (instregex "^CRC32")>;
851
852 } // SchedModel = VulcanModel