]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/lib/Target/AArch64/AArch64SchedFalkor.td
Merge ^/head r317808 through r317970.
[FreeBSD/FreeBSD.git] / contrib / llvm / lib / Target / AArch64 / AArch64SchedFalkor.td
1 //==- AArch64SchedFalkor.td - Falkor Scheduling Definitions -*- 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 //
10 // This file defines the machine model for Qualcomm Falkor to support
11 // instruction scheduling and other instruction cost heuristics.
12 //
13 //===----------------------------------------------------------------------===//
14
15 //===----------------------------------------------------------------------===//
16 // Define the SchedMachineModel and provide basic properties for coarse grained
17 // instruction cost model.
18
19 def FalkorModel : SchedMachineModel {
20   let IssueWidth = 8;          // 8 uops are dispatched per cycle.
21   let MicroOpBufferSize = 128; // Out-of-order with temporary unified issue buffer.
22   let LoopMicroOpBufferSize = 16;
23   let LoadLatency = 3;         // Optimistic load latency.
24   let MispredictPenalty = 11;  // Minimum branch misprediction penalty.
25   let CompleteModel = 1;
26 }
27
28 //===----------------------------------------------------------------------===//
29 // Define each kind of processor resource and number available on Falkor.
30
31 let SchedModel = FalkorModel in {
32
33   def FalkorUnitB    : ProcResource<1>; // Branch
34   def FalkorUnitLD   : ProcResource<1>; // Load pipe
35   def FalkorUnitSD   : ProcResource<1>; // Store data
36   def FalkorUnitST   : ProcResource<1>; // Store pipe
37   def FalkorUnitX    : ProcResource<1>; // Complex arithmetic
38   def FalkorUnitY    : ProcResource<1>; // Simple arithmetic
39   def FalkorUnitZ    : ProcResource<1>; // Simple arithmetic
40
41   def FalkorUnitVSD  : ProcResource<1>; // Vector store data
42   def FalkorUnitVX   : ProcResource<1>; // Vector X-pipe
43   def FalkorUnitVY   : ProcResource<1>; // Vector Y-pipe
44
45   def FalkorUnitGTOV : ProcResource<1>; // Scalar to Vector
46   def FalkorUnitVTOG : ProcResource<1>; // Vector to Scalar
47
48   // Define the resource groups.
49   def FalkorUnitXY   : ProcResGroup<[FalkorUnitX, FalkorUnitY]>;
50   def FalkorUnitXYZ  : ProcResGroup<[FalkorUnitX, FalkorUnitY, FalkorUnitZ]>;
51   def FalkorUnitXYZB : ProcResGroup<[FalkorUnitX, FalkorUnitY, FalkorUnitZ,
52                                      FalkorUnitB]>;
53   def FalkorUnitZB   : ProcResGroup<[FalkorUnitZ, FalkorUnitB]>;
54   def FalkorUnitVXVY : ProcResGroup<[FalkorUnitVX, FalkorUnitVY]>;
55
56 }
57
58 //===----------------------------------------------------------------------===//
59 // Map the target-defined scheduler read/write resources and latency for
60 // Falkor.
61
62 let SchedModel = FalkorModel in {
63
64 def : WriteRes<WriteImm,   [FalkorUnitXYZ]> { let Latency = 1; }
65 def : WriteRes<WriteI,     [FalkorUnitXYZ]> { let Latency = 1; }
66 def : WriteRes<WriteISReg, [FalkorUnitVXVY, FalkorUnitVXVY]>
67       { let Latency = 1; let NumMicroOps = 2; }
68 def : WriteRes<WriteIEReg, [FalkorUnitXYZ, FalkorUnitXYZ]>
69       { let Latency = 2; let NumMicroOps = 2; }
70 def : WriteRes<WriteExtr,  [FalkorUnitXYZ, FalkorUnitXYZ]>
71       { let Latency = 2; let NumMicroOps = 2; }
72 def : WriteRes<WriteIS,    [FalkorUnitXYZ]> { let Latency = 1; }
73 def : WriteRes<WriteID32,  [FalkorUnitX, FalkorUnitZ]>
74       { let Latency = 8; let NumMicroOps = 2; }
75 def : WriteRes<WriteID64,  [FalkorUnitX, FalkorUnitZ]>
76       { let Latency = 16; let NumMicroOps = 2; }
77 def : WriteRes<WriteIM32,  [FalkorUnitX]> { let Latency = 4; }
78 def : WriteRes<WriteIM64,  [FalkorUnitX]> { let Latency = 5; }
79 def : WriteRes<WriteBr,    [FalkorUnitB]> { let Latency = 1; }
80 def : WriteRes<WriteBrReg, [FalkorUnitB]> { let Latency = 1; }
81 def : WriteRes<WriteLD,    [FalkorUnitLD]> { let Latency = 3; }
82 def : WriteRes<WriteST,    [FalkorUnitST, FalkorUnitSD]>
83       { let Latency = 0; let NumMicroOps = 2; }
84 def : WriteRes<WriteSTP,   [FalkorUnitST, FalkorUnitSD]>
85       { let Latency = 0; let NumMicroOps = 2; }
86 def : WriteRes<WriteAdr,   [FalkorUnitXYZ]> { let Latency = 1; }
87 def : WriteRes<WriteLDIdx, [FalkorUnitLD]> { let Latency = 5; }
88 def : WriteRes<WriteSTIdx, [FalkorUnitST, FalkorUnitSD]>
89       { let Latency = 0; let NumMicroOps = 2; }
90 def : WriteRes<WriteF,     [FalkorUnitVXVY, FalkorUnitVXVY]>
91       { let Latency = 3; let NumMicroOps = 2; }
92 def : WriteRes<WriteFCmp,  [FalkorUnitVXVY]> { let Latency = 2; }
93 def : WriteRes<WriteFCvt,  [FalkorUnitVXVY]> { let Latency = 4; }
94 def : WriteRes<WriteFCopy, [FalkorUnitVXVY]> { let Latency = 4; }
95 def : WriteRes<WriteFImm,  [FalkorUnitVXVY]> { let Latency = 4; }
96 def : WriteRes<WriteFMul,  [FalkorUnitVXVY, FalkorUnitVXVY]>
97       { let Latency = 6; let NumMicroOps = 2; }
98 def : WriteRes<WriteFDiv,  [FalkorUnitVXVY, FalkorUnitVXVY]>
99       { let Latency = 12; let NumMicroOps = 2; } // Fragent -1 / NoRSV +1
100 def : WriteRes<WriteV,     [FalkorUnitVXVY]> { let Latency = 6; }
101 def : WriteRes<WriteVLD,   [FalkorUnitLD]> { let Latency = 3; }
102 def : WriteRes<WriteVST,   [FalkorUnitST, FalkorUnitVSD]>
103       { let Latency = 0; let NumMicroOps = 2; }
104
105 def : WriteRes<WriteSys,     []> { let Latency = 1; }
106 def : WriteRes<WriteBarrier, []> { let Latency = 1; }
107 def : WriteRes<WriteHint,    []> { let Latency = 1; }
108
109 def : WriteRes<WriteLDHi,    []> { let Latency = 3; }
110
111 def : WriteRes<WriteAtomic, []> { let Unsupported = 1; }
112
113 // No forwarding logic is modelled yet.
114 def : ReadAdvance<ReadI,       0>;
115 def : ReadAdvance<ReadISReg,   0>;
116 def : ReadAdvance<ReadIEReg,   0>;
117 def : ReadAdvance<ReadIM,      0>;
118 def : ReadAdvance<ReadIMA,     0>;
119 def : ReadAdvance<ReadID,      0>;
120 def : ReadAdvance<ReadExtrHi,  0>;
121 def : ReadAdvance<ReadAdrBase, 0>;
122 def : ReadAdvance<ReadVLD,     0>;
123
124 // Detailed Refinements
125 // -----------------------------------------------------------------------------
126 include "AArch64SchedFalkorDetails.td"
127
128 }