1 //==- AArch64SchedFalkor.td - Falkor Scheduling Definitions -*- tablegen -*-==//
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
7 //===----------------------------------------------------------------------===//
9 // This file defines the machine model for Qualcomm Falkor to support
10 // instruction scheduling and other instruction cost heuristics.
12 //===----------------------------------------------------------------------===//
14 //===----------------------------------------------------------------------===//
15 // Define the SchedMachineModel and provide basic properties for coarse grained
16 // instruction cost model.
18 def FalkorModel : SchedMachineModel {
19 let IssueWidth = 8; // 8 uops are dispatched per cycle.
20 let MicroOpBufferSize = 128; // Out-of-order with temporary unified issue buffer.
21 let LoopMicroOpBufferSize = 16;
22 let LoadLatency = 3; // Optimistic load latency.
23 let MispredictPenalty = 11; // Minimum branch misprediction penalty.
24 let CompleteModel = 1;
26 list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
30 // FIXME: Remove when all errors have been fixed.
31 let FullInstRWOverlapCheck = 0;
34 //===----------------------------------------------------------------------===//
35 // Define each kind of processor resource and number available on Falkor.
37 let SchedModel = FalkorModel in {
39 def FalkorUnitB : ProcResource<1>; // Branch
40 def FalkorUnitLD : ProcResource<1>; // Load pipe
41 def FalkorUnitSD : ProcResource<1>; // Store data
42 def FalkorUnitST : ProcResource<1>; // Store pipe
43 def FalkorUnitX : ProcResource<1>; // Complex arithmetic
44 def FalkorUnitY : ProcResource<1>; // Simple arithmetic
45 def FalkorUnitZ : ProcResource<1>; // Simple arithmetic
47 def FalkorUnitVSD : ProcResource<1>; // Vector store data
48 def FalkorUnitVX : ProcResource<1>; // Vector X-pipe
49 def FalkorUnitVY : ProcResource<1>; // Vector Y-pipe
51 def FalkorUnitGTOV : ProcResource<1>; // Scalar to Vector
52 def FalkorUnitVTOG : ProcResource<1>; // Vector to Scalar
54 // Define the resource groups.
55 def FalkorUnitXY : ProcResGroup<[FalkorUnitX, FalkorUnitY]>;
56 def FalkorUnitXYZ : ProcResGroup<[FalkorUnitX, FalkorUnitY, FalkorUnitZ]>;
57 def FalkorUnitXYZB : ProcResGroup<[FalkorUnitX, FalkorUnitY, FalkorUnitZ,
59 def FalkorUnitZB : ProcResGroup<[FalkorUnitZ, FalkorUnitB]>;
60 def FalkorUnitVXVY : ProcResGroup<[FalkorUnitVX, FalkorUnitVY]>;
64 //===----------------------------------------------------------------------===//
65 // Map the target-defined scheduler read/write resources and latency for
68 let SchedModel = FalkorModel in {
70 // These WriteRes entries are not used in the Falkor sched model.
71 def : WriteRes<WriteImm, []> { let Unsupported = 1; }
72 def : WriteRes<WriteI, []> { let Unsupported = 1; }
73 def : WriteRes<WriteISReg, []> { let Unsupported = 1; }
74 def : WriteRes<WriteIEReg, []> { let Unsupported = 1; }
75 def : WriteRes<WriteExtr, []> { let Unsupported = 1; }
76 def : WriteRes<WriteIS, []> { let Unsupported = 1; }
77 def : WriteRes<WriteID32, []> { let Unsupported = 1; }
78 def : WriteRes<WriteID64, []> { let Unsupported = 1; }
79 def : WriteRes<WriteIM32, []> { let Unsupported = 1; }
80 def : WriteRes<WriteIM64, []> { let Unsupported = 1; }
81 def : WriteRes<WriteBr, []> { let Unsupported = 1; }
82 def : WriteRes<WriteBrReg, []> { let Unsupported = 1; }
83 def : WriteRes<WriteLD, []> { let Unsupported = 1; }
84 def : WriteRes<WriteST, []> { let Unsupported = 1; }
85 def : WriteRes<WriteSTP, []> { let Unsupported = 1; }
86 def : WriteRes<WriteAdr, []> { let Unsupported = 1; }
87 def : WriteRes<WriteLDIdx, []> { let Unsupported = 1; }
88 def : WriteRes<WriteSTIdx, []> { let Unsupported = 1; }
89 def : WriteRes<WriteF, []> { let Unsupported = 1; }
90 def : WriteRes<WriteFCmp, []> { let Unsupported = 1; }
91 def : WriteRes<WriteFCvt, []> { let Unsupported = 1; }
92 def : WriteRes<WriteFCopy, []> { let Unsupported = 1; }
93 def : WriteRes<WriteFImm, []> { let Unsupported = 1; }
94 def : WriteRes<WriteFMul, []> { let Unsupported = 1; }
95 def : WriteRes<WriteFDiv, []> { let Unsupported = 1; }
96 def : WriteRes<WriteVd, []> { let Unsupported = 1; }
97 def : WriteRes<WriteVq, []> { let Unsupported = 1; }
98 def : WriteRes<WriteVLD, []> { let Unsupported = 1; }
99 def : WriteRes<WriteVST, []> { let Unsupported = 1; }
100 def : WriteRes<WriteSys, []> { let Unsupported = 1; }
101 def : WriteRes<WriteBarrier, []> { let Unsupported = 1; }
102 def : WriteRes<WriteHint, []> { let Unsupported = 1; }
103 def : WriteRes<WriteLDHi, []> { let Unsupported = 1; }
104 def : WriteRes<WriteAtomic, []> { let Unsupported = 1; }
106 // These ReadAdvance entries are not used in the Falkor sched model.
107 def : ReadAdvance<ReadI, 0>;
108 def : ReadAdvance<ReadISReg, 0>;
109 def : ReadAdvance<ReadIEReg, 0>;
110 def : ReadAdvance<ReadIM, 0>;
111 def : ReadAdvance<ReadIMA, 0>;
112 def : ReadAdvance<ReadID, 0>;
113 def : ReadAdvance<ReadExtrHi, 0>;
114 def : ReadAdvance<ReadAdrBase, 0>;
115 def : ReadAdvance<ReadVLD, 0>;
116 def : ReadAdvance<ReadST, 0>;
118 // Detailed Refinements
119 // -----------------------------------------------------------------------------
120 include "AArch64SchedFalkorDetails.td"