-
Notifications
You must be signed in to change notification settings - Fork 12.2k
/
AArch64SchedOryon.td
1727 lines (1400 loc) · 58.9 KB
/
AArch64SchedOryon.td
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//=- AArch64SchedOryon.td - Nuvia Inc Oryon CPU 001 ---*- tablegen -*-=//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This file defines the scheduling model for Nuvia Inc Oryon
// family of processors.
//
//===----------------------------------------------------------------------===//
//===----------------------------------------------------------------------===//
// Pipeline Description.
def OryonModel : SchedMachineModel {
let IssueWidth = 14; // 14 micro-ops dispatched at a time. IXU=6, LSU=4, VXU=4
let MicroOpBufferSize = 376; // 192 (48x4) entries in micro-op re-order buffer in VXU.
// 120 ((20+20)x3) entries in micro-op re-order buffer in IXU
// 64 (16+16)x2 re-order buffer in LSU
// total 373
let LoadLatency = 4; // 4 cycle Load-to-use from L1D$
// LSU=5 NEON load
let MispredictPenalty = 13; // 13 cycles for mispredicted branch.
// Determined via a mix of micro-arch details and experimentation.
let LoopMicroOpBufferSize = 0; // Do not have a LoopMicroOpBuffer
let PostRAScheduler = 1; // Using PostRA sched.
let CompleteModel = 1;
list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
SMEUnsupported.F,
MTEUnsupported.F,
PAUnsupported.F,
[HasPAuth, HasCSSC]);
// FIXME: Remove when all errors have been fixed.
let FullInstRWOverlapCheck = 0;
}
let SchedModel = OryonModel in {
// Issue ports.
// IXU has 6 ports p0 ~ p5
// LSU has 4 ports p6 ~ p9(ls0 ~ ls3), p10/p11(std0, std1) has to work with ls0~ls3
// VXU has 4 ports p12 ~ p15
// cross IXU/LSU/VXU resource group for FMOV P41 of VXU
// I2V
def ORYONI4FP0 : ProcResource<1>;
def ORYONI5FP1 : ProcResource<1>;
// V2I
def ORYONFP0I4 : ProcResource<1>;
def ORYONFP1I5 : ProcResource<1>;
// store 1 for normal store instructions
def ORYONST0 : ProcResource<1>;
// store 2 for normal store instructions
def ORYONST1 : ProcResource<1>;
// Port 0: ALU/Indirect/Direct Branch.
def ORYONP0 : ProcResource<1>;
// Port 1: ALU/Direct Branch.
def ORYONP1 : ProcResource<1>;
// Port 2: ALU.
def ORYONP2 : ProcResource<1>;
// Port 3: ALU.
def ORYONP3 : ProcResource<1>;
// Port 4: ALU.
def ORYONP4 : ProcResource<1> {
let Super = ORYONI4FP0;
let Super = ORYONFP0I4; }
// Port 5: ALU.
def ORYONP5 : ProcResource<1> {
let Super = ORYONI5FP1;
let Super = ORYONFP1I5; }
// Port 6: Load/Store. LS0
def ORYONP6 : ProcResource<1> {
let Super = ORYONST0; }
// Port 7: Load/store. LS1
def ORYONP7 : ProcResource<1> {
let Super = ORYONST0; }
// Port 8: Load/Store. LS2
def ORYONP8 : ProcResource<1> {
let Super = ORYONST1; }
// Port 9: Load/store. LS3
def ORYONP9 : ProcResource<1> {
let Super = ORYONST1; }
// Port 10: Load/Store. STD0
def ORYONP10SD0 : ProcResource<1> {
let Super = ORYONST0; }
// Port 11: Load/store. STD1
def ORYONP11SD1 : ProcResource<1> {
let Super = ORYONST1; }
// Port 12: FP/Neon/SIMD/Crypto.
def ORYONP12FP0 : ProcResource<1> {
let Super = ORYONI4FP0;
let Super = ORYONFP0I4; }
// Port 13: FP/Neon/SIMD/Crypto.
def ORYONP13FP1 : ProcResource<1> {
let Super = ORYONI5FP1;
let Super = ORYONFP1I5; }
// Port 14: FP/Neon/SIMD/Crypto.
def ORYONP14FP2 : ProcResource<1>;
// Port 15: FP/Neon/SIMD/Crypto.
def ORYONP15FP3 : ProcResource<1>;
// Define groups for the functional units on each issue port. Each group
// created will be used by a WriteRes.
// Integer add/shift/logical/misc. instructions on port I0/I1/I2/I3/I4/I5.
def ORYONI012345 : ProcResGroup<[ORYONP0, ORYONP1, ORYONP2,
ORYONP3, ORYONP4, ORYONP5]> {
let BufferSize = 120;
}
// Direct Conditional Branch instructions on ports I0/I1.
def ORYONI01 : ProcResGroup<[ORYONP0, ORYONP1]> {
let BufferSize = 40;
}
// Indirect/crypto Conditional Branch instructions on ports I0.
def ORYONI0 : ProcResGroup<[ORYONP0]> {
let BufferSize = 20;
}
// Crypto/CRC/PAU instructions on ports I2.
def ORYONI2 : ProcResGroup<[ORYONP2]> {
let BufferSize = 20;
}
// Multiply/Multiply-ADD instructions on ports I4/I5.
def ORYONI45 : ProcResGroup<[ORYONP4, ORYONP5]> {
let BufferSize = 40;
}
// Divide instructions on ports I5.
def ORYONI5 : ProcResGroup<[ORYONP5]> {
let BufferSize = 20;
}
// Comparison instructions on ports I0/I1/I2/I3.
def ORYONI0123 : ProcResGroup<[ORYONP0, ORYONP1,
ORYONP2, ORYONP3]> {
let BufferSize = 80;
}
// Load instructions on ports P6/P7/P8/P9.
def ORYONLD : ProcResGroup<[ORYONP6, ORYONP7, ORYONP8, ORYONP9]> {
let BufferSize = 64;
}
// Store instructions on combo of STA/STD pipes
def ORYONST : ProcResGroup<[ORYONST0, ORYONST1]> {
let BufferSize = 64;
}
// Arithmetic and CRYP-AED ASIMD/FP instructions on ports FP0/FP1/FP2/FP3.
def ORYONFP0123 : ProcResGroup<[ORYONP12FP0, ORYONP13FP1,
ORYONP14FP2, ORYONP15FP3]> {
let BufferSize = 192;
}
// FP Comparison and F/I move instructions on ports FP0/FP1.
def ORYONFP01 : ProcResGroup<[ORYONP12FP0, ORYONP13FP1]> {
let BufferSize = 96;
}
// FDIV instructions on ports FP3.
def ORYONFP3 : ProcResGroup<[ORYONP15FP3]> {
let BufferSize = 48;
}
// CRYP-SHA instructions on ports FP1.
def ORYONFP1 : ProcResGroup<[ORYONP14FP2]> {
let BufferSize = 48;
}
def ORYONFP2 : ProcResGroup<[ORYONP14FP2]> {
let BufferSize = 48;
}
// Reciprocal, Squre root on FP0.
def ORYONFP0 : ProcResGroup<[ORYONP12FP0]> {
let BufferSize = 48;
}
// cross IXU/LSU/VXU resource group for FMOV P41 of VXU
// I2V
def ORYONI2V : ProcResGroup<[ORYONI4FP0, ORYONI5FP1]> {
let BufferSize = 40;
}
// V2I
def ORYONV2I : ProcResGroup<[ORYONFP0I4, ORYONFP1I5]> {
let BufferSize = 96;
}
// Define commonly used write types for InstRW specializations.
// All definitions follow the format: ORYONWrite_<NumCycles>Cyc_<Resources>.
// Because of the complexity of Oryon CPU, we skip the following
// generic definitions and define each instruction specifically
// These WriteRes entries are not used in the Falkor sched model.
def : WriteRes<WriteImm, []> { let Unsupported = 1; }
def : WriteRes<WriteI, []> { let Unsupported = 1; }
def : WriteRes<WriteISReg, []> { let Unsupported = 1; }
def : WriteRes<WriteIEReg, []> { let Unsupported = 1; }
def : WriteRes<WriteExtr, []> { let Unsupported = 1; }
def : WriteRes<WriteIS, []> { let Unsupported = 1; }
def : WriteRes<WriteID32, []> { let Unsupported = 1; }
def : WriteRes<WriteID64, []> { let Unsupported = 1; }
def : WriteRes<WriteIM32, []> { let Unsupported = 1; }
def : WriteRes<WriteIM64, []> { let Unsupported = 1; }
def : WriteRes<WriteBr, []> { let Unsupported = 1; }
def : WriteRes<WriteBrReg, []> { let Unsupported = 1; }
def : WriteRes<WriteLD, []> { let Unsupported = 1; }
def : WriteRes<WriteST, []> { let Unsupported = 1; }
def : WriteRes<WriteSTP, []> { let Unsupported = 1; }
def : WriteRes<WriteAdr, []> { let Unsupported = 1; }
def : WriteRes<WriteLDIdx, []> { let Unsupported = 1; }
def : WriteRes<WriteSTIdx, []> { let Unsupported = 1; }
def : WriteRes<WriteF, []> { let Unsupported = 1; }
def : WriteRes<WriteFCmp, []> { let Unsupported = 1; }
def : WriteRes<WriteFCvt, []> { let Unsupported = 1; }
def : WriteRes<WriteFCopy, []> { let Unsupported = 1; }
def : WriteRes<WriteFImm, []> { let Unsupported = 1; }
def : WriteRes<WriteFMul, []> { let Unsupported = 1; }
def : WriteRes<WriteFDiv, []> { let Unsupported = 1; }
def : WriteRes<WriteVd, []> { let Unsupported = 1; }
def : WriteRes<WriteVq, []> { let Unsupported = 1; }
def : WriteRes<WriteVLD, []> { let Unsupported = 1; }
def : WriteRes<WriteVST, []> { let Unsupported = 1; }
def : WriteRes<WriteSys, []> { let Unsupported = 1; }
def : WriteRes<WriteBarrier, []> { let Unsupported = 1; }
def : WriteRes<WriteHint, []> { let Unsupported = 1; }
def : WriteRes<WriteLDHi, []> { let Unsupported = 1; }
def : WriteRes<WriteAtomic, []> { let Unsupported = 1; }
// These ReadAdvance entries will be defined in later implementation
def : ReadAdvance<ReadI, 0>;
def : ReadAdvance<ReadISReg, 0>;
def : ReadAdvance<ReadIEReg, 0>;
def : ReadAdvance<ReadIM, 0>;
def : ReadAdvance<ReadIMA, 0>;
def : ReadAdvance<ReadID, 0>;
def : ReadAdvance<ReadExtrHi, 0>;
def : ReadAdvance<ReadAdrBase, 0>;
def : ReadAdvance<ReadVLD, 0>;
def : ReadAdvance<ReadST, 0>;
//IXU resource definition
// 1 cycles NO pipe
def ORYONWrite_1Cyc_NONE : SchedWriteRes<[]>;
// 1 cycles on I01.
def ORYONWrite_1Cyc_I01 : SchedWriteRes<[ORYONI01]>;
def ORYONWrite_1Cyc_2Uops_I01 : SchedWriteRes<[ORYONI01]> {
let NumMicroOps = 2;
}
def ORYONWrite_1Cyc_I0 : SchedWriteRes<[ORYONI0]>;
// 7 cycles on I2. PAC*/AUT* instructions
def ORYONWrite_7Cyc_I2 : SchedWriteRes<[ORYONI2]> {
let Latency = 7;
}
// 7 cycles on I2. PAC*/AUT* instructions
def ORYONWrite_7Cyc_3Uops_I2 : SchedWriteRes<[ORYONI2]> {
let Latency = 7;
let NumMicroOps = 3;
}
// 8 (7+1+1) cycles on I2 and I0/I1, I0. Authentication branch instructions
// these instructions are broken down to three uops
// a. PtrAuth on pipe 2 taking 7 cycles
// b. Link Register Update on pipes 0 and 1 taking 1 cycle
// c. Indirect branch on pipe 0 taking 1 cycle
def ORYONWrite_9Cyc_I012 : SchedWriteRes<[ORYONI2, ORYONI01]> {
let Latency = 9;
let NumMicroOps = 3;
}
// 3 cycles on I2. CRC32 and CRC32C instructions
def ORYONWrite_3Cyc_I2 : SchedWriteRes<[ORYONI2]> {
let Latency = 3;
}
// 1 cycle on I012345
def ORYONWrite_1Cyc_I012345 : SchedWriteRes<[ORYONI012345]>;
// 1 cycle on I0123
def ORYONWrite_1Cyc_I0123 : SchedWriteRes<[ORYONI0123]>;
// 1 cycle on 2 of I012345
def ORYONWrite_1Cyc_I012345_I012345 :
SchedWriteRes<[ORYONI012345, ORYONI012345]> ;
// 2 cycle on 2 of I0123 with ReleaseAtCycles
def ORYONWrite_2Cyc_I0123_I0123_RC :
SchedWriteRes<[ORYONI0123, ORYONI0123]> {
let Latency = 2;
let ReleaseAtCycles = [2,2];
}
// 2 cycle on 2 of I012345
def ORYONWrite_2Cyc_I012345_I012345_RC :
SchedWriteRes<[ORYONI012345, ORYONI012345]> {
let Latency = 2;
let ReleaseAtCycles = [2,2];
}
// 3 cycle on 2 of I45
def ORYONWrite_3Cyc_I45_I45_RC :
SchedWriteRes<[ORYONI45, ORYONI45]> {
let Latency = 3;
let ReleaseAtCycles = [2,2];
}
// 3 cycle on I45
def ORYONWrite_3Cyc_I45 : SchedWriteRes<[ORYONI45]> {
let Latency = 3;
}
// 7 cycle on I2 32-bit integer division
def ORYONWrite_7Cyc_I2_RC : SchedWriteRes<[ORYONI2]> {
let Latency = 7;
let ReleaseAtCycles = [2];
}
// 9 cycle on I2 64-bit integer division
def ORYONWrite_9Cyc_I2_RC : SchedWriteRes<[ORYONI2]> {
let Latency = 9;
let ReleaseAtCycles = [2];
}
// LSU resource definition
// need to define WriteLDAdr, WriteAdrAdr, WriteLDHi, WriteSTX
// 4 cycle on LS(P6789)
def ORYONWrite_4Cyc_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 4;
}
// 4 cycle for Post/Pre inc/dec access, also covers all pair loads Post/Pre
def ORYONWrite_4Cyc_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 4;
}
// 5 (4+1) for VXU SIMD access/could also include FP
// resource might not be correct, as VXU resource not included
def ORYONWrite_5Cyc_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
}
def ORYONWrite_5Cyc_2Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 2;
}
def ORYONWrite_5Cyc_3Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 3;
}
def ORYONWrite_5Cyc_4Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 4;
}
def ORYONWrite_5Cyc_5Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 5;
}
def ORYONWrite_5Cyc_6Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 6;
}
def ORYONWrite_5Cyc_8Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 8;
}
def ORYONWrite_5Cyc_10Uops_LD : SchedWriteRes<[ORYONLD]> {
let Latency = 5;
let NumMicroOps = 10;
}
// 6 cycle for Post/Pre inc/dec access
def ORYONWrite_5Cyc_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
}
def ORYONWrite_5Cyc_2Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 2;
}
def ORYONWrite_5Cyc_3Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 3;
}
def ORYONWrite_5Cyc_4Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 4;
}
def ORYONWrite_5Cyc_5Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 5;
}
def ORYONWrite_5Cyc_6Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 6;
}
def ORYONWrite_5Cyc_8Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 8;
}
def ORYONWrite_5Cyc_10Uops_LD_I012345 : SchedWriteRes<[ORYONLD, ORYONI012345]> {
let Latency = 5;
let NumMicroOps = 10;
}
// 1 cycle for all generic stores
def ORYONWrite_1Cyc_ST : SchedWriteRes<[ORYONST]>;
def ORYONWrite_1Cyc_2Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 2;
}
def ORYONWrite_1Cyc_3Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 3;
}
def ORYONWrite_1Cyc_4Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 4;
}
def ORYONWrite_1Cyc_5Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 5;
}
def ORYONWrite_1Cyc_6Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 6;
}
def ORYONWrite_1Cyc_8Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 8;
}
def ORYONWrite_1Cyc_10Uops_ST : SchedWriteRes<[ORYONST]> {
let NumMicroOps = 10;
}
// 1 cycle for neon write: float + ASIMD with Post/Pre Inc/Dec access
// also includes Pair store until further informed
def ORYONWrite_1Cyc_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 3;
}
def ORYONWrite_1Cyc_2Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 2;
}
def ORYONWrite_1Cyc_3Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 3;
}
def ORYONWrite_1Cyc_4Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 4;
}
def ORYONWrite_1Cyc_5Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 5;
}
def ORYONWrite_1Cyc_6Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 6;
}
def ORYONWrite_1Cyc_8Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 8;
}
def ORYONWrite_1Cyc_10Uops_ST_I012345 : SchedWriteRes<[ORYONST, ORYONI012345]> {
let NumMicroOps = 10;
}
// VXU resource definition
// I2V instruction has 1 uOp
// I2v with convert has 2 uOps
// all I2V, V2I's throughputs are 2
// On VXU doc, p37 -- latencies and throughput
// P41, resource taken, P42, uOps
def ORYONWrite_I2V_4Cyc_I45 : SchedWriteRes<[ORYONI2V]> {
let Latency = 4;
}
// inline a FCVT, so add one more uOp
def ORYONWrite_I2V_7Cyc_I45 : SchedWriteRes<[ORYONI2V]> {
let Latency = 7;
let NumMicroOps = 2;
}
// V2I move instruction has 1/2 uOps, P42 in VXU doc
// Latency is 3, FCVT is also 3 cycle
// move + convert is 6 (3+3) cycles
// throughput is 2
def ORYONWrite_V2I_3Cyc_FP01 : SchedWriteRes<[ORYONV2I]> {
let Latency = 3;
}
// inline a FCVT, so add one more uOp
def ORYONWrite_V2I_6Cyc_FP01 : SchedWriteRes<[ORYONV2I]> {
let Latency = 6;
let NumMicroOps = 2;
}
def ORYONWrite_V2V_2Cyc_FP0123 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 2;
}
def ORYONWrite_V2V_3Cyc_FP0123 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 3;
}
def ORYONWrite_V2V_6Cyc_FP01 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 6;
let NumMicroOps = 3;
}
def ORYONWrite_4Cyc_FP0123 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 4;
}
def ORYONWrite_3Cyc_FP0 : SchedWriteRes<[ORYONFP0]> {
let Latency = 3;
}
def ORYONWrite_3Cyc_FP0123 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 3;
}
def ORYONWrite_3Cyc_2Uops_FP0123 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 3;
let NumMicroOps = 2;
}
def ORYONWrite_2Cyc_FP0123 : SchedWriteRes<[ORYONFP0123]> {
let Latency = 2;
}
def ORYONWrite_2Cyc_FP01 : SchedWriteRes<[ORYONFP01]> {
let Latency = 2;
}
// 2 cycle on FP1
def ORYONWrite_2Cyc_FP1 : SchedWriteRes<[ORYONFP1]> {
let Latency = 2;
}
// 3 cycle on FP1
def ORYONWrite_3Cyc_FP1 : SchedWriteRes<[ORYONFP1]> {
let Latency = 3;
}
// 4 cycle , 0.5 throughput on FP1
def ORYONWrite_4Cyc_FP1_RC4 : SchedWriteRes<[ORYONFP1]> {
let Latency = 4;
let ReleaseAtCycles = [4];
}
// 5 cycle , 1 throughput on FP1
def ORYONWrite_5Cyc_FP1 : SchedWriteRes<[ORYONFP1]> {
let Latency = 5;
}
// 8 cycle , 2 throughput on FP0123
def ORYONWrite_8Cyc_FP0123_RC : SchedWriteRes<[ORYONFP0123]> {
let Latency = 8;
let ReleaseAtCycles = [2];
}
def ORYONWrite_6Cyc_FP3 : SchedWriteRes<[ORYONFP3]> {
let Latency = 6;
}
def ORYONWrite_7Cyc_FP3 : SchedWriteRes<[ORYONFP3]> {
let Latency = 7;
}
def ORYONWrite_8Cyc_FP3 : SchedWriteRes<[ORYONFP3]> {
let Latency = 8;
}
def ORYONWrite_9Cyc_FP3 : SchedWriteRes<[ORYONFP3]> {
let Latency = 9;
}
def ORYONWrite_10Cyc_FP3 : SchedWriteRes<[ORYONFP3]> {
let Latency = 10;
}
def ORYONWrite_8Cyc_FP3_RC : SchedWriteRes<[ORYONFP3]> {
let Latency = 8;
let ReleaseAtCycles = [2];
}
def ORYONWrite_10Cyc_FP3_RC : SchedWriteRes<[ORYONFP3]> {
let Latency = 10;
let ReleaseAtCycles = [2];
}
def ORYONWrite_13Cyc_FP3_RC : SchedWriteRes<[ORYONFP3]> {
let Latency = 13;
let ReleaseAtCycles = [2];
}
def ORYONWrite_4Cyc_FP0123_RC :
SchedWriteRes<[ORYONFP0123]> {
let Latency = 4;
let ReleaseAtCycles = [2];
}
def ORYONWrite_4Cyc_FP0123_FP0123_RC :
SchedWriteRes<[ORYONFP0123, ORYONFP0123]> {
let Latency = 4;
let NumMicroOps = 2;
let ReleaseAtCycles = [2,2];
}
def ORYONWrite_4Cyc_FP0123_FP0123_FP0123_RC :
SchedWriteRes<[ORYONFP0123, ORYONFP0123, ORYONFP0123]> {
let Latency = 4;
let NumMicroOps = 3;
let ReleaseAtCycles = [3,3,3];
}
def ORYONWrite_6Cyc_FP0123_FP0123_FP0123_FP0123_RC :
SchedWriteRes<[ORYONFP0123, ORYONFP0123, ORYONFP0123, ORYONFP0123]> {
let Latency = 6;
let NumMicroOps = 4;
let ReleaseAtCycles = [6,6,6,6];
}
//===----------------------------------------------------------------------===//
// Instruction Tables in IXU
//===----------------------------------------------------------------------===//
//---
// Arithmetic Instructions
//---
// Table on P74
//=============
//1, 1, 6
def : InstRW<[ORYONWrite_1Cyc_I012345],
(instregex "^ADD(W|X)r(i|r|x)", "^SUB(W|X)r(i|r|x)")>;
//2,2,3
def : InstRW<[ORYONWrite_2Cyc_I012345_I012345_RC],
(instregex "^ADD(W|X)rs", "^SUB(W|X)rs")>;
//1,1,4 alias CMP, CMN on page 75
def : InstRW<[ORYONWrite_1Cyc_I0123],
(instregex "^ADDS(W|X)r(i|r|x)(64)?", "^SUBS(W|X)r(i|r|x)")>;
//2,2,2 alias CMP, CMN on page 75
def : InstRW<[ORYONWrite_2Cyc_I0123_I0123_RC],
(instregex "^ADDS(W|X)rs", "^SUBS(W|X)rs")>;
//1,1,4
def : InstRW<[ORYONWrite_1Cyc_I0123],
(instregex "^ADC(W|X)r","^SBC(W|X)r",
"^ADCS(W|X)r","^SBCS(W|X)r")>;
//1,1,2
def : InstRW<[ORYONWrite_1Cyc_2Uops_I01],
(instrs ADR,ADRP)>;
//1,1,4
def : InstRW<[ORYONWrite_1Cyc_I0123],
(instregex "^CSEL(W|X)r", "^CSINV(W|X)r",
"^CSNEG(W|X)r", "^CSINC(W|X)r")>;
//---
//Compare Instruciton
//---
// Table on P75
//=============
// We have CCMP, CCMN as LLVM DAG node
// CMP is an alias of SUBS as above
// CMN is an alias of ADDS as above
// We also have no way to get shift compare node in LLVM
//2,2,1.5 CMP, CMN
//1,1,4
def : InstRW<[ORYONWrite_1Cyc_I0123],
(instregex "^CCMP(W|X)(i|r)", "^CCMN(W|X)(i|r)")>;
//---
// Branch
//---
// Table on P76
//=============
def : InstRW<[ORYONWrite_1Cyc_NONE], (instrs B)>;
def : InstRW<[ORYONWrite_1Cyc_I01], (instrs BL)>;
def : InstRW<[ORYONWrite_1Cyc_I01],
(instrs Bcc, CBZW, CBZX, CBNZW, CBNZX, TBZW, TBZX, TBNZW, TBNZX)>;
def : InstRW<[ORYONWrite_1Cyc_I0], (instrs BR, BLR)>;
def : InstRW<[ORYONWrite_1Cyc_I0], (instrs RET)>;
// Table on p47/p76
// 3 uOp, 1 cycle for branch, 7 cycle for Authentication,
// 1 cycle for updating link register
// V8.3a PAC
def : InstRW<[ORYONWrite_9Cyc_I012],
(instrs BLRAA, BLRAAZ, BLRAB, BLRABZ,
BRAA, BRAAZ, BRAB, BRABZ)>;
def : InstRW<[ORYONWrite_9Cyc_I012], (instrs RETAA, RETAB, ERETAA, ERETAB)>;
// we temporarily put it here. It needs fix.
// should LSU get involved? Need check?
// Should be a combined additive value of load and pauth
def : InstRW<[ORYONWrite_7Cyc_3Uops_I2], (instregex "^LDRAA", "^LDRAB")>;
// Logical Instructions
//---
// Table on P77
//=============
//1,1,4 TST is an alias of ANDS
def : InstRW<[ORYONWrite_1Cyc_I0123],
(instregex "^ANDS(W|X)r(i|r|x)", "^BICS(W|X)r(i|r|x)")>;
//2,2,2 TST shift is an alias
def : InstRW<[ORYONWrite_2Cyc_I0123_I0123_RC],
(instregex "^ANDS(W|X)rs", "^BICS(W|X)rs")>;
//1,1,6
def : InstRW<[ORYONWrite_1Cyc_I012345],
(instregex "^AND(W|X)r(i|r|x)", "^EOR(W|X)r(i|r|x)",
"^ORR(W|X)r(i|r|x)", "^BIC(W|X)r(i|r|x)",
"^EON(W|X)r(i|r|x)", "^ORN(W|X)r(i|r|x)")>;
//2,2,3
def : InstRW<[ORYONWrite_2Cyc_I012345_I012345_RC],
(instregex "^AND(W|X)rs", "^EOR(W|X)rs", "^ORR(W|X)rs",
"^BIC(W|X)rs", "^EON(W|X)rs", "^ORN(W|X)rs")>;
//---
// Shift Instructions
//---
// Table on P78
//=============
//1,1,6
def : InstRW<[ORYONWrite_1Cyc_I012345],
(instregex "^ASRV(W|X)r", "^LSLV(W|X)r",
"^LSRV(W|X)r", "^RORV(W|X)r",
"RMIF")>;
//---
// Move-Data Bit-field and Sign_Extension Instructions
//---
// Table on P78
//=============
//1,1,6
def : InstRW<[ORYONWrite_1Cyc_I012345],
(instregex "^MOVK(W|X)i", "^MOVN(W|X)i",
"^MOVZ(W|X)i", "^SBFM(W|X)ri",
"^UBFM(W|X)ri", "^BFM(W|X)ri",
"^SXT(W|B|H|X)", "^UXT(H|B)")>;
// COPY instruction is an LLVM internal DAG node, needs further study
def : InstRW<[ORYONWrite_1Cyc_I012345], (instrs COPY)>;
//---
// Reverse Instructions
//---
// Table on P79
//=============
//1,1,6
def : InstRW<[ORYONWrite_1Cyc_I012345],
(instregex "^RBIT(W|X)r", "^REV(16|32|64)?(W|X)r")>;
//---
// Flag Manipulate Instructions
//---
// Table on P79
//=============
//1,1,4
def : InstRW<[ORYONWrite_1Cyc_I0123],
(instregex "^SETF8", "^SETF16", "^CFINV")>;
//---
// Miscellaneous Instructions
//---
// Table on P80
//=============
//1,1,6
def : InstRW<[ORYONWrite_1Cyc_I012345],
(instregex "^CLS(W|X)r$", "^CLZ(W|X)r$", "^EXTR(W|X)rri")>;
//---
// Multiply Instructions
//---
// Table on P81
//=============
//1,3,2
def : InstRW<[ORYONWrite_3Cyc_I45],
(instregex "^MADD(W|X)rrr", "^MSUB(W|X)rrr",
"^(S|U)MADDLrrr", "^(S|U)MSUBLrrr",
"^(S|U)MULHrr")>;
//---
// Divide Instructions
//---
// Table on P81
//=============
def : InstRW<[ORYONWrite_7Cyc_I2_RC],
(instregex "^(S|U)DIVWr")>;
def : InstRW<[ORYONWrite_9Cyc_I2_RC],
(instregex "^(S|U)DIVXr")>;
//---
// Cryptgraphy Instructions
//
//1,3,1 on I2
def : InstRW<[ORYONWrite_3Cyc_I2],
(instregex "^CRC32(B|H|W|X)rr", "^CRC32C(B|H|W|X)rr")>;
//---
// PAU instructions
//---
// on p47 of IXU document, we have 7 cycles for all PAU instructions
// here we just assume all signing and pauth instructions are 7 cycles
// assume all are 7 cycles here
// signing instrucitons
def : InstRW<[ORYONWrite_7Cyc_I2], (instrs PACIA, PACIB,
PACDA, PACDB,
PACIZA, PACIZB,
PACDZA, PACDZB,
PACGA)>;
// authentication instrucitons
def : InstRW<[ORYONWrite_7Cyc_I2], (instrs AUTIA, AUTIB,
AUTDA, AUTDB,
AUTIZA, AUTIZB,
AUTDZA, AUTDZB)>;
def : InstRW<[ORYONWrite_7Cyc_I2], (instrs XPACI, XPACD)>;
//===----------------------------------------------------------------------===//
// Instruction Tables in LSU
//===----------------------------------------------------------------------===//
// 4 cycle Load-to-use from L1D$
// Neon load with 5 cycle
// 6 cycle to STA ?
// STD cycle ?
// NEON STD + 2
// Load Instructions
// FP Load Instructions
// Load pair, immed pre-index, normal
// Load pair, immed pre-index, signed words
// Load pair, immed post-index, normal
// Load pair, immed post-index, signed words
// NOTE: Handled by WriteLD, WriteLDHi, WriteAdr.
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDNPDi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDNPQi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDNPSi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDNPWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDNPXi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDPDi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDPQi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDPSi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDPSWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDPWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDPXi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRBui)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRDui)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRHui)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRQui)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRSui)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRDl)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRQl)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRWl)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDRXl)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRBi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRHi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRXi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRSBWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRSBXi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRSHWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRSHXi)>;
def : InstRW<[ORYONWrite_4Cyc_LD], (instrs LDTRSWi)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPDpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPQpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPSpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPWpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRBpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRDpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRHpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRQpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRWpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRXpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSBWpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSBXpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSBWpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSBXpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSHWpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSHXpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSHWpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRSHXpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRBBpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRBBpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRHHpre)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345], (instrs LDRHHpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPDpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPQpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPSpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],
(instrs LDPWpost)>;
def : InstRW<[ORYONWrite_4Cyc_LD_I012345],