xref: /aosp_15_r20/external/llvm/lib/Target/Hexagon/HexagonScheduleV4.td (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker//=-HexagonScheduleV4.td - HexagonV4 Scheduling Definitions --*- tablegen -*-=//
2*9880d681SAndroid Build Coastguard Worker//
3*9880d681SAndroid Build Coastguard Worker//                     The LLVM Compiler Infrastructure
4*9880d681SAndroid Build Coastguard Worker//
5*9880d681SAndroid Build Coastguard Worker// This file is distributed under the University of Illinois Open Source
6*9880d681SAndroid Build Coastguard Worker// License. See LICENSE.TXT for details.
7*9880d681SAndroid Build Coastguard Worker//
8*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker// There are four SLOTS (four parallel pipelines) in Hexagon V4 machine.
11*9880d681SAndroid Build Coastguard Worker// This file describes that machine information.
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker//
14*9880d681SAndroid Build Coastguard Worker//    |===========|==================================================|
15*9880d681SAndroid Build Coastguard Worker//    | PIPELINE  |              Instruction Classes                 |
16*9880d681SAndroid Build Coastguard Worker//    |===========|==================================================|
17*9880d681SAndroid Build Coastguard Worker//    | SLOT0     |  LD       ST    ALU32     MEMOP     NV    SYSTEM |
18*9880d681SAndroid Build Coastguard Worker//    |-----------|--------------------------------------------------|
19*9880d681SAndroid Build Coastguard Worker//    | SLOT1     |  LD       ST    ALU32                            |
20*9880d681SAndroid Build Coastguard Worker//    |-----------|--------------------------------------------------|
21*9880d681SAndroid Build Coastguard Worker//    | SLOT2     |  XTYPE          ALU32     J         JR           |
22*9880d681SAndroid Build Coastguard Worker//    |-----------|--------------------------------------------------|
23*9880d681SAndroid Build Coastguard Worker//    | SLOT3     |  XTYPE          ALU32     J         CR           |
24*9880d681SAndroid Build Coastguard Worker//    |===========|==================================================|
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker// Functional Units.
27*9880d681SAndroid Build Coastguard Workerdef SLOT0       : FuncUnit;
28*9880d681SAndroid Build Coastguard Workerdef SLOT1       : FuncUnit;
29*9880d681SAndroid Build Coastguard Workerdef SLOT2       : FuncUnit;
30*9880d681SAndroid Build Coastguard Workerdef SLOT3       : FuncUnit;
31*9880d681SAndroid Build Coastguard Worker// Endloop is a pseudo instruction that is encoded with 2 bits in a packet
32*9880d681SAndroid Build Coastguard Worker// rather than taking an execution slot. This special unit is needed
33*9880d681SAndroid Build Coastguard Worker// to schedule an ENDLOOP with 4 other instructions.
34*9880d681SAndroid Build Coastguard Workerdef SLOT_ENDLOOP: FuncUnit;
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Worker// Itinerary classes.
37*9880d681SAndroid Build Coastguard Workerdef PSEUDO      : InstrItinClass;
38*9880d681SAndroid Build Coastguard Workerdef PSEUDOM     : InstrItinClass;
39*9880d681SAndroid Build Coastguard Worker// ALU64/M/S Instruction classes of V2 are collectively knownn as XTYPE in V4.
40*9880d681SAndroid Build Coastguard Workerdef DUPLEX      : InstrItinClass;
41*9880d681SAndroid Build Coastguard Workerdef PREFIX      : InstrItinClass;
42*9880d681SAndroid Build Coastguard Workerdef COMPOUND_CJ_ARCHDEPSLOT    : InstrItinClass;
43*9880d681SAndroid Build Coastguard Workerdef COMPOUND    : InstrItinClass;
44*9880d681SAndroid Build Coastguard Worker
45*9880d681SAndroid Build Coastguard Workerdef ALU32_2op_tc_1_SLOT0123  : InstrItinClass;
46*9880d681SAndroid Build Coastguard Workerdef ALU32_2op_tc_2early_SLOT0123  : InstrItinClass;
47*9880d681SAndroid Build Coastguard Workerdef ALU32_3op_tc_2early_SLOT0123  : InstrItinClass;
48*9880d681SAndroid Build Coastguard Workerdef ALU32_3op_tc_1_SLOT0123  : InstrItinClass;
49*9880d681SAndroid Build Coastguard Workerdef ALU32_3op_tc_2_SLOT0123  : InstrItinClass;
50*9880d681SAndroid Build Coastguard Workerdef ALU32_ADDI_tc_1_SLOT0123 : InstrItinClass;
51*9880d681SAndroid Build Coastguard Workerdef ALU64_tc_1_SLOT23        : InstrItinClass;
52*9880d681SAndroid Build Coastguard Workerdef ALU64_tc_1or2_SLOT23     : InstrItinClass;
53*9880d681SAndroid Build Coastguard Workerdef ALU64_tc_2_SLOT23        : InstrItinClass;
54*9880d681SAndroid Build Coastguard Workerdef ALU64_tc_2early_SLOT23   : InstrItinClass;
55*9880d681SAndroid Build Coastguard Workerdef ALU64_tc_3x_SLOT23       : InstrItinClass;
56*9880d681SAndroid Build Coastguard Workerdef CR_tc_2_SLOT3            : InstrItinClass;
57*9880d681SAndroid Build Coastguard Workerdef CR_tc_2early_SLOT23      : InstrItinClass;
58*9880d681SAndroid Build Coastguard Workerdef CR_tc_2early_SLOT3       : InstrItinClass;
59*9880d681SAndroid Build Coastguard Workerdef CR_tc_3x_SLOT23          : InstrItinClass;
60*9880d681SAndroid Build Coastguard Workerdef CR_tc_3x_SLOT3           : InstrItinClass;
61*9880d681SAndroid Build Coastguard Workerdef J_tc_2early_SLOT23       : InstrItinClass;
62*9880d681SAndroid Build Coastguard Workerdef J_tc_2early_CJUMP_UCJUMP_ARCHDEPSLOT       : InstrItinClass;
63*9880d681SAndroid Build Coastguard Workerdef J_tc_2early_SLOT2        : InstrItinClass;
64*9880d681SAndroid Build Coastguard Workerdef LD_tc_ld_SLOT01          : InstrItinClass;
65*9880d681SAndroid Build Coastguard Workerdef LD_tc_ld_SLOT0           : InstrItinClass;
66*9880d681SAndroid Build Coastguard Workerdef LD_tc_3or4stall_SLOT0    : InstrItinClass;
67*9880d681SAndroid Build Coastguard Workerdef M_tc_1_SLOT23            : InstrItinClass;
68*9880d681SAndroid Build Coastguard Workerdef M_tc_1or2_SLOT23         : InstrItinClass;
69*9880d681SAndroid Build Coastguard Workerdef M_tc_2_SLOT23            : InstrItinClass;
70*9880d681SAndroid Build Coastguard Workerdef M_tc_3_SLOT23            : InstrItinClass;
71*9880d681SAndroid Build Coastguard Workerdef M_tc_3x_SLOT23           : InstrItinClass;
72*9880d681SAndroid Build Coastguard Workerdef M_tc_3or4x_SLOT23        : InstrItinClass;
73*9880d681SAndroid Build Coastguard Workerdef ST_tc_st_SLOT01          : InstrItinClass;
74*9880d681SAndroid Build Coastguard Workerdef ST_tc_st_SLOT0           : InstrItinClass;
75*9880d681SAndroid Build Coastguard Workerdef ST_tc_ld_SLOT0           : InstrItinClass;
76*9880d681SAndroid Build Coastguard Workerdef ST_tc_3stall_SLOT0       : InstrItinClass;
77*9880d681SAndroid Build Coastguard Workerdef S_2op_tc_1_SLOT23        : InstrItinClass;
78*9880d681SAndroid Build Coastguard Workerdef S_2op_tc_2_SLOT23        : InstrItinClass;
79*9880d681SAndroid Build Coastguard Workerdef S_2op_tc_2early_SLOT23   : InstrItinClass;
80*9880d681SAndroid Build Coastguard Workerdef S_2op_tc_3or4x_SLOT23    : InstrItinClass;
81*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_1_SLOT23        : InstrItinClass;
82*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_1or2_SLOT23     : InstrItinClass;
83*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_2_SLOT23        : InstrItinClass;
84*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_2early_SLOT23   : InstrItinClass;
85*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_3_SLOT23        : InstrItinClass;
86*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_3x_SLOT23       : InstrItinClass;
87*9880d681SAndroid Build Coastguard Workerdef NCJ_tc_3or4stall_SLOT0   : InstrItinClass;
88*9880d681SAndroid Build Coastguard Workerdef V2LDST_tc_ld_SLOT01      : InstrItinClass;
89*9880d681SAndroid Build Coastguard Workerdef V2LDST_tc_st_SLOT0       : InstrItinClass;
90*9880d681SAndroid Build Coastguard Workerdef V2LDST_tc_st_SLOT01      : InstrItinClass;
91*9880d681SAndroid Build Coastguard Workerdef V4LDST_tc_ld_SLOT01      : InstrItinClass;
92*9880d681SAndroid Build Coastguard Workerdef V4LDST_tc_st_SLOT0       : InstrItinClass;
93*9880d681SAndroid Build Coastguard Workerdef V4LDST_tc_st_SLOT01      : InstrItinClass;
94*9880d681SAndroid Build Coastguard Workerdef J_tc_2early_SLOT0123     : InstrItinClass;
95*9880d681SAndroid Build Coastguard Workerdef EXTENDER_tc_1_SLOT0123   : InstrItinClass;
96*9880d681SAndroid Build Coastguard Workerdef S_3op_tc_3stall_SLOT23   : InstrItinClass;
97*9880d681SAndroid Build Coastguard Worker
98*9880d681SAndroid Build Coastguard Worker
99*9880d681SAndroid Build Coastguard Workerdef HexagonItinerariesV4 :
100*9880d681SAndroid Build Coastguard Worker      ProcessorItineraries<[SLOT0, SLOT1, SLOT2, SLOT3, SLOT_ENDLOOP], [], [
101*9880d681SAndroid Build Coastguard Worker        // ALU32
102*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU32_2op_tc_1_SLOT0123  ,
103*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
104*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU32_2op_tc_2early_SLOT0123,
105*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
106*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU32_3op_tc_1_SLOT0123   ,
107*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
108*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU32_3op_tc_2early_SLOT0123,
109*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
110*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU32_3op_tc_2_SLOT0123   ,
111*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
112*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU32_ADDI_tc_1_SLOT0123  ,
113*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
114*9880d681SAndroid Build Coastguard Worker
115*9880d681SAndroid Build Coastguard Worker        // ALU64
116*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU64_tc_1_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
117*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU64_tc_1or2_SLOT23   , [InstrStage<1, [SLOT2, SLOT3]>]>,
118*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU64_tc_2_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
119*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU64_tc_2early_SLOT23 , [InstrStage<1, [SLOT2, SLOT3]>]>,
120*9880d681SAndroid Build Coastguard Worker        InstrItinData<ALU64_tc_3x_SLOT23     , [InstrStage<1, [SLOT2, SLOT3]>]>,
121*9880d681SAndroid Build Coastguard Worker
122*9880d681SAndroid Build Coastguard Worker        // CR -> System
123*9880d681SAndroid Build Coastguard Worker        InstrItinData<CR_tc_2_SLOT3          , [InstrStage<1, [SLOT3]>]>,
124*9880d681SAndroid Build Coastguard Worker        InstrItinData<CR_tc_2early_SLOT3     , [InstrStage<1, [SLOT3]>]>,
125*9880d681SAndroid Build Coastguard Worker        InstrItinData<CR_tc_3x_SLOT3         , [InstrStage<1, [SLOT3]>]>,
126*9880d681SAndroid Build Coastguard Worker
127*9880d681SAndroid Build Coastguard Worker        // Jump (conditional/unconditional/return etc)
128*9880d681SAndroid Build Coastguard Worker        // CR
129*9880d681SAndroid Build Coastguard Worker        InstrItinData<CR_tc_2early_SLOT23    , [InstrStage<1, [SLOT2, SLOT3]>]>,
130*9880d681SAndroid Build Coastguard Worker        InstrItinData<CR_tc_3x_SLOT23        , [InstrStage<1, [SLOT2, SLOT3]>]>,
131*9880d681SAndroid Build Coastguard Worker        // J
132*9880d681SAndroid Build Coastguard Worker        InstrItinData<J_tc_2early_SLOT23     , [InstrStage<1, [SLOT2, SLOT3]>]>,
133*9880d681SAndroid Build Coastguard Worker        // JR
134*9880d681SAndroid Build Coastguard Worker        InstrItinData<J_tc_2early_SLOT2      , [InstrStage<1, [SLOT2]>]>,
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard Worker        //Load
137*9880d681SAndroid Build Coastguard Worker        InstrItinData<LD_tc_ld_SLOT01        , [InstrStage<1, [SLOT0, SLOT1]>]>,
138*9880d681SAndroid Build Coastguard Worker        InstrItinData<LD_tc_ld_SLOT0         , [InstrStage<1, [SLOT0]>]>,
139*9880d681SAndroid Build Coastguard Worker        InstrItinData<LD_tc_3or4stall_SLOT0  , [InstrStage<1, [SLOT0]>]>,
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard Worker        // M
142*9880d681SAndroid Build Coastguard Worker        InstrItinData<M_tc_1_SLOT23          , [InstrStage<1, [SLOT2, SLOT3]>]>,
143*9880d681SAndroid Build Coastguard Worker        InstrItinData<M_tc_1or2_SLOT23       , [InstrStage<1, [SLOT2, SLOT3]>]>,
144*9880d681SAndroid Build Coastguard Worker        InstrItinData<M_tc_2_SLOT23          , [InstrStage<1, [SLOT2, SLOT3]>]>,
145*9880d681SAndroid Build Coastguard Worker        InstrItinData<M_tc_3_SLOT23          , [InstrStage<1, [SLOT2, SLOT3]>]>,
146*9880d681SAndroid Build Coastguard Worker        InstrItinData<M_tc_3x_SLOT23         , [InstrStage<1, [SLOT2, SLOT3]>]>,
147*9880d681SAndroid Build Coastguard Worker        InstrItinData<M_tc_3or4x_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
148*9880d681SAndroid Build Coastguard Worker
149*9880d681SAndroid Build Coastguard Worker        // Store
150*9880d681SAndroid Build Coastguard Worker        // ST
151*9880d681SAndroid Build Coastguard Worker        InstrItinData<ST_tc_st_SLOT01        , [InstrStage<1, [SLOT0, SLOT1]>]>,
152*9880d681SAndroid Build Coastguard Worker        // ST0
153*9880d681SAndroid Build Coastguard Worker        InstrItinData<ST_tc_st_SLOT0         , [InstrStage<1, [SLOT0]>]>,
154*9880d681SAndroid Build Coastguard Worker        InstrItinData<ST_tc_ld_SLOT0         , [InstrStage<1, [SLOT0]>]>,
155*9880d681SAndroid Build Coastguard Worker
156*9880d681SAndroid Build Coastguard Worker        // S
157*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_2op_tc_1_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
158*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_2op_tc_2_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
159*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_2op_tc_2early_SLOT23 , [InstrStage<1, [SLOT2, SLOT3]>]>,
160*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_2op_tc_3or4x_SLOT23  , [InstrStage<1, [SLOT2, SLOT3]>]>,
161*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_3op_tc_1_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
162*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_3op_tc_1or2_SLOT23   , [InstrStage<1, [SLOT2, SLOT3]>]>,
163*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_3op_tc_2early_SLOT23 , [InstrStage<1, [SLOT2, SLOT3]>]>,
164*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_3op_tc_2_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
165*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_3op_tc_3_SLOT23      , [InstrStage<1, [SLOT2, SLOT3]>]>,
166*9880d681SAndroid Build Coastguard Worker        InstrItinData<S_3op_tc_3x_SLOT23     , [InstrStage<1, [SLOT2, SLOT3]>]>,
167*9880d681SAndroid Build Coastguard Worker
168*9880d681SAndroid Build Coastguard Worker        // SYS
169*9880d681SAndroid Build Coastguard Worker        InstrItinData<ST_tc_3stall_SLOT0     , [InstrStage<1, [SLOT0]>]>,
170*9880d681SAndroid Build Coastguard Worker
171*9880d681SAndroid Build Coastguard Worker        // New Value Compare Jump
172*9880d681SAndroid Build Coastguard Worker        InstrItinData<NCJ_tc_3or4stall_SLOT0 , [InstrStage<1, [SLOT0]>]>,
173*9880d681SAndroid Build Coastguard Worker
174*9880d681SAndroid Build Coastguard Worker        // Mem ops - MEM_V4
175*9880d681SAndroid Build Coastguard Worker        InstrItinData<V2LDST_tc_st_SLOT0     , [InstrStage<1, [SLOT0]>]>,
176*9880d681SAndroid Build Coastguard Worker        InstrItinData<V2LDST_tc_ld_SLOT01    , [InstrStage<1, [SLOT0, SLOT1]>]>,
177*9880d681SAndroid Build Coastguard Worker        InstrItinData<V2LDST_tc_st_SLOT01    , [InstrStage<1, [SLOT0, SLOT1]>]>,
178*9880d681SAndroid Build Coastguard Worker        InstrItinData<V4LDST_tc_st_SLOT0     , [InstrStage<1, [SLOT0]>]>,
179*9880d681SAndroid Build Coastguard Worker        InstrItinData<V4LDST_tc_ld_SLOT01    , [InstrStage<1, [SLOT0, SLOT1]>]>,
180*9880d681SAndroid Build Coastguard Worker        InstrItinData<V4LDST_tc_st_SLOT01    , [InstrStage<1, [SLOT0, SLOT1]>]>,
181*9880d681SAndroid Build Coastguard Worker
182*9880d681SAndroid Build Coastguard Worker        InstrItinData<DUPLEX , [InstrStage<1, [SLOT0]>]>,
183*9880d681SAndroid Build Coastguard Worker
184*9880d681SAndroid Build Coastguard Worker        // ENDLOOP
185*9880d681SAndroid Build Coastguard Worker        InstrItinData<J_tc_2early_SLOT0123   , [InstrStage<1, [SLOT_ENDLOOP]>]>,
186*9880d681SAndroid Build Coastguard Worker
187*9880d681SAndroid Build Coastguard Worker        // Extender/PREFIX
188*9880d681SAndroid Build Coastguard Worker        InstrItinData<EXTENDER_tc_1_SLOT0123,
189*9880d681SAndroid Build Coastguard Worker                     [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
190*9880d681SAndroid Build Coastguard Worker
191*9880d681SAndroid Build Coastguard Worker        InstrItinData<COMPOUND , [InstrStage<1, [SLOT2, SLOT3]>]>,
192*9880d681SAndroid Build Coastguard Worker        InstrItinData<PSEUDO , [InstrStage<1, [SLOT0, SLOT1, SLOT2, SLOT3]>]>,
193*9880d681SAndroid Build Coastguard Worker        InstrItinData<PSEUDOM, [InstrStage<1, [SLOT2, SLOT3], 0>,
194*9880d681SAndroid Build Coastguard Worker                                InstrStage<1, [SLOT2, SLOT3]>]>
195*9880d681SAndroid Build Coastguard Worker      ]>;
196*9880d681SAndroid Build Coastguard Worker
197*9880d681SAndroid Build Coastguard Workerdef HexagonModelV4 : SchedMachineModel {
198*9880d681SAndroid Build Coastguard Worker  // Max issue per cycle == bundle width.
199*9880d681SAndroid Build Coastguard Worker  let IssueWidth = 4;
200*9880d681SAndroid Build Coastguard Worker  let Itineraries = HexagonItinerariesV4;
201*9880d681SAndroid Build Coastguard Worker  let LoadLatency = 1;
202*9880d681SAndroid Build Coastguard Worker  let CompleteModel = 0;
203*9880d681SAndroid Build Coastguard Worker}
204*9880d681SAndroid Build Coastguard Worker
205*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
206*9880d681SAndroid Build Coastguard Worker// Hexagon V4 Resource Definitions -
207*9880d681SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===//
208