aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/PPCScheduleP8.td
blob: 020739baec3a6cf632576fd162abbc374096ce71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
//===-- PPCScheduleP8.td - PPC P8 Scheduling Definitions ---*- tablegen -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the itinerary class data for the POWER8 processor.
//
//===----------------------------------------------------------------------===//

// Scheduling for the P8 involves tracking two types of resources:
//  1. The dispatch bundle slots
//  2. The functional unit resources

// Dispatch units:
def P8_DU1    : FuncUnit;
def P8_DU2    : FuncUnit;
def P8_DU3    : FuncUnit;
def P8_DU4    : FuncUnit;
def P8_DU5    : FuncUnit;
def P8_DU6    : FuncUnit;
def P8_DU7    : FuncUnit; // Only branch instructions will use DU7,DU8
def P8_DU8    : FuncUnit;

// 10 insns per cycle (2-LU, 2-LSU, 2-FXU, 2-FPU, 1-CRU, 1-BRU).

def P8_LU1     : FuncUnit; // Loads or fixed-point operations 1
def P8_LU2     : FuncUnit; // Loads or fixed-point operations 2

// Load/Store pipelines can handle Stores, fixed-point loads, and simple
// fixed-point operations.
def P8_LSU1    : FuncUnit; // Load/Store pipeline 1
def P8_LSU2    : FuncUnit; // Load/Store pipeline 2

// Fixed Point unit
def P8_FXU1    : FuncUnit; // FX pipeline 1
def P8_FXU2    : FuncUnit; // FX pipeline 2

// The Floating-Point Unit (FPU) and Vector Media Extension (VMX) units
// are combined on P7 and newer into a Vector Scalar Unit (VSU).
// The P8 Instruction latency documents still refers to the unit as the
// FPU, so keep in mind that FPU==VSU.
// In contrast to the P7, the VMX units on P8 are symmetric, so no need to
// split vector integer ops or 128-bit load/store/perms to the specific units.
def P8_FPU1    : FuncUnit; // VS pipeline 1
def P8_FPU2    : FuncUnit; // VS pipeline 2

def P8_CRU    : FuncUnit; // CR unit (CR logicals and move-from-SPRs)
def P8_BRU    : FuncUnit; // BR unit

