xref: /freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCScheduleA2.td (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric//===- PPCScheduleA2.td - PPC A2 Scheduling Definitions --*- tablegen -*-===//
2*0b57cec5SDimitry Andric//
3*0b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric//
7*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric
9*0b57cec5SDimitry Andric// Primary reference:
10*0b57cec5SDimitry Andric// A2 Processor User's Manual.
11*0b57cec5SDimitry Andric// IBM (as updated in) 2010.
12*0b57cec5SDimitry Andric
13*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
14*0b57cec5SDimitry Andric// Functional units on the PowerPC A2 chip sets
15*0b57cec5SDimitry Andric//
16*0b57cec5SDimitry Andricdef A2_XU     : FuncUnit; // A2_XU pipeline
17*0b57cec5SDimitry Andricdef A2_FU     : FuncUnit; // FI pipeline
18*0b57cec5SDimitry Andric
19*0b57cec5SDimitry Andric//
20*0b57cec5SDimitry Andric// This file defines the itinerary class data for the PPC A2 processor.
21*0b57cec5SDimitry Andric//
22*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
23*0b57cec5SDimitry Andric
24*0b57cec5SDimitry Andric
25*0b57cec5SDimitry Andricdef PPCA2Itineraries : ProcessorItineraries<
26*0b57cec5SDimitry Andric  [A2_XU, A2_FU], [], [
27*0b57cec5SDimitry Andric  InstrItinData<IIC_IntSimple,   [InstrStage<1, [A2_XU]>],
28*0b57cec5SDimitry Andric                                 [1, 0, 0]>,
29*0b57cec5SDimitry Andric  InstrItinData<IIC_IntGeneral,  [InstrStage<1, [A2_XU]>],
30*0b57cec5SDimitry Andric                                 [2, 0, 0]>,
31*0b57cec5SDimitry Andric  InstrItinData<IIC_IntISEL,     [InstrStage<1, [A2_XU]>],
32*0b57cec5SDimitry Andric                                 [2, 0, 0, 0]>,
33*0b57cec5SDimitry Andric  InstrItinData<IIC_IntCompare,  [InstrStage<1, [A2_XU]>],
34*0b57cec5SDimitry Andric                                 [2, 0, 0]>,
35*0b57cec5SDimitry Andric  InstrItinData<IIC_IntDivW,     [InstrStage<1, [A2_XU]>],
36*0b57cec5SDimitry Andric                                 [39, 0, 0]>,
37*0b57cec5SDimitry Andric  InstrItinData<IIC_IntDivD,     [InstrStage<1, [A2_XU]>],
38*0b57cec5SDimitry Andric                                 [71, 0, 0]>,
39*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulHW,    [InstrStage<1, [A2_XU]>],
40*0b57cec5SDimitry Andric                                 [5, 0, 0]>,
41*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulHWU,   [InstrStage<1, [A2_XU]>],
42*0b57cec5SDimitry Andric                                 [5, 0, 0]>,
43*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulLI,    [InstrStage<1, [A2_XU]>],
44*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
45*0b57cec5SDimitry Andric  InstrItinData<IIC_IntRotate,   [InstrStage<1, [A2_XU]>],
46*0b57cec5SDimitry Andric                                 [2, 0, 0]>,
47*0b57cec5SDimitry Andric  InstrItinData<IIC_IntRotateD,  [InstrStage<1, [A2_XU]>],
48*0b57cec5SDimitry Andric                                 [2, 0, 0]>,
49*0b57cec5SDimitry Andric  InstrItinData<IIC_IntRotateDI, [InstrStage<1, [A2_XU]>],
50*0b57cec5SDimitry Andric                                 [2, 0, 0]>,
51*0b57cec5SDimitry Andric  InstrItinData<IIC_IntShift,    [InstrStage<1, [A2_XU]>],
52*0b57cec5SDimitry Andric                                 [2, 0, 0]>,
53*0b57cec5SDimitry Andric  InstrItinData<IIC_IntTrapW,    [InstrStage<1, [A2_XU]>],
54*0b57cec5SDimitry Andric                                 [2, 0]>,
55*0b57cec5SDimitry Andric  InstrItinData<IIC_IntTrapD,    [InstrStage<1, [A2_XU]>],
56*0b57cec5SDimitry Andric                                 [2, 0]>,
57*0b57cec5SDimitry Andric  InstrItinData<IIC_BrB,         [InstrStage<1, [A2_XU]>],
58*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
59*0b57cec5SDimitry Andric  InstrItinData<IIC_BrCR,        [InstrStage<1, [A2_XU]>],
60*0b57cec5SDimitry Andric                                 [1, 0, 0]>,
61*0b57cec5SDimitry Andric  InstrItinData<IIC_BrMCR,       [InstrStage<1, [A2_XU]>],
62*0b57cec5SDimitry Andric                                 [5, 0, 0]>,
63*0b57cec5SDimitry Andric  InstrItinData<IIC_BrMCRX,      [InstrStage<1, [A2_XU]>],
64*0b57cec5SDimitry Andric                                 [1, 0, 0]>,
65*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStDCBA,    [InstrStage<1, [A2_XU]>],
66*0b57cec5SDimitry Andric                                 [1, 0, 0]>,
67*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStDCBF,    [InstrStage<1, [A2_XU]>],
68*0b57cec5SDimitry Andric                                 [1, 0, 0]>,
69*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStDCBI,    [InstrStage<1, [A2_XU]>],
70*0b57cec5SDimitry Andric                                 [1, 0, 0]>,
71*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLoad,    [InstrStage<1, [A2_XU]>],
72*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
73*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLoadUpd, [InstrStage<1, [A2_XU]>],
74*0b57cec5SDimitry Andric                                 [6, 8, 0, 0]>,
75*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLoadUpdX,[InstrStage<1, [A2_XU]>],
76*0b57cec5SDimitry Andric                                 [6, 8, 0, 0]>,
77*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLDU,     [InstrStage<1, [A2_XU]>],
78*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
79*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLDUX,    [InstrStage<1, [A2_XU]>],
80*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
81*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStStore,   [InstrStage<1, [A2_XU]>],
82*0b57cec5SDimitry Andric                                 [0, 0, 0]>,
83*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStICBI,    [InstrStage<1, [A2_XU]>],
84*0b57cec5SDimitry Andric                                 [16, 0, 0]>,
85*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTFD,    [InstrStage<1, [A2_XU]>],
86*0b57cec5SDimitry Andric                                 [0, 0, 0]>,
87*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTFDU,   [InstrStage<1, [A2_XU]>],
88*0b57cec5SDimitry Andric                                 [2, 0, 0, 0]>,
89*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLFD,     [InstrStage<1, [A2_XU]>],
90*0b57cec5SDimitry Andric                                 [7, 0, 0]>,
91*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLFDU,    [InstrStage<1, [A2_XU]>],
92*0b57cec5SDimitry Andric                                 [7, 9, 0, 0]>,
93*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLFDUX,   [InstrStage<1, [A2_XU]>],
94*0b57cec5SDimitry Andric                                 [7, 9, 0, 0]>,
95*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLHA,     [InstrStage<1, [A2_XU]>],
96*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
97*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLHAU,    [InstrStage<1, [A2_XU]>],
98*0b57cec5SDimitry Andric                                 [6, 8, 0, 0]>,
99*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLHAUX,   [InstrStage<1, [A2_XU]>],
100*0b57cec5SDimitry Andric                                 [6, 8, 0, 0]>,
101*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLWARX,   [InstrStage<1, [A2_XU]>],
102*0b57cec5SDimitry Andric                                 [82, 0, 0]>, // L2 latency
103*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTD,     [InstrStage<1, [A2_XU]>],
104*0b57cec5SDimitry Andric                                 [0, 0, 0]>,
105*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTU,     [InstrStage<1, [A2_XU]>],
106*0b57cec5SDimitry Andric                                 [2, 0, 0, 0]>,
107*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTUX,    [InstrStage<1, [A2_XU]>],
108*0b57cec5SDimitry Andric                                 [2, 0, 0, 0]>,
109*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTDCX,   [InstrStage<1, [A2_XU]>],
110*0b57cec5SDimitry Andric                                 [82, 0, 0]>, // L2 latency
111*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTWCX,   [InstrStage<1, [A2_XU]>],
112*0b57cec5SDimitry Andric                                 [82, 0, 0]>, // L2 latency
113*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSync,    [InstrStage<1, [A2_XU]>],
114*0b57cec5SDimitry Andric                                 [6]>,
115*0b57cec5SDimitry Andric  InstrItinData<IIC_SprISYNC,    [InstrStage<1, [A2_XU]>],
116*0b57cec5SDimitry Andric                                 [16]>,
117*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMTMSR,    [InstrStage<1, [A2_XU]>],
118*0b57cec5SDimitry Andric                                 [16, 0]>,
119*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFCR,     [InstrStage<1, [A2_XU]>],
120*0b57cec5SDimitry Andric                                 [6, 0]>,
121*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFCRF,    [InstrStage<1, [A2_XU]>],
122*0b57cec5SDimitry Andric                                 [1, 0]>,
123*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFMSR,    [InstrStage<1, [A2_XU]>],
124*0b57cec5SDimitry Andric                                 [4, 0]>,
125*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFSPR,    [InstrStage<1, [A2_XU]>],
126*0b57cec5SDimitry Andric                                 [6, 0]>,
127*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFTB,     [InstrStage<1, [A2_XU]>],
128*0b57cec5SDimitry Andric                                 [4, 0]>,
129*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMTSPR,    [InstrStage<1, [A2_XU]>],
130*0b57cec5SDimitry Andric                                 [6, 0]>,
131*0b57cec5SDimitry Andric  InstrItinData<IIC_SprRFI,      [InstrStage<1, [A2_XU]>],
132*0b57cec5SDimitry Andric                                 [16]>,
133*0b57cec5SDimitry Andric  InstrItinData<IIC_SprSC,       [InstrStage<1, [A2_XU]>],
134*0b57cec5SDimitry Andric                                 [16]>,
135*0b57cec5SDimitry Andric  InstrItinData<IIC_FPGeneral,   [InstrStage<1, [A2_FU]>],
136*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
137*0b57cec5SDimitry Andric  InstrItinData<IIC_FPAddSub,    [InstrStage<1, [A2_FU]>],
138*0b57cec5SDimitry Andric                                 [6, 0, 0]>,
139*0b57cec5SDimitry Andric  InstrItinData<IIC_FPCompare,   [InstrStage<1, [A2_FU]>],
140*0b57cec5SDimitry Andric                                 [5, 0, 0]>,
141*0b57cec5SDimitry Andric  InstrItinData<IIC_FPDivD,      [InstrStage<1, [A2_FU]>],
142*0b57cec5SDimitry Andric                                 [72, 0, 0]>,
143*0b57cec5SDimitry Andric  InstrItinData<IIC_FPDivS,      [InstrStage<1, [A2_FU]>],
144*0b57cec5SDimitry Andric                                 [59, 0, 0]>,
145*0b57cec5SDimitry Andric  InstrItinData<IIC_FPSqrtD,     [InstrStage<1, [A2_FU]>],
146*0b57cec5SDimitry Andric                                 [69, 0, 0]>,
147*0b57cec5SDimitry Andric  InstrItinData<IIC_FPSqrtS,     [InstrStage<1, [A2_FU]>],
148*0b57cec5SDimitry Andric                                 [65, 0, 0]>,
149*0b57cec5SDimitry Andric  InstrItinData<IIC_FPFused,     [InstrStage<1, [A2_FU]>],
150*0b57cec5SDimitry Andric                                 [6, 0, 0, 0]>,
151*0b57cec5SDimitry Andric  InstrItinData<IIC_FPRes,       [InstrStage<1, [A2_FU]>],
152*0b57cec5SDimitry Andric                                 [6, 0]>
153*0b57cec5SDimitry Andric]>;
154*0b57cec5SDimitry Andric
155*0b57cec5SDimitry Andric// ===---------------------------------------------------------------------===//
156*0b57cec5SDimitry Andric// A2 machine model for scheduling and other instruction cost heuristics.
157*0b57cec5SDimitry Andric
158*0b57cec5SDimitry Andricdef PPCA2Model : SchedMachineModel {
159*0b57cec5SDimitry Andric  let IssueWidth = 1;  // 1 instruction is dispatched per cycle.
160*0b57cec5SDimitry Andric  let LoadLatency = 6; // Optimistic load latency assuming bypass.
161*0b57cec5SDimitry Andric                       // This is overriden by OperandCycles if the
162*0b57cec5SDimitry Andric                       // Itineraries are queried instead.
163*0b57cec5SDimitry Andric  let MispredictPenalty = 13;
164*0b57cec5SDimitry Andric
165*0b57cec5SDimitry Andric  let CompleteModel = 0;
166*0b57cec5SDimitry Andric
167*0b57cec5SDimitry Andric  let Itineraries = PPCA2Itineraries;
168*0b57cec5SDimitry Andric}
169*0b57cec5SDimitry Andric
170