xref: /freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCScheduleP8.td (revision 0b57cec536236d46e3dba9bd041533462f33dbb7)
1*0b57cec5SDimitry Andric//===-- PPCScheduleP8.td - PPC P8 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// This file defines the itinerary class data for the POWER8 processor.
10*0b57cec5SDimitry Andric//
11*0b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
12*0b57cec5SDimitry Andric
13*0b57cec5SDimitry Andric// Scheduling for the P8 involves tracking two types of resources:
14*0b57cec5SDimitry Andric//  1. The dispatch bundle slots
15*0b57cec5SDimitry Andric//  2. The functional unit resources
16*0b57cec5SDimitry Andric
17*0b57cec5SDimitry Andric// Dispatch units:
18*0b57cec5SDimitry Andricdef P8_DU1    : FuncUnit;
19*0b57cec5SDimitry Andricdef P8_DU2    : FuncUnit;
20*0b57cec5SDimitry Andricdef P8_DU3    : FuncUnit;
21*0b57cec5SDimitry Andricdef P8_DU4    : FuncUnit;
22*0b57cec5SDimitry Andricdef P8_DU5    : FuncUnit;
23*0b57cec5SDimitry Andricdef P8_DU6    : FuncUnit;
24*0b57cec5SDimitry Andricdef P8_DU7    : FuncUnit; // Only branch instructions will use DU7,DU8
25*0b57cec5SDimitry Andricdef P8_DU8    : FuncUnit;
26*0b57cec5SDimitry Andric
27*0b57cec5SDimitry Andric// 10 insns per cycle (2-LU, 2-LSU, 2-FXU, 2-FPU, 1-CRU, 1-BRU).
28*0b57cec5SDimitry Andric
29*0b57cec5SDimitry Andricdef P8_LU1     : FuncUnit; // Loads or fixed-point operations 1
30*0b57cec5SDimitry Andricdef P8_LU2     : FuncUnit; // Loads or fixed-point operations 2
31*0b57cec5SDimitry Andric
32*0b57cec5SDimitry Andric// Load/Store pipelines can handle Stores, fixed-point loads, and simple
33*0b57cec5SDimitry Andric// fixed-point operations.
34*0b57cec5SDimitry Andricdef P8_LSU1    : FuncUnit; // Load/Store pipeline 1
35*0b57cec5SDimitry Andricdef P8_LSU2    : FuncUnit; // Load/Store pipeline 2
36*0b57cec5SDimitry Andric
37*0b57cec5SDimitry Andric// Fixed Point unit
38*0b57cec5SDimitry Andricdef P8_FXU1    : FuncUnit; // FX pipeline 1
39*0b57cec5SDimitry Andricdef P8_FXU2    : FuncUnit; // FX pipeline 2
40*0b57cec5SDimitry Andric
41*0b57cec5SDimitry Andric// The Floating-Point Unit (FPU) and Vector Media Extension (VMX) units
42*0b57cec5SDimitry Andric// are combined on P7 and newer into a Vector Scalar Unit (VSU).
43*0b57cec5SDimitry Andric// The P8 Instruction latency documents still refers to the unit as the
44*0b57cec5SDimitry Andric// FPU, so keep in mind that FPU==VSU.
45*0b57cec5SDimitry Andric// In contrast to the P7, the VMX units on P8 are symmetric, so no need to
46*0b57cec5SDimitry Andric// split vector integer ops or 128-bit load/store/perms to the specific units.
47*0b57cec5SDimitry Andricdef P8_FPU1    : FuncUnit; // VS pipeline 1
48*0b57cec5SDimitry Andricdef P8_FPU2    : FuncUnit; // VS pipeline 2
49*0b57cec5SDimitry Andric
50*0b57cec5SDimitry Andricdef P8_CRU    : FuncUnit; // CR unit (CR logicals and move-from-SPRs)
51*0b57cec5SDimitry Andricdef P8_BRU    : FuncUnit; // BR unit
52*0b57cec5SDimitry Andric
53*0b57cec5SDimitry Andricdef P8Itineraries : ProcessorItineraries<
54*0b57cec5SDimitry Andric  [P8_DU1, P8_DU2, P8_DU3, P8_DU4, P8_DU5, P8_DU6, P8_DU7, P8_DU8,
55*0b57cec5SDimitry Andric   P8_LU1, P8_LU2, P8_LSU1, P8_LSU2, P8_FXU1, P8_FXU2,
56*0b57cec5SDimitry Andric   P8_FPU1, P8_FPU2, P8_CRU, P8_BRU], [], [
57*0b57cec5SDimitry Andric  InstrItinData<IIC_IntSimple   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
58*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
59*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2,
60*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2,
61*0b57cec5SDimitry Andric                                                  P8_LSU1, P8_LSU2]>],
62*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
63*0b57cec5SDimitry Andric  InstrItinData<IIC_IntGeneral  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
64*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
65*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2, P8_LU1,
66*0b57cec5SDimitry Andric                                                  P8_LU2, P8_LSU1, P8_LSU2]>],
67*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
68*0b57cec5SDimitry Andric  InstrItinData<IIC_IntISEL,      [InstrStage<1, [P8_DU1], 0>,
69*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2], 0>,
70*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_BRU]>],
71*0b57cec5SDimitry Andric                                  [1, 1, 1, 1]>,
72*0b57cec5SDimitry Andric  InstrItinData<IIC_IntCompare  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
73*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
74*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
75*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
76*0b57cec5SDimitry Andric  InstrItinData<IIC_IntDivW     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
77*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
78*0b57cec5SDimitry Andric                                   InstrStage<15, [P8_FXU1, P8_FXU2]>],
79*0b57cec5SDimitry Andric                                  [15, 1, 1]>,
80*0b57cec5SDimitry Andric  InstrItinData<IIC_IntDivD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
81*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
82*0b57cec5SDimitry Andric                                   InstrStage<23, [P8_FXU1, P8_FXU2]>],
83*0b57cec5SDimitry Andric                                  [23, 1, 1]>,
84*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulHW    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
85*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
86*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
87*0b57cec5SDimitry Andric                                  [4, 1, 1]>,
88*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulHWU   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
89*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
90*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
91*0b57cec5SDimitry Andric                                  [4, 1, 1]>,
92*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulHD    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
93*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
94*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
95*0b57cec5SDimitry Andric                                  [4, 1, 1]>,
96*0b57cec5SDimitry Andric  InstrItinData<IIC_IntMulLI    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
97*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
98*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
99*0b57cec5SDimitry Andric                                  [4, 1, 1]>,
100*0b57cec5SDimitry Andric  InstrItinData<IIC_IntRotate   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
101*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
102*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
103*0b57cec5SDimitry Andric                                   [1, 1, 1]>,
104*0b57cec5SDimitry Andric  InstrItinData<IIC_IntRotateD  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
105*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
106*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
107*0b57cec5SDimitry Andric                                   [1, 1, 1]>,
108*0b57cec5SDimitry Andric  InstrItinData<IIC_IntRotateDI , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
109*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
110*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
111*0b57cec5SDimitry Andric                                   [1, 1, 1]>,
112*0b57cec5SDimitry Andric  InstrItinData<IIC_IntShift    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
113*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
114*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
115*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
116*0b57cec5SDimitry Andric  InstrItinData<IIC_IntTrapW    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
117*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
118*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
119*0b57cec5SDimitry Andric                                  [1, 1]>,
120*0b57cec5SDimitry Andric  InstrItinData<IIC_IntTrapD    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
121*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
122*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
123*0b57cec5SDimitry Andric                                  [1, 1]>,
124*0b57cec5SDimitry Andric  InstrItinData<IIC_BrB         , [InstrStage<1, [P8_DU7, P8_DU8], 0>,
125*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_BRU]>],
126*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
127*0b57cec5SDimitry Andric  // FIXME - the Br* groups below are not branch related, so should probably
128*0b57cec5SDimitry Andric  // be renamed.
129*0b57cec5SDimitry Andric  // IIC_BrCR consists of the cr* instructions.  (crand,crnor,creqv, etc).
130*0b57cec5SDimitry Andric  // and should be 'First' in dispatch.
131*0b57cec5SDimitry Andric  InstrItinData<IIC_BrCR        , [InstrStage<1, [P8_DU1], 0>,
132*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_CRU]>],
133*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
134*0b57cec5SDimitry Andric  // IIC_BrMCR consists of the mcrf instruction.
135*0b57cec5SDimitry Andric  InstrItinData<IIC_BrMCR       , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
136*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
137*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_CRU]>],
138*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
139*0b57cec5SDimitry Andric  // IIC_BrMCRX consists of mcrxr (obsolete instruction) and mtcrf, which
140*0b57cec5SDimitry Andric  // should be first in the dispatch group.
141*0b57cec5SDimitry Andric  InstrItinData<IIC_BrMCRX      , [InstrStage<1, [P8_DU1], 0>,
142*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
143*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
144*0b57cec5SDimitry Andric  InstrItinData<IIC_BrMCRX      , [InstrStage<1, [P8_DU1], 0>,
145*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
146*0b57cec5SDimitry Andric                                  [3, 1]>,
147*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLoad    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
148*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
149*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
150*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>],
151*0b57cec5SDimitry Andric                                  [2, 1, 1]>,
152*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLoadUpd , [InstrStage<1, [P8_DU1], 0>,
153*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
154*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
155*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2 ], 0>,
156*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
157*0b57cec5SDimitry Andric                                  [2, 2, 1, 1]>,
158*0b57cec5SDimitry Andric  // Update-Indexed form loads/stores are no longer first and last in the
159*0b57cec5SDimitry Andric  // dispatch group.  They are simply cracked, so require DU1,DU2.
160*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLoadUpdX, [InstrStage<1, [P8_DU1], 0>,
161*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
162*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
163*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2], 0>,
164*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
165*0b57cec5SDimitry Andric                                  [3, 3, 1, 1]>,
166*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLD      , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
167*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
168*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
169*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>],
170*0b57cec5SDimitry Andric                                  [2, 1, 1]>,
171*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLDU     , [InstrStage<1, [P8_DU1], 0>,
172*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
173*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
174*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2], 0>,
175*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
176*0b57cec5SDimitry Andric                                  [2, 2, 1, 1]>,
177*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLDUX    , [InstrStage<1, [P8_DU1], 0>,
178*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
179*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
180*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2], 0>,
181*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
182*0b57cec5SDimitry Andric                                  [3, 3, 1, 1]>,
183*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLFD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
184*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
185*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2]>],
186*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
187*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLVecX   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
188*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
189*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2]>],
190*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
191*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLFDU    , [InstrStage<1, [P8_DU1], 0>,
192*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
193*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2], 0>,
194*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
195*0b57cec5SDimitry Andric                                  [3, 3, 1, 1]>,
196*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLFDUX   , [InstrStage<1, [P8_DU1], 0>,
197*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
198*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2], 0>,
199*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
200*0b57cec5SDimitry Andric                                  [3, 3, 1, 1]>,
201*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLHA     , [InstrStage<1, [P8_DU1], 0>,
202*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
203*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
204*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2], 0>,
205*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2,
206*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>],
207*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
208*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLHAU    , [InstrStage<1, [P8_DU1], 0>,
209*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
210*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
211*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2], 0>,
212*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>,
213*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
214*0b57cec5SDimitry Andric                                  [4, 4, 1, 1]>,
215*0b57cec5SDimitry Andric  // first+last in dispatch group.
216*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLHAUX   , [InstrStage<1, [P8_DU1], 0>,
217*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
218*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU3], 0>,
219*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU4], 0>,
220*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU5], 0>,
221*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU6], 0>,
222*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
223*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2], 0>,
224*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>,
225*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
226*0b57cec5SDimitry Andric                                  [4, 4, 1, 1]>,
227*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLWA     , [InstrStage<1, [P8_DU1], 0>,
228*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
229*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
230*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>,
231*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
232*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
233*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLWARX,    [InstrStage<1, [P8_DU1], 0>,
234*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
235*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU3], 0>,
236*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU4], 0>,
237*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
238*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>],
239*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
240*0b57cec5SDimitry Andric  // first+last
241*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLDARX,    [InstrStage<1, [P8_DU1], 0>,
242*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
243*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU3], 0>,
244*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU4], 0>,
245*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU5], 0>,
246*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU6], 0>,
247*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
248*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>],
249*0b57cec5SDimitry Andric                                  [3, 1, 1]>,
250*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStLMW     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
251*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
252*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2,
253*0b57cec5SDimitry Andric                                                  P8_LU1, P8_LU2]>],
254*0b57cec5SDimitry Andric                                  [2, 1, 1]>,
255*0b57cec5SDimitry Andric// Stores are dual-issued from the issue queue, so may only take up one
256*0b57cec5SDimitry Andric// dispatch slot.  The instruction will be broken into two IOPS. The agen
257*0b57cec5SDimitry Andric// op is issued to the LSU, and the data op (register fetch) is issued
258*0b57cec5SDimitry Andric// to either the LU (GPR store) or the VSU (FPR store).
259*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStStore   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
260*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
261*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2]>,
262*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2]>],
263*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
264*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
265*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
266*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2,
267*0b57cec5SDimitry Andric                                                  P8_LSU1, P8_LSU2]>]
268*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
269*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTU     , [InstrStage<1, [P8_DU1], 0>,
270*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
271*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2,
272*0b57cec5SDimitry Andric                                                  P8_LSU1, P8_LSU2], 0>,
273*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
274*0b57cec5SDimitry Andric                                  [2, 1, 1, 1]>,
275*0b57cec5SDimitry Andric  // First+last
276*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTUX    , [InstrStage<1, [P8_DU1], 0>,
277*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
278*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU3], 0>,
279*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU4], 0>,
280*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU5], 0>,
281*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU6], 0>,
282*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
283*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>,
284*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
285*0b57cec5SDimitry Andric                                  [2, 1, 1, 1]>,
286*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTFD    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
287*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
288*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
289*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
290*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
291*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTFDU   , [InstrStage<1, [P8_DU1], 0>,
292*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
293*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
294*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2], 0>,
295*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
296*0b57cec5SDimitry Andric                                  [2, 1, 1, 1]>,
297*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTVEBX  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
298*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
299*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
300*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
301*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
302*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTDCX   , [InstrStage<1, [P8_DU1], 0>,
303*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
304*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU3], 0>,
305*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU4], 0>,
306*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU5], 0>,
307*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU6], 0>,
308*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
309*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2]>],
310*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
311*0b57cec5SDimitry Andric  InstrItinData<IIC_LdStSTWCX   , [InstrStage<1, [P8_DU1], 0>,
312*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU2], 0>,
313*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU3], 0>,
314*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU4], 0>,
315*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU5], 0>,
316*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_DU6], 0>,
317*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
318*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_LU1, P8_LU2]>],
319*0b57cec5SDimitry Andric                                  [1, 1, 1]>,
320*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFCR     , [InstrStage<1, [P8_DU1], 0>,
321*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_CRU]>],
322*0b57cec5SDimitry Andric                                  [6, 1]>,
323*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMFCRF    , [InstrStage<1, [P8_DU1], 0>,
324*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_CRU]>],
325*0b57cec5SDimitry Andric                                  [3, 1]>,
326*0b57cec5SDimitry Andric  InstrItinData<IIC_SprMTSPR    , [InstrStage<1, [P8_DU1], 0>,
327*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
328*0b57cec5SDimitry Andric                                  [4, 1]>, // mtctr
329*0b57cec5SDimitry Andric  InstrItinData<IIC_FPGeneral   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
330*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
331*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
332*0b57cec5SDimitry Andric                                  [5, 1, 1]>,
333*0b57cec5SDimitry Andric  InstrItinData<IIC_FPAddSub    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
334*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
335*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
336*0b57cec5SDimitry Andric                                  [5, 1, 1]>,
337*0b57cec5SDimitry Andric  InstrItinData<IIC_FPCompare   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
338*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
339*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
340*0b57cec5SDimitry Andric                                  [8, 1, 1]>,
341*0b57cec5SDimitry Andric  InstrItinData<IIC_FPDivD      , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
342*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
343*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
344*0b57cec5SDimitry Andric                                  [33, 1, 1]>,
345*0b57cec5SDimitry Andric  InstrItinData<IIC_FPDivS      , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
346*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
347*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
348*0b57cec5SDimitry Andric                                  [27, 1, 1]>,
349*0b57cec5SDimitry Andric  InstrItinData<IIC_FPSqrtD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
350*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
351*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
352*0b57cec5SDimitry Andric                                  [44, 1, 1]>,
353*0b57cec5SDimitry Andric  InstrItinData<IIC_FPSqrtS     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
354*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
355*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
356*0b57cec5SDimitry Andric                                  [32, 1, 1]>,
357*0b57cec5SDimitry Andric  InstrItinData<IIC_FPFused     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
358*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
359*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
360*0b57cec5SDimitry Andric                                  [5, 1, 1, 1]>,
361*0b57cec5SDimitry Andric  InstrItinData<IIC_FPRes       , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
362*0b57cec5SDimitry Andric                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
363*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
364*0b57cec5SDimitry Andric                                  [5, 1, 1]>,
365*0b57cec5SDimitry Andric  InstrItinData<IIC_VecGeneral  , [InstrStage<1, [P8_DU1], 0>,
366*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
367*0b57cec5SDimitry Andric                                  [2, 1, 1]>,
368*0b57cec5SDimitry Andric  InstrItinData<IIC_VecVSL      , [InstrStage<1, [P8_DU1], 0>,
369*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
370*0b57cec5SDimitry Andric                                  [2, 1, 1]>,
371*0b57cec5SDimitry Andric  InstrItinData<IIC_VecVSR      , [InstrStage<1, [P8_DU1], 0>,
372*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
373*0b57cec5SDimitry Andric                                  [2, 1, 1]>,
374*0b57cec5SDimitry Andric  InstrItinData<IIC_VecFP       , [InstrStage<1, [P8_DU1], 0>,
375*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
376*0b57cec5SDimitry Andric                                  [6, 1, 1]>,
377*0b57cec5SDimitry Andric  InstrItinData<IIC_VecFPCompare, [InstrStage<1, [P8_DU1], 0>,
378*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
379*0b57cec5SDimitry Andric                                  [6, 1, 1]>,
380*0b57cec5SDimitry Andric  InstrItinData<IIC_VecFPRound  , [InstrStage<1, [P8_DU1], 0>,
381*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
382*0b57cec5SDimitry Andric                                  [6, 1, 1]>,
383*0b57cec5SDimitry Andric  InstrItinData<IIC_VecComplex  , [InstrStage<1, [P8_DU1], 0>,
384*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
385*0b57cec5SDimitry Andric                                  [7, 1, 1]>,
386*0b57cec5SDimitry Andric  InstrItinData<IIC_VecPerm     , [InstrStage<1, [P8_DU1, P8_DU2], 0>,
387*0b57cec5SDimitry Andric                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
388*0b57cec5SDimitry Andric                                  [3, 1, 1]>
389*0b57cec5SDimitry Andric]>;
390*0b57cec5SDimitry Andric
391*0b57cec5SDimitry Andric// ===---------------------------------------------------------------------===//
392*0b57cec5SDimitry Andric// P8 machine model for scheduling and other instruction cost heuristics.
393*0b57cec5SDimitry Andric// P8 has an 8 insn dispatch group (6 non-branch, 2 branch) and can issue up
394*0b57cec5SDimitry Andric// to 10 insns per cycle (2-LU, 2-LSU, 2-FXU, 2-FPU, 1-CRU, 1-BRU).
395*0b57cec5SDimitry Andric
396*0b57cec5SDimitry Andricdef P8Model : SchedMachineModel {
397*0b57cec5SDimitry Andric  let IssueWidth = 8;  // up to 8 instructions dispatched per cycle.
398*0b57cec5SDimitry Andric                       // up to six non-branch instructions.
399*0b57cec5SDimitry Andric                       // up to two branches in a dispatch group.
400*0b57cec5SDimitry Andric
401*0b57cec5SDimitry Andric  let LoadLatency = 3; // Optimistic load latency assuming bypass.
402*0b57cec5SDimitry Andric                       // This is overriden by OperandCycles if the
403*0b57cec5SDimitry Andric                       // Itineraries are queried instead.
404*0b57cec5SDimitry Andric  let MispredictPenalty = 16;
405*0b57cec5SDimitry Andric
406*0b57cec5SDimitry Andric  // Try to make sure we have at least 10 dispatch groups in a loop.
407*0b57cec5SDimitry Andric  let LoopMicroOpBufferSize = 60;
408*0b57cec5SDimitry Andric
409*0b57cec5SDimitry Andric  let CompleteModel = 0;
410*0b57cec5SDimitry Andric
411*0b57cec5SDimitry Andric  let Itineraries = P8Itineraries;
412*0b57cec5SDimitry Andric}
413*0b57cec5SDimitry Andric
414