xref: /freebsd/contrib/llvm-project/llvm/lib/Target/AArch64/AArch64SchedFalkor.td (revision 2dfa4b66b3d0caaaae6ce2df476b5615f8415a19)
1//==- AArch64SchedFalkor.td - Falkor Scheduling Definitions -*- 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 machine model for Qualcomm Falkor to support
10// instruction scheduling and other instruction cost heuristics.
11//
12//===----------------------------------------------------------------------===//
13
14//===----------------------------------------------------------------------===//
15// Define the SchedMachineModel and provide basic properties for coarse grained
16// instruction cost model.
17
18def 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;
25
26  list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
27                                                    PAUnsupported.F);
28  // FIXME: Remove when all errors have been fixed.
29  let FullInstRWOverlapCheck = 0;
30}
31
32//===----------------------------------------------------------------------===//
33// Define each kind of processor resource and number available on Falkor.
34
35let SchedModel = FalkorModel in {
36
37  def FalkorUnitB    : ProcResource<1>; // Branch
38  def FalkorUnitLD   : ProcResource<1>; // Load pipe
39  def FalkorUnitSD   : ProcResource<1>; // Store data
40  def FalkorUnitST   : ProcResource<1>; // Store pipe
41  def FalkorUnitX    : ProcResource<1>; // Complex arithmetic
42  def FalkorUnitY    : ProcResource<1>; // Simple arithmetic
43  def FalkorUnitZ    : ProcResource<1>; // Simple arithmetic
44
45  def FalkorUnitVSD  : ProcResource<1>; // Vector store data
46  def FalkorUnitVX   : ProcResource<1>; // Vector X-pipe
47  def FalkorUnitVY   : ProcResource<1>; // Vector Y-pipe
48
49  def FalkorUnitGTOV : ProcResource<1>; // Scalar to Vector
50  def FalkorUnitVTOG : ProcResource<1>; // Vector to Scalar
51
52  // Define the resource groups.
53  def FalkorUnitXY   : ProcResGroup<[FalkorUnitX, FalkorUnitY]>;
54  def FalkorUnitXYZ  : ProcResGroup<[FalkorUnitX, FalkorUnitY, FalkorUnitZ]>;
55  def FalkorUnitXYZB : ProcResGroup<[FalkorUnitX, FalkorUnitY, FalkorUnitZ,
56                                     FalkorUnitB]>;
57  def FalkorUnitZB   : ProcResGroup<[FalkorUnitZ, FalkorUnitB]>;
58  def FalkorUnitVXVY : ProcResGroup<[FalkorUnitVX, FalkorUnitVY]>;
59
60}
61
62//===----------------------------------------------------------------------===//
63// Map the target-defined scheduler read/write resources and latency for
64// Falkor.
65
66let SchedModel = FalkorModel in {
67
68// These WriteRes entries are not used in the Falkor sched model.
69def : WriteRes<WriteImm, []>     { let Unsupported = 1; }
70def : WriteRes<WriteI, []>       { let Unsupported = 1; }
71def : WriteRes<WriteISReg, []>   { let Unsupported = 1; }
72def : WriteRes<WriteIEReg, []>   { let Unsupported = 1; }
73def : WriteRes<WriteExtr, []>    { let Unsupported = 1; }
74def : WriteRes<WriteIS, []>      { let Unsupported = 1; }
75def : WriteRes<WriteID32, []>    { let Unsupported = 1; }
76def : WriteRes<WriteID64, []>    { let Unsupported = 1; }
77def : WriteRes<WriteIM32, []>    { let Unsupported = 1; }
78def : WriteRes<WriteIM64, []>    { let Unsupported = 1; }
79def : WriteRes<WriteBr, []>      { let Unsupported = 1; }
80def : WriteRes<WriteBrReg, []>   { let Unsupported = 1; }
81def : WriteRes<WriteLD, []>      { let Unsupported = 1; }
82def : WriteRes<WriteST, []>      { let Unsupported = 1; }
83def : WriteRes<WriteSTP, []>     { let Unsupported = 1; }
84def : WriteRes<WriteAdr, []>     { let Unsupported = 1; }
85def : WriteRes<WriteLDIdx, []>   { let Unsupported = 1; }
86def : WriteRes<WriteSTIdx, []>   { let Unsupported = 1; }
87def : WriteRes<WriteF, []>       { let Unsupported = 1; }
88def : WriteRes<WriteFCmp, []>    { let Unsupported = 1; }
89def : WriteRes<WriteFCvt, []>    { let Unsupported = 1; }
90def : WriteRes<WriteFCopy, []>   { let Unsupported = 1; }
91def : WriteRes<WriteFImm, []>    { let Unsupported = 1; }
92def : WriteRes<WriteFMul, []>    { let Unsupported = 1; }
93def : WriteRes<WriteFDiv, []>    { let Unsupported = 1; }
94def : WriteRes<WriteV, []>       { let Unsupported = 1; }
95def : WriteRes<WriteVLD, []>     { let Unsupported = 1; }
96def : WriteRes<WriteVST, []>     { let Unsupported = 1; }
97def : WriteRes<WriteSys, []>     { let Unsupported = 1; }
98def : WriteRes<WriteBarrier, []> { let Unsupported = 1; }
99def : WriteRes<WriteHint, []>    { let Unsupported = 1; }
100def : WriteRes<WriteLDHi, []>    { let Unsupported = 1; }
101def : WriteRes<WriteAtomic, []>  { let Unsupported = 1; }
102
103// These ReadAdvance entries are not used in the Falkor sched model.
104def : ReadAdvance<ReadI,       0>;
105def : ReadAdvance<ReadISReg,   0>;
106def : ReadAdvance<ReadIEReg,   0>;
107def : ReadAdvance<ReadIM,      0>;
108def : ReadAdvance<ReadIMA,     0>;
109def : ReadAdvance<ReadID,      0>;
110def : ReadAdvance<ReadExtrHi,  0>;
111def : ReadAdvance<ReadAdrBase, 0>;
112def : ReadAdvance<ReadVLD,     0>;
113
114// Detailed Refinements
115// -----------------------------------------------------------------------------
116include "AArch64SchedFalkorDetails.td"
117
118}
119