def P8Itineraries : ProcessorItineraries<
  [P8_DU1, P8_DU2, P8_DU3, P8_DU4, P8_DU5, P8_DU6, P8_DU7, P8_DU8,
   P8_LU1, P8_LU2, P8_LSU1, P8_LSU2, P8_FXU1, P8_FXU2,
   P8_FPU1, P8_FPU2, P8_CRU, P8_BRU], [], [
  InstrItinData<IIC_IntSimple   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2,
                                                  P8_LU1, P8_LU2,
                                                  P8_LSU1, P8_LSU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_IntGeneral  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2, P8_LU1,
                                                  P8_LU2, P8_LSU1, P8_LSU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_IntISEL,      [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2], 0>,
                                   InstrStage<1, [P8_BRU]>],
                                  [1, 1, 1, 1]>,
  InstrItinData<IIC_IntCompare  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_IntDivW     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<15, [P8_FXU1, P8_FXU2]>],
                                  [15, 1, 1]>,
  InstrItinData<IIC_IntDivD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<23, [P8_FXU1, P8_FXU2]>],
                                  [23, 1, 1]>,
  InstrItinData<IIC_IntMulHW    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [4, 1, 1]>,
  InstrItinData<IIC_IntMulHWU   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [4, 1, 1]>,
  InstrItinData<IIC_IntMulLI    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [4, 1, 1]>,
  InstrItinData<IIC_IntRotate   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                   [1, 1, 1]>,
  InstrItinData<IIC_IntRotateD  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                   [1, 1, 1]>,
  InstrItinData<IIC_IntShift    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_IntTrapW    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [1, 1]>,
  InstrItinData<IIC_IntTrapD    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [1, 1]>,
  InstrItinData<IIC_BrB         , [InstrStage<1, [P8_DU7, P8_DU8], 0>,
                                   InstrStage<1, [P8_BRU]>],
                                  [3, 1, 1]>,
  // FIXME - the Br* groups below are not branch related, so should probably
  // be renamed.
  // IIC_BrCR consists of the cr* instructions.  (crand,crnor,creqv, etc).
  // and should be 'First' in dispatch.
  InstrItinData<IIC_BrCR        , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_CRU]>],
                                  [3, 1, 1]>,
  // IIC_BrMCR consists of the mcrf instruction.
  InstrItinData<IIC_BrMCR       , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_CRU]>],
                                  [3, 1, 1]>,
  // IIC_BrMCRX consists of mcrxr (obsolete instruction) and mtcrf, which
  // should be first in the dispatch group.
  InstrItinData<IIC_BrMCRX      , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 1, 1]>,
  InstrItinData<IIC_BrMCRX      , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 1]>,
  InstrItinData<IIC_LdStLoad    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2]>],
                                  [2, 1, 1]>,
  InstrItinData<IIC_LdStLoadUpd , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2 ], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [2, 2, 1, 1]>,
  // Update-Indexed form loads/stores are no longer first and last in the
  // dispatch group.  They are simply cracked, so require DU1,DU2.
  InstrItinData<IIC_LdStLoadUpdX, [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 3, 1, 1]>,
  InstrItinData<IIC_LdStLD      , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2]>],
                                  [2, 1, 1]>,
  InstrItinData<IIC_LdStLDU     , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [2, 2, 1, 1]>,
  InstrItinData<IIC_LdStLDUX    , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 3, 1, 1]>,
  InstrItinData<IIC_LdStLFD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2]>],
                                  [3, 1, 1]>,
  InstrItinData<IIC_LdStLVecX   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2]>],
                                  [3, 1, 1]>,
  InstrItinData<IIC_LdStLFDU    , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 3, 1, 1]>,
  InstrItinData<IIC_LdStLFDUX   , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 3, 1, 1]>,
  InstrItinData<IIC_LdStLHA     , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2,
                                                  P8_LU1, P8_LU2]>],
                                  [3, 1, 1]>,
  InstrItinData<IIC_LdStLHAU    , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [4, 4, 1, 1]>,
  // first+last in dispatch group.
  InstrItinData<IIC_LdStLHAUX   , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_DU3], 0>,
                                   InstrStage<1, [P8_DU4], 0>,
                                   InstrStage<1, [P8_DU5], 0>,
                                   InstrStage<1, [P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [4, 4, 1, 1]>,
  InstrItinData<IIC_LdStLWA     , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2]>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [3, 1, 1]>,
  InstrItinData<IIC_LdStLWARX,    [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_DU3], 0>,
                                   InstrStage<1, [P8_DU4], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2]>],
                                  [3, 1, 1]>,
  // first+last
  InstrItinData<IIC_LdStLDARX,    [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_DU3], 0>,
                                   InstrStage<1, [P8_DU4], 0>,
                                   InstrStage<1, [P8_DU5], 0>,
                                   InstrStage<1, [P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2]>],
                                  [3, 1, 1]>,
  InstrItinData<IIC_LdStLMW     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2,
                                                  P8_LU1, P8_LU2]>],
                                  [2, 1, 1]>,
