123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334 |
- //===-- PPCScheduleE500mc.td - e500mc Scheduling Defs ------*- tablegen -*-===//
- //
- // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- // See https://llvm.org/LICENSE.txt for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- //===----------------------------------------------------------------------===//
- //
- // This file defines the itinerary class data for the Freescale e500mc 32-bit
- // Power processor.
- //
- // All information is derived from the "e500mc Core Reference Manual",
- // Freescale Document Number E500MCRM, Rev. 1, 03/2012.
- //
- //===----------------------------------------------------------------------===//
- // Relevant functional units in the Freescale e500mc core:
- //
- // * Decode & Dispatch
- // Can dispatch up to 2 instructions per clock cycle to either the GPR Issue
- // queues (GIQx), FP Issue Queue (FIQ), or Branch issue queue (BIQ).
- def E500mc_DIS0 : FuncUnit; // Dispatch stage - insn 1
- def E500mc_DIS1 : FuncUnit; // Dispatch stage - insn 2
- // * Execute
- // 6 pipelined execution units: SFX0, SFX1, BU, FPU, LSU, CFX.
- // Some instructions can only execute in SFX0 but not SFX1.
- // The CFX has a bypass path, allowing non-divide instructions to execute
- // while a divide instruction is executed.
- def E500mc_SFX0 : FuncUnit; // Simple unit 0
- def E500mc_SFX1 : FuncUnit; // Simple unit 1
- def E500mc_BU : FuncUnit; // Branch unit
- def E500mc_CFX_DivBypass
- : FuncUnit; // CFX divide bypass path
- def E500mc_CFX_0 : FuncUnit; // CFX pipeline
- def E500mc_LSU_0 : FuncUnit; // LSU pipeline
- def E500mc_FPU_0 : FuncUnit; // FPU pipeline
- def E500mc_GPR_Bypass : Bypass;
- def E500mc_FPR_Bypass : Bypass;
- def E500mc_CR_Bypass : Bypass;
- def PPCE500mcItineraries : ProcessorItineraries<
- [E500mc_DIS0, E500mc_DIS1, E500mc_SFX0, E500mc_SFX1, E500mc_BU, E500mc_CFX_DivBypass,
- E500mc_CFX_0, E500mc_LSU_0, E500mc_FPU_0],
- [E500mc_CR_Bypass, E500mc_GPR_Bypass, E500mc_FPR_Bypass], [
- InstrItinData<IIC_IntSimple, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1, 1], // Latency = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntGeneral, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1, 1], // Latency = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntISEL, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1, 1, 1], // Latency = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass,
- E500mc_CR_Bypass]>,
- InstrItinData<IIC_IntCompare, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [5, 1, 1], // Latency = 1 or 2
- [E500mc_CR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntDivW, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_CFX_0], 0>,
- InstrStage<14, [E500mc_CFX_DivBypass]>],
- [17, 1, 1], // Latency=4..35, Repeat= 4..35
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntMFFS, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<8, [E500mc_FPU_0]>],
- [11], // Latency = 8
- [E500mc_FPR_Bypass]>,
- InstrItinData<IIC_IntMTFSB0, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<8, [E500mc_FPU_0]>],
- [11, 1, 1], // Latency = 8
- [NoBypass, NoBypass, NoBypass]>,
- InstrItinData<IIC_IntMulHW, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_CFX_0]>],
- [7, 1, 1], // Latency = 4, Repeat rate = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntMulHWU, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_CFX_0]>],
- [7, 1, 1], // Latency = 4, Repeat rate = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntMulLI, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_CFX_0]>],
- [7, 1, 1], // Latency = 4, Repeat rate = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntRotate, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1, 1], // Latency = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntShift, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1, 1], // Latency = 1
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_IntTrapW, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<2, [E500mc_SFX0]>],
- [5, 1], // Latency = 2, Repeat rate = 2
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_BrB, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_BU]>],
- [4, 1], // Latency = 1
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_BrCR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_BU]>],
- [4, 1, 1], // Latency = 1
- [E500mc_CR_Bypass,
- E500mc_CR_Bypass, E500mc_CR_Bypass]>,
- InstrItinData<IIC_BrMCR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_BU]>],
- [4, 1], // Latency = 1
- [E500mc_CR_Bypass, E500mc_CR_Bypass]>,
- InstrItinData<IIC_BrMCRX, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1, 1], // Latency = 1
- [E500mc_CR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStDCBA, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3, Repeat rate = 1
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStDCBF, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStDCBI, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLoad, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLoadUpd, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStLoadUpdX,[InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStStore, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStSTU, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [NoBypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStSTUX, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [NoBypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStICBI, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStSTFD, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1, 1], // Latency = 3
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStSTFDU, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1, 1], // Latency = 3
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStLFD, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [7, 1, 1], // Latency = 4
- [E500mc_FPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLFDU, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [7, 1, 1], // Latency = 4
- [E500mc_FPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStLFDUX, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [7, 1, 1], // Latency = 4
- [E500mc_FPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass],
- 2>, // 2 micro-ops
- InstrItinData<IIC_LdStLHA, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLHAU, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLHAUX, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLMW, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [7, 1], // Latency = r+3
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStLWARX, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<3, [E500mc_LSU_0]>],
- [6, 1, 1], // Latency = 3, Repeat rate = 3
- [E500mc_GPR_Bypass,
- E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStSTWCX, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>],
- [6, 1], // Latency = 3
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_LdStSync, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0]>]>,
- InstrItinData<IIC_SprMFSR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<4, [E500mc_SFX0]>],
- [7, 1],
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMTMSR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<2, [E500mc_SFX0, E500mc_SFX1]>],
- [5, 1], // Latency = 2, Repeat rate = 4
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMTSR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0]>],
- [5, 1],
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprTLBSYNC, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_LSU_0], 0>]>,
- InstrItinData<IIC_SprMFCR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<5, [E500mc_SFX0]>],
- [8, 1],
- [E500mc_GPR_Bypass, E500mc_CR_Bypass]>,
- InstrItinData<IIC_SprMFCRF, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<5, [E500mc_SFX0]>],
- [8, 1],
- [E500mc_GPR_Bypass, E500mc_CR_Bypass]>,
- InstrItinData<IIC_SprMFPMR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<4, [E500mc_SFX0]>],
- [7, 1], // Latency = 4, Repeat rate = 4
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMFMSR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<4, [E500mc_SFX0]>],
- [7, 1], // Latency = 4, Repeat rate = 4
- [E500mc_GPR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMFSPR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1], // Latency = 1, Repeat rate = 1
- [E500mc_GPR_Bypass, E500mc_CR_Bypass]>,
- InstrItinData<IIC_SprMTPMR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0]>],
- [4, 1], // Latency = 1, Repeat rate = 1
- [E500mc_CR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMFTB, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<4, [E500mc_SFX0]>],
- [7, 1], // Latency = 4, Repeat rate = 4
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMTSPR, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0, E500mc_SFX1]>],
- [4, 1], // Latency = 1, Repeat rate = 1
- [E500mc_CR_Bypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_SprMTSRIN, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<1, [E500mc_SFX0]>],
- [4, 1],
- [NoBypass, E500mc_GPR_Bypass]>,
- InstrItinData<IIC_FPGeneral, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<2, [E500mc_FPU_0]>],
- [11, 1, 1], // Latency = 8, Repeat rate = 2
- [E500mc_FPR_Bypass,
- E500mc_FPR_Bypass, E500mc_FPR_Bypass]>,
- InstrItinData<IIC_FPAddSub, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<4, [E500mc_FPU_0]>],
- [13, 1, 1], // Latency = 10, Repeat rate = 4
- [E500mc_FPR_Bypass,
- E500mc_FPR_Bypass, E500mc_FPR_Bypass]>,
- InstrItinData<IIC_FPCompare, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<2, [E500mc_FPU_0]>],
- [11, 1, 1], // Latency = 8, Repeat rate = 2
- [E500mc_CR_Bypass,
- E500mc_FPR_Bypass, E500mc_FPR_Bypass]>,
- InstrItinData<IIC_FPDivD, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<68, [E500mc_FPU_0]>],
- [71, 1, 1], // Latency = 68, Repeat rate = 68
- [E500mc_FPR_Bypass,
- E500mc_FPR_Bypass, E500mc_FPR_Bypass]>,
- InstrItinData<IIC_FPDivS, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<38, [E500mc_FPU_0]>],
- [41, 1, 1], // Latency = 38, Repeat rate = 38
- [E500mc_FPR_Bypass,
- E500mc_FPR_Bypass, E500mc_FPR_Bypass]>,
- InstrItinData<IIC_FPFused, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<4, [E500mc_FPU_0]>],
- [13, 1, 1, 1], // Latency = 10, Repeat rate = 4
- [E500mc_FPR_Bypass,
- E500mc_FPR_Bypass, E500mc_FPR_Bypass,
- E500mc_FPR_Bypass]>,
- InstrItinData<IIC_FPRes, [InstrStage<1, [E500mc_DIS0, E500mc_DIS1], 0>,
- InstrStage<38, [E500mc_FPU_0]>],
- [41, 1], // Latency = 38, Repeat rate = 38
- [E500mc_FPR_Bypass, E500mc_FPR_Bypass]>
- ]>;
- // ===---------------------------------------------------------------------===//
- // e500mc machine model for scheduling and other instruction cost heuristics.
- def PPCE500mcModel : SchedMachineModel {
- let IssueWidth = 2; // 2 micro-ops are dispatched per cycle.
- let LoadLatency = 5; // Optimistic load latency assuming bypass.
- // This is overriden by OperandCycles if the
- // Itineraries are queried instead.
- let CompleteModel = 0;
- let Itineraries = PPCE500mcItineraries;
- }
|