xref: /freebsd/contrib/llvm-project/llvm/lib/Target/PowerPC/PPCScheduleP9.td (revision 5ffd83dbcc34f10e07f6d3e968ae6365869615f4)
10b57cec5SDimitry Andric//===-- PPCScheduleP9.td - PPC P9 Scheduling Definitions ---*- tablegen -*-===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric//
90b57cec5SDimitry Andric// This file defines the itinerary class data for the POWER9 processor.
100b57cec5SDimitry Andric//
110b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
120b57cec5SDimitry Andricinclude "PPCInstrInfo.td"
130b57cec5SDimitry Andric
140b57cec5SDimitry Andricdef P9Model : SchedMachineModel {
150b57cec5SDimitry Andric  // The maximum number of instructions to be issued at the same time.
160b57cec5SDimitry Andric  // While a value of 8 is technically correct since 8 instructions can be
170b57cec5SDimitry Andric  // fetched from the instruction cache. However, only 6 instructions may be
180b57cec5SDimitry Andric  // actually dispatched at a time.
190b57cec5SDimitry Andric  let IssueWidth = 8;
200b57cec5SDimitry Andric
210b57cec5SDimitry Andric  // Load latency is 4 or 5 cycles depending on the load. This latency assumes
220b57cec5SDimitry Andric  // that we have a cache hit. For a cache miss the load latency will be more.
23*5ffd83dbSDimitry Andric  // There are two instructions (lxvl, lxvll) that have a latency of 6 cycles.
240b57cec5SDimitry Andric  // However it is not worth bumping this value up to 6 when the vast majority
250b57cec5SDimitry Andric  // of instructions are 4 or 5 cycles.
260b57cec5SDimitry Andric  let LoadLatency = 5;
270b57cec5SDimitry Andric
280b57cec5SDimitry Andric  // A total of 16 cycles to recover from a branch mispredict.
290b57cec5SDimitry Andric  let MispredictPenalty = 16;
300b57cec5SDimitry Andric
310b57cec5SDimitry Andric  // Try to make sure we have at least 10 dispatch groups in a loop.
320b57cec5SDimitry Andric  // A dispatch group is 6 instructions.
330b57cec5SDimitry Andric  let LoopMicroOpBufferSize = 60;
340b57cec5SDimitry Andric
350b57cec5SDimitry Andric  // As iops are dispatched to a slice, they are held in an independent slice
360b57cec5SDimitry Andric  // issue queue until all register sources and other dependencies have been
370b57cec5SDimitry Andric  // resolved and they can be issued. Each of four execution slices has an
380b57cec5SDimitry Andric  // 11-entry iop issue queue.
390b57cec5SDimitry Andric  let MicroOpBufferSize = 44;
400b57cec5SDimitry Andric
410b57cec5SDimitry Andric  let CompleteModel = 1;
420b57cec5SDimitry Andric
43*5ffd83dbSDimitry Andric  // Do not support QPX (Quad Processing eXtension), SPE (Signal Processing
44*5ffd83dbSDimitry Andric  // Engine), prefixed instructions on Power 9, PC relative mem ops, or
45*5ffd83dbSDimitry Andric  // instructions introduced in ISA 3.1.
46*5ffd83dbSDimitry Andric  let UnsupportedFeatures = [HasQPX, HasSPE, PrefixInstrs, PCRelativeMemops,
47*5ffd83dbSDimitry Andric                             IsISA3_1];
480b57cec5SDimitry Andric
490b57cec5SDimitry Andric}
500b57cec5SDimitry Andric
510b57cec5SDimitry Andriclet SchedModel = P9Model in {
520b57cec5SDimitry Andric
530b57cec5SDimitry Andric  // ***************** Processor Resources *****************
540b57cec5SDimitry Andric
550b57cec5SDimitry Andric  // Dispatcher slots:
560b57cec5SDimitry Andric  // x0, x1, x2, and x3 are the dedicated slice dispatch ports, where each
570b57cec5SDimitry Andric  // corresponds to one of the four execution slices.
580b57cec5SDimitry Andric  def DISPx02 : ProcResource<2>;
590b57cec5SDimitry Andric  def DISPx13 : ProcResource<2>;
600b57cec5SDimitry Andric  // The xa and xb ports can be used to send an iop to either of the two slices
610b57cec5SDimitry Andric  // of the superslice, but are restricted to iops with only two primary sources.
620b57cec5SDimitry Andric  def DISPxab : ProcResource<2>;
630b57cec5SDimitry Andric  // b0 and b1 are dedicated dispatch ports into the branch slice.
640b57cec5SDimitry Andric  def DISPb01 : ProcResource<2>;
650b57cec5SDimitry Andric
660b57cec5SDimitry Andric  // Any non BR dispatch ports
670b57cec5SDimitry Andric  def DISP_NBR
680b57cec5SDimitry Andric      : ProcResGroup<[ DISPx02, DISPx13, DISPxab]>;
690b57cec5SDimitry Andric  def DISP_SS : ProcResGroup<[ DISPx02, DISPx13]>;
700b57cec5SDimitry Andric
710b57cec5SDimitry Andric  // Issue Ports
720b57cec5SDimitry Andric  // An instruction can go down one of two issue queues.
730b57cec5SDimitry Andric  // Address Generation (AGEN) mainly for loads and stores.
740b57cec5SDimitry Andric  // Execution (EXEC) for most other instructions.
750b57cec5SDimitry Andric  // Some instructions cannot be run on just any issue queue and may require an
760b57cec5SDimitry Andric  // Even or an Odd queue. The EXECE represents the even queues and the EXECO
770b57cec5SDimitry Andric  // represents the odd queues.
780b57cec5SDimitry Andric  def IP_AGEN : ProcResource<4>;
790b57cec5SDimitry Andric  def IP_EXEC : ProcResource<4>;
800b57cec5SDimitry Andric  def IP_EXECE : ProcResource<2> {
810b57cec5SDimitry Andric    //Even Exec Ports
820b57cec5SDimitry Andric    let Super = IP_EXEC;
830b57cec5SDimitry Andric  }
840b57cec5SDimitry Andric  def IP_EXECO : ProcResource<2> {
850b57cec5SDimitry Andric    //Odd Exec Ports
860b57cec5SDimitry Andric    let Super = IP_EXEC;
870b57cec5SDimitry Andric  }
880b57cec5SDimitry Andric
890b57cec5SDimitry Andric  // Pipeline Groups
900b57cec5SDimitry Andric  // Four ALU (Fixed Point Arithmetic) units in total. Two even, two Odd.
910b57cec5SDimitry Andric  def ALU : ProcResource<4>;
920b57cec5SDimitry Andric  def ALUE : ProcResource<2> {
930b57cec5SDimitry Andric    //Even ALU pipelines
940b57cec5SDimitry Andric    let Super = ALU;
950b57cec5SDimitry Andric  }
960b57cec5SDimitry Andric  def ALUO : ProcResource<2> {
970b57cec5SDimitry Andric    //Odd ALU pipelines
980b57cec5SDimitry Andric    let Super = ALU;
990b57cec5SDimitry Andric  }
1000b57cec5SDimitry Andric
1010b57cec5SDimitry Andric  // Two DIV (Fixed Point Divide) units.
1020b57cec5SDimitry Andric  def DIV : ProcResource<2>;
1030b57cec5SDimitry Andric
1040b57cec5SDimitry Andric  // Four DP (Floating Point) units in total. Two even, two Odd.
1050b57cec5SDimitry Andric  def DP : ProcResource<4>;
1060b57cec5SDimitry Andric  def DPE : ProcResource<2> {
1070b57cec5SDimitry Andric    //Even DP pipelines
1080b57cec5SDimitry Andric    let Super = DP;
1090b57cec5SDimitry Andric  }
1100b57cec5SDimitry Andric  def DPO : ProcResource<2> {
1110b57cec5SDimitry Andric    //Odd DP pipelines
1120b57cec5SDimitry Andric    let Super = DP;
1130b57cec5SDimitry Andric  }
1140b57cec5SDimitry Andric
1150b57cec5SDimitry Andric  // Four LS (Load or Store) units.
1160b57cec5SDimitry Andric  def LS : ProcResource<4>;
1170b57cec5SDimitry Andric
1180b57cec5SDimitry Andric  // Two PM (Permute) units.
1190b57cec5SDimitry Andric  def PM : ProcResource<2>;
1200b57cec5SDimitry Andric
1210b57cec5SDimitry Andric  // Only one DFU (Decimal Floating Point and Quad Precision) unit.
1220b57cec5SDimitry Andric  def DFU : ProcResource<1>;
1230b57cec5SDimitry Andric
1240b57cec5SDimitry Andric  // Only one Branch unit.
1250b57cec5SDimitry Andric  def BR : ProcResource<1> {
1260b57cec5SDimitry Andric    let BufferSize = 16;
1270b57cec5SDimitry Andric  }
1280b57cec5SDimitry Andric
1290b57cec5SDimitry Andric  // Only one CY (Crypto) unit.
1300b57cec5SDimitry Andric  def CY : ProcResource<1>;
1310b57cec5SDimitry Andric
1320b57cec5SDimitry Andric  // ***************** SchedWriteRes Definitions *****************
1330b57cec5SDimitry Andric
1340b57cec5SDimitry Andric  // Dispatcher
1350b57cec5SDimitry Andric  // Dispatch Rules: '-' or 'V'
1360b57cec5SDimitry Andric  // Vector ('V') - vector iops (128-bit operand) take only one decode and
1370b57cec5SDimitry Andric  // dispatch slot but are dispatched to both the even and odd slices of a
1380b57cec5SDimitry Andric  // superslice.
1390b57cec5SDimitry Andric  def DISP_1C : SchedWriteRes<[DISP_NBR]> {
1400b57cec5SDimitry Andric    let NumMicroOps = 0;
1410b57cec5SDimitry Andric    let Latency = 1;
1420b57cec5SDimitry Andric  }
1430b57cec5SDimitry Andric  // Dispatch Rules: 'E'
1440b57cec5SDimitry Andric  // Even slice ('E')- certain operations must be sent only to an even slice.
1450b57cec5SDimitry Andric  // Also consumes odd dispatch slice slot of the same superslice at dispatch
1460b57cec5SDimitry Andric  def DISP_EVEN_1C : SchedWriteRes<[ DISPx02, DISPx13 ]> {
1470b57cec5SDimitry Andric    let NumMicroOps = 0;
1480b57cec5SDimitry Andric    let Latency = 1;
1490b57cec5SDimitry Andric  }
1500b57cec5SDimitry Andric  // Dispatch Rules: 'P'
1510b57cec5SDimitry Andric  // Paired ('P') - certain cracked and expanded iops are paired such that they
1520b57cec5SDimitry Andric  // must dispatch together to the same superslice.
1530b57cec5SDimitry Andric  def DISP_PAIR_1C : SchedWriteRes<[ DISP_SS, DISP_SS]> {
1540b57cec5SDimitry Andric    let NumMicroOps = 0;
1550b57cec5SDimitry Andric    let Latency = 1;
1560b57cec5SDimitry Andric  }
1570b57cec5SDimitry Andric  // Tuple Restricted ('R') - certain iops preclude dispatching more than one
1580b57cec5SDimitry Andric  // operation per slice for the super- slice to which they are dispatched
1590b57cec5SDimitry Andric  def DISP_3SLOTS_1C : SchedWriteRes<[DISPx02, DISPx13, DISPxab]> {
1600b57cec5SDimitry Andric    let NumMicroOps = 0;
1610b57cec5SDimitry Andric    let Latency = 1;
1620b57cec5SDimitry Andric  }
1630b57cec5SDimitry Andric  // Each execution and branch slice can receive up to two iops per cycle
1640b57cec5SDimitry Andric  def DISP_BR_1C : SchedWriteRes<[ DISPxab ]> {
1650b57cec5SDimitry Andric    let NumMicroOps = 0;
1660b57cec5SDimitry Andric    let Latency = 1;
1670b57cec5SDimitry Andric  }
1680b57cec5SDimitry Andric
1690b57cec5SDimitry Andric  // Issue Ports
1700b57cec5SDimitry Andric  def IP_AGEN_1C : SchedWriteRes<[IP_AGEN]> {
1710b57cec5SDimitry Andric    let NumMicroOps = 0;
1720b57cec5SDimitry Andric    let Latency = 1;
1730b57cec5SDimitry Andric  }
1740b57cec5SDimitry Andric
1750b57cec5SDimitry Andric  def IP_EXEC_1C : SchedWriteRes<[IP_EXEC]> {
1760b57cec5SDimitry Andric    let NumMicroOps = 0;
1770b57cec5SDimitry Andric    let Latency = 1;
1780b57cec5SDimitry Andric  }
1790b57cec5SDimitry Andric
1800b57cec5SDimitry Andric  def IP_EXECE_1C : SchedWriteRes<[IP_EXECE]> {
1810b57cec5SDimitry Andric    let NumMicroOps = 0;
1820b57cec5SDimitry Andric    let Latency = 1;
1830b57cec5SDimitry Andric  }
1840b57cec5SDimitry Andric
1850b57cec5SDimitry Andric  def IP_EXECO_1C : SchedWriteRes<[IP_EXECO]> {
1860b57cec5SDimitry Andric    let NumMicroOps = 0;
1870b57cec5SDimitry Andric    let Latency = 1;
1880b57cec5SDimitry Andric  }
1890b57cec5SDimitry Andric
1900b57cec5SDimitry Andric  //Pipeline Groups
1910b57cec5SDimitry Andric
1920b57cec5SDimitry Andric  // ALU Units
1930b57cec5SDimitry Andric  // An ALU may take either 2 or 3 cycles to complete the operation.
1940b57cec5SDimitry Andric  // However, the ALU unit is only ever busy for 1 cycle at a time and may
1950b57cec5SDimitry Andric  // receive new instructions each cycle.
1960b57cec5SDimitry Andric  def P9_ALU_2C : SchedWriteRes<[ALU]> {
1970b57cec5SDimitry Andric    let Latency = 2;
1980b57cec5SDimitry Andric  }
1990b57cec5SDimitry Andric
2000b57cec5SDimitry Andric  def P9_ALUE_2C : SchedWriteRes<[ALUE]> {
2010b57cec5SDimitry Andric    let Latency = 2;
2020b57cec5SDimitry Andric  }
2030b57cec5SDimitry Andric
2040b57cec5SDimitry Andric  def P9_ALUO_2C : SchedWriteRes<[ALUO]> {
2050b57cec5SDimitry Andric    let Latency = 2;
2060b57cec5SDimitry Andric  }
2070b57cec5SDimitry Andric
2080b57cec5SDimitry Andric  def P9_ALU_3C : SchedWriteRes<[ALU]> {
2090b57cec5SDimitry Andric    let Latency = 3;
2100b57cec5SDimitry Andric  }
2110b57cec5SDimitry Andric
2120b57cec5SDimitry Andric  def P9_ALUE_3C : SchedWriteRes<[ALUE]> {
2130b57cec5SDimitry Andric    let Latency = 3;
2140b57cec5SDimitry Andric  }
2150b57cec5SDimitry Andric
2160b57cec5SDimitry Andric  def P9_ALUO_3C : SchedWriteRes<[ALUO]> {
2170b57cec5SDimitry Andric    let Latency = 3;
2180b57cec5SDimitry Andric  }
2190b57cec5SDimitry Andric
2200b57cec5SDimitry Andric  // DIV Unit
2210b57cec5SDimitry Andric  // A DIV unit may take from 5 to 40 cycles to complete.
2220b57cec5SDimitry Andric  // Some DIV operations may keep the unit busy for up to 8 cycles.
2230b57cec5SDimitry Andric  def P9_DIV_5C : SchedWriteRes<[DIV]> {
2240b57cec5SDimitry Andric    let Latency = 5;
2250b57cec5SDimitry Andric  }
2260b57cec5SDimitry Andric
2270b57cec5SDimitry Andric  def P9_DIV_12C : SchedWriteRes<[DIV]> {
2280b57cec5SDimitry Andric    let Latency = 12;
2290b57cec5SDimitry Andric  }
2300b57cec5SDimitry Andric
2310b57cec5SDimitry Andric  def P9_DIV_16C_8 : SchedWriteRes<[DIV]> {
2320b57cec5SDimitry Andric    let ResourceCycles = [8];
2330b57cec5SDimitry Andric    let Latency = 16;
2340b57cec5SDimitry Andric  }
2350b57cec5SDimitry Andric
2360b57cec5SDimitry Andric  def P9_DIV_24C_8 : SchedWriteRes<[DIV]> {
2370b57cec5SDimitry Andric    let ResourceCycles = [8];
2380b57cec5SDimitry Andric    let Latency = 24;
2390b57cec5SDimitry Andric  }
2400b57cec5SDimitry Andric
2410b57cec5SDimitry Andric  def P9_DIV_40C_8 : SchedWriteRes<[DIV]> {
2420b57cec5SDimitry Andric    let ResourceCycles = [8];
2430b57cec5SDimitry Andric    let Latency = 40;
2440b57cec5SDimitry Andric  }
2450b57cec5SDimitry Andric
2460b57cec5SDimitry Andric  // DP Unit
2470b57cec5SDimitry Andric  // A DP unit may take from 2 to 36 cycles to complete.
2480b57cec5SDimitry Andric  // Some DP operations keep the unit busy for up to 10 cycles.
2490b57cec5SDimitry Andric  def P9_DP_5C : SchedWriteRes<[DP]> {
2500b57cec5SDimitry Andric    let Latency = 5;
2510b57cec5SDimitry Andric  }
2520b57cec5SDimitry Andric
2530b57cec5SDimitry Andric  def P9_DP_7C : SchedWriteRes<[DP]> {
2540b57cec5SDimitry Andric    let Latency = 7;
2550b57cec5SDimitry Andric  }
2560b57cec5SDimitry Andric
2570b57cec5SDimitry Andric  def P9_DPE_7C : SchedWriteRes<[DPE]> {
2580b57cec5SDimitry Andric    let Latency = 7;
2590b57cec5SDimitry Andric  }
2600b57cec5SDimitry Andric
2610b57cec5SDimitry Andric  def P9_DPO_7C : SchedWriteRes<[DPO]> {
2620b57cec5SDimitry Andric    let Latency = 7;
2630b57cec5SDimitry Andric  }
2640b57cec5SDimitry Andric
2650b57cec5SDimitry Andric  def P9_DP_22C_5 : SchedWriteRes<[DP]> {
2660b57cec5SDimitry Andric    let ResourceCycles = [5];
2670b57cec5SDimitry Andric    let Latency = 22;
2680b57cec5SDimitry Andric  }
2690b57cec5SDimitry Andric
2700b57cec5SDimitry Andric  def P9_DPO_24C_8 : SchedWriteRes<[DPO]> {
2710b57cec5SDimitry Andric    let ResourceCycles = [8];
2720b57cec5SDimitry Andric    let Latency = 24;
2730b57cec5SDimitry Andric  }
2740b57cec5SDimitry Andric
2750b57cec5SDimitry Andric  def P9_DPE_24C_8 : SchedWriteRes<[DPE]> {
2760b57cec5SDimitry Andric    let ResourceCycles = [8];
2770b57cec5SDimitry Andric    let Latency = 24;
2780b57cec5SDimitry Andric  }
2790b57cec5SDimitry Andric
2800b57cec5SDimitry Andric  def P9_DP_26C_5 : SchedWriteRes<[DP]> {
2810b57cec5SDimitry Andric    let ResourceCycles = [5];
2820b57cec5SDimitry Andric    let Latency = 22;
2830b57cec5SDimitry Andric  }
2840b57cec5SDimitry Andric
2850b57cec5SDimitry Andric  def P9_DPE_27C_10 : SchedWriteRes<[DP]> {
2860b57cec5SDimitry Andric    let ResourceCycles = [10];
2870b57cec5SDimitry Andric    let Latency = 27;
2880b57cec5SDimitry Andric  }
2890b57cec5SDimitry Andric
2900b57cec5SDimitry Andric  def P9_DPO_27C_10 : SchedWriteRes<[DP]> {
2910b57cec5SDimitry Andric    let ResourceCycles = [10];
2920b57cec5SDimitry Andric    let Latency = 27;
2930b57cec5SDimitry Andric  }
2940b57cec5SDimitry Andric
2950b57cec5SDimitry Andric  def P9_DP_33C_8 : SchedWriteRes<[DP]> {
2960b57cec5SDimitry Andric    let ResourceCycles = [8];
2970b57cec5SDimitry Andric    let Latency = 33;
2980b57cec5SDimitry Andric  }
2990b57cec5SDimitry Andric
3000b57cec5SDimitry Andric  def P9_DPE_33C_8 : SchedWriteRes<[DPE]> {
3010b57cec5SDimitry Andric    let ResourceCycles = [8];
3020b57cec5SDimitry Andric    let Latency = 33;
3030b57cec5SDimitry Andric  }
3040b57cec5SDimitry Andric
3050b57cec5SDimitry Andric  def P9_DPO_33C_8 : SchedWriteRes<[DPO]> {
3060b57cec5SDimitry Andric    let ResourceCycles = [8];
3070b57cec5SDimitry Andric    let Latency = 33;
3080b57cec5SDimitry Andric  }
3090b57cec5SDimitry Andric
3100b57cec5SDimitry Andric  def P9_DP_36C_10 : SchedWriteRes<[DP]> {
3110b57cec5SDimitry Andric    let ResourceCycles = [10];
3120b57cec5SDimitry Andric    let Latency = 36;
3130b57cec5SDimitry Andric  }
3140b57cec5SDimitry Andric
3150b57cec5SDimitry Andric  def P9_DPE_36C_10 : SchedWriteRes<[DP]> {
3160b57cec5SDimitry Andric    let ResourceCycles = [10];
3170b57cec5SDimitry Andric    let Latency = 36;
3180b57cec5SDimitry Andric  }
3190b57cec5SDimitry Andric
3200b57cec5SDimitry Andric  def P9_DPO_36C_10 : SchedWriteRes<[DP]> {
3210b57cec5SDimitry Andric    let ResourceCycles = [10];
3220b57cec5SDimitry Andric    let Latency = 36;
3230b57cec5SDimitry Andric  }
3240b57cec5SDimitry Andric
3250b57cec5SDimitry Andric  // PM Unit
3260b57cec5SDimitry Andric  // Three cycle permute operations.
3270b57cec5SDimitry Andric  def P9_PM_3C : SchedWriteRes<[PM]> {
3280b57cec5SDimitry Andric    let Latency = 3;
3290b57cec5SDimitry Andric  }
3300b57cec5SDimitry Andric
3310b57cec5SDimitry Andric  // Load and Store Units
3320b57cec5SDimitry Andric  // Loads can have 4, 5 or 6 cycles of latency.
3330b57cec5SDimitry Andric  // Stores are listed as having a single cycle of latency. This is not
3340b57cec5SDimitry Andric  // completely accurate since it takes more than 1 cycle to actually store
3350b57cec5SDimitry Andric  // the value. However, since the store does not produce a result it can be
3360b57cec5SDimitry Andric  // considered complete after one cycle.
3370b57cec5SDimitry Andric  def P9_LS_1C : SchedWriteRes<[LS]> {
3380b57cec5SDimitry Andric    let Latency = 1;
3390b57cec5SDimitry Andric  }
3400b57cec5SDimitry Andric
3410b57cec5SDimitry Andric  def P9_LS_4C : SchedWriteRes<[LS]> {
3420b57cec5SDimitry Andric    let Latency = 4;
3430b57cec5SDimitry Andric  }
3440b57cec5SDimitry Andric
3450b57cec5SDimitry Andric  def P9_LS_5C : SchedWriteRes<[LS]> {
3460b57cec5SDimitry Andric    let Latency = 5;
3470b57cec5SDimitry Andric  }
3480b57cec5SDimitry Andric
3490b57cec5SDimitry Andric  def P9_LS_6C : SchedWriteRes<[LS]> {
3500b57cec5SDimitry Andric    let Latency = 6;
3510b57cec5SDimitry Andric  }
3520b57cec5SDimitry Andric
3530b57cec5SDimitry Andric  // DFU Unit
3540b57cec5SDimitry Andric  // Some of the most expensive ops use the DFU.
3550b57cec5SDimitry Andric  // Can take from 12 cycles to 76 cycles to obtain a result.
3560b57cec5SDimitry Andric  // The unit may be busy for up to 62 cycles.
3570b57cec5SDimitry Andric  def P9_DFU_12C : SchedWriteRes<[DFU]> {
3580b57cec5SDimitry Andric    let Latency = 12;
3590b57cec5SDimitry Andric  }
3600b57cec5SDimitry Andric
3610b57cec5SDimitry Andric  def P9_DFU_23C : SchedWriteRes<[DFU]> {
3620b57cec5SDimitry Andric    let Latency = 23;
3630b57cec5SDimitry Andric    let ResourceCycles = [11];
3640b57cec5SDimitry Andric  }
3650b57cec5SDimitry Andric
3660b57cec5SDimitry Andric  def P9_DFU_24C : SchedWriteRes<[DFU]> {
3670b57cec5SDimitry Andric    let Latency = 24;
3680b57cec5SDimitry Andric    let ResourceCycles = [12];
3690b57cec5SDimitry Andric  }
3700b57cec5SDimitry Andric
3710b57cec5SDimitry Andric  def P9_DFU_37C : SchedWriteRes<[DFU]> {
3720b57cec5SDimitry Andric    let Latency = 37;
3730b57cec5SDimitry Andric    let ResourceCycles = [25];
3740b57cec5SDimitry Andric  }
3750b57cec5SDimitry Andric
3760b57cec5SDimitry Andric  def P9_DFU_58C : SchedWriteRes<[DFU]> {
3770b57cec5SDimitry Andric    let Latency = 58;
3780b57cec5SDimitry Andric    let ResourceCycles = [44];
3790b57cec5SDimitry Andric  }
3800b57cec5SDimitry Andric
3810b57cec5SDimitry Andric  def P9_DFU_76C : SchedWriteRes<[DFU]> {
3820b57cec5SDimitry Andric    let Latency = 76;
3830b57cec5SDimitry Andric    let ResourceCycles = [62];
3840b57cec5SDimitry Andric  }
3850b57cec5SDimitry Andric
3860b57cec5SDimitry Andric  // 2 or 5 cycle latencies for the branch unit.
3870b57cec5SDimitry Andric  def P9_BR_2C : SchedWriteRes<[BR]> {
3880b57cec5SDimitry Andric    let Latency = 2;
3890b57cec5SDimitry Andric  }
3900b57cec5SDimitry Andric
3910b57cec5SDimitry Andric  def P9_BR_5C : SchedWriteRes<[BR]> {
3920b57cec5SDimitry Andric    let Latency = 5;
3930b57cec5SDimitry Andric  }
3940b57cec5SDimitry Andric
3950b57cec5SDimitry Andric  // 6 cycle latency for the crypto unit
3960b57cec5SDimitry Andric  def P9_CY_6C : SchedWriteRes<[CY]> {
3970b57cec5SDimitry Andric    let Latency = 6;
3980b57cec5SDimitry Andric  }
3990b57cec5SDimitry Andric
4000b57cec5SDimitry Andric  // ***************** WriteSeq Definitions *****************
4010b57cec5SDimitry Andric
4020b57cec5SDimitry Andric  // These are combinations of the resources listed above.
4030b57cec5SDimitry Andric  // The idea is that some cracked instructions cannot be done in parallel and
4040b57cec5SDimitry Andric  // so the latencies for their resources must be added.
4050b57cec5SDimitry Andric  def P9_LoadAndALUOp_6C : WriteSequence<[P9_LS_4C, P9_ALU_2C]>;
4060b57cec5SDimitry Andric  def P9_LoadAndALUOp_7C : WriteSequence<[P9_LS_5C, P9_ALU_2C]>;
4070b57cec5SDimitry Andric  def P9_LoadAndALU2Op_7C : WriteSequence<[P9_LS_4C, P9_ALU_3C]>;
4080b57cec5SDimitry Andric  def P9_LoadAndALU2Op_8C : WriteSequence<[P9_LS_5C, P9_ALU_3C]>;
4090b57cec5SDimitry Andric  def P9_LoadAndPMOp_8C : WriteSequence<[P9_LS_5C, P9_PM_3C]>;
4100b57cec5SDimitry Andric  def P9_LoadAndLoadOp_8C : WriteSequence<[P9_LS_4C, P9_LS_4C]>;
4110b57cec5SDimitry Andric  def P9_IntDivAndALUOp_18C_8 : WriteSequence<[P9_DIV_16C_8, P9_ALU_2C]>;
4120b57cec5SDimitry Andric  def P9_IntDivAndALUOp_26C_8 : WriteSequence<[P9_DIV_24C_8, P9_ALU_2C]>;
4130b57cec5SDimitry Andric  def P9_IntDivAndALUOp_42C_8 : WriteSequence<[P9_DIV_40C_8, P9_ALU_2C]>;
4140b57cec5SDimitry Andric  def P9_StoreAndALUOp_3C : WriteSequence<[P9_LS_1C, P9_ALU_2C]>;
4150b57cec5SDimitry Andric  def P9_ALUOpAndALUOp_4C : WriteSequence<[P9_ALU_2C, P9_ALU_2C]>;
4160b57cec5SDimitry Andric  def P9_ALU2OpAndALU2Op_6C : WriteSequence<[P9_ALU_3C, P9_ALU_3C]>;
4170b57cec5SDimitry Andric  def P9_ALUOpAndALUOpAndALUOp_6C :
4180b57cec5SDimitry Andric    WriteSequence<[P9_ALU_2C, P9_ALU_2C, P9_ALU_2C]>;
4190b57cec5SDimitry Andric  def P9_DPOpAndALUOp_7C : WriteSequence<[P9_DP_5C, P9_ALU_2C]>;
4200b57cec5SDimitry Andric  def P9_DPOpAndALU2Op_10C : WriteSequence<[P9_DP_7C, P9_ALU_3C]>;
4210b57cec5SDimitry Andric  def P9_DPOpAndALU2Op_25C_5 : WriteSequence<[P9_DP_22C_5, P9_ALU_3C]>;
4220b57cec5SDimitry Andric  def P9_DPOpAndALU2Op_29C_5 : WriteSequence<[P9_DP_26C_5, P9_ALU_3C]>;
4230b57cec5SDimitry Andric  def P9_DPOpAndALU2Op_36C_8 : WriteSequence<[P9_DP_33C_8, P9_ALU_3C]>;
4240b57cec5SDimitry Andric  def P9_DPOpAndALU2Op_39C_10 : WriteSequence<[P9_DP_36C_10, P9_ALU_3C]>;
4250b57cec5SDimitry Andric  def P9_BROpAndALUOp_7C : WriteSequence<[P9_BR_5C, P9_ALU_2C]>;
4260b57cec5SDimitry Andric
4270b57cec5SDimitry Andric  // Include the resource requirements of individual instructions.
4280b57cec5SDimitry Andric  include "P9InstrResources.td"
4290b57cec5SDimitry Andric
4300b57cec5SDimitry Andric}
4310b57cec5SDimitry Andric
432