// Stores are dual-issued from the issue queue, so may only take up one
// dispatch slot.  The instruction will be broken into two IOPS. The agen
// op is issued to the LSU, and the data op (register fetch) is issued
// to either the LU (GPR store) or the VSU (FPR store).
  InstrItinData<IIC_LdStStore   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2]>,
                                   InstrStage<1, [P8_LU1, P8_LU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_LdStSTD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2,
                                                  P8_LSU1, P8_LSU2]>]
                                  [1, 1, 1]>,
  InstrItinData<IIC_LdStSTDU    , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2,
                                                  P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [2, 1, 1, 1]>,
  // First+last
  InstrItinData<IIC_LdStSTDUX   , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_DU3], 0>,
                                   InstrStage<1, [P8_DU4], 0>,
                                   InstrStage<1, [P8_DU5], 0>,
                                   InstrStage<1, [P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [2, 1, 1, 1]>,
  InstrItinData<IIC_LdStSTFD    , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_LdStSTFDU   , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [2, 1, 1, 1]>,
  InstrItinData<IIC_LdStSTVEBX  , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_LdStSTDCX   , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_DU3], 0>,
                                   InstrStage<1, [P8_DU4], 0>,
                                   InstrStage<1, [P8_DU5], 0>,
                                   InstrStage<1, [P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_LdStSTWCX   , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_DU2], 0>,
                                   InstrStage<1, [P8_DU3], 0>,
                                   InstrStage<1, [P8_DU4], 0>,
                                   InstrStage<1, [P8_DU5], 0>,
                                   InstrStage<1, [P8_DU6], 0>,
                                   InstrStage<1, [P8_LSU1, P8_LSU2], 0>,
                                   InstrStage<1, [P8_LU1, P8_LU2]>],
                                  [1, 1, 1]>,
  InstrItinData<IIC_SprMFCR     , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_CRU]>],
                                  [6, 1]>,
  InstrItinData<IIC_SprMFCRF    , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_CRU]>],
                                  [3, 1]>,
  InstrItinData<IIC_SprMTSPR    , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FXU1, P8_FXU2]>],
                                  [4, 1]>, // mtctr
  InstrItinData<IIC_FPGeneral   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [5, 1, 1]>,
  InstrItinData<IIC_FPCompare   , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [8, 1, 1]>,
  InstrItinData<IIC_FPDivD      , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [33, 1, 1]>,
  InstrItinData<IIC_FPDivS      , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [27, 1, 1]>,
  InstrItinData<IIC_FPSqrtD     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [44, 1, 1]>,
  InstrItinData<IIC_FPSqrtS     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [32, 1, 1]>,
  InstrItinData<IIC_FPFused     , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [5, 1, 1, 1]>,
  InstrItinData<IIC_FPRes       , [InstrStage<1, [P8_DU1, P8_DU2, P8_DU3,
                                                  P8_DU4, P8_DU5, P8_DU6], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [5, 1, 1]>,
  InstrItinData<IIC_VecGeneral  , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [2, 1, 1]>,
  InstrItinData<IIC_VecVSL      , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [2, 1, 1]>,
  InstrItinData<IIC_VecVSR      , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [2, 1, 1]>,
  InstrItinData<IIC_VecFP       , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [6, 1, 1]>,
  InstrItinData<IIC_VecFPCompare, [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [6, 1, 1]>,
  InstrItinData<IIC_VecFPRound  , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [6, 1, 1]>,
  InstrItinData<IIC_VecComplex  , [InstrStage<1, [P8_DU1], 0>,
                                   InstrStage<1, [P8_FPU1, P8_FPU2]>],
                                  [7, 1, 1]>,
  InstrItinData<IIC_VecPerm     , [InstrStage<1, [P8_DU1, P8_DU2], 0>,
                                   InstrStage<1, [P8_FPU2, P8_FPU2]>],
                                  [3, 1, 1]>
]>;

// ===---------------------------------------------------------------------===//
// P8 machine model for scheduling and other instruction cost heuristics.
// P8 has an 8 insn dispatch group (6 non-branch, 2 branch) and can issue up
// to 10 insns per cycle (2-LU, 2-LSU, 2-FXU, 2-FPU, 1-CRU, 1-BRU).

def P8Model : SchedMachineModel {
  let IssueWidth = 8;  // up to 8 instructions dispatched per cycle.
                       // up to six non-branch instructions.
                       // up to two branches in a dispatch group.

  let MinLatency = 0;  // Out-of-order dispatch.
  let LoadLatency = 3; // Optimistic load latency assuming bypass.
                       // This is overriden by OperandCycles if the
                       // Itineraries are queried instead.
  let MispredictPenalty = 16;

  // Try to make sure we have at least 10 dispatch groups in a loop.
  let LoopMicroOpBufferSize = 60;

  let Itineraries = P8Itineraries;
}