Skip to content

Commit 8c5e131

Browse files
ayrtonmchinmaydd
authored andcommitted
WIP Start mapping e500 itinerary model to new scheduling model
See comment on `class WriteRes` in llvm/include/llvm/Target/TargetSchedule.td for a starting point on how to map the old (itinerary) model to the new scheduling model. As far as I've seen ARMScheduleA9.td is the only cpu model currently doing this mapping so this work is based off of that and the existing info in the e500 model.
1 parent 08b6ac6 commit 8c5e131

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

llvm/lib/Target/PowerPC/PPCScheduleE500.td

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,87 @@ def PPCE500Model : SchedMachineModel {
273273
// This is overriden by OperandCycles if the
274274
// Itineraries are queried instead.
275275

276+
let MicroOpBufferSize = 14;
276277
let CompleteModel = 0;
277278

278279
let Itineraries = PPCE500Itineraries;
279280
}
281+
282+
let SchedModel = PPCE500Model in {
283+
284+
// ********** Processor Resources **********
285+
def DIS: ProcResource<2>;
286+
def SU: ProcResource<2>;
287+
def BU: ProcResource<1>;
288+
def MU: ProcResource<1>;
289+
def LSU: ProcResource<1>;
290+
291+
// ********** SchedWriteRes Definitions **********
292+
def DIS_1C : SchedWriteRes<[DIS]> {}
293+
def SU_1C : SchedWriteRes<[SU]> { }
294+
def BU_1C : SchedWriteRes<[BU]> { }
295+
def MU_1C : SchedWriteRes<[MU]> { }
296+
def LSU_1C : SchedWriteRes<[LSU]> { }
297+
def LSU_6C : SchedWriteRes<[LSU]> {
298+
let Latency = 6;
299+
}
300+
301+
// double check these SchedWriteRes choices
302+
def : ItinRW<[SU_1C, DIS_1C], [IIC_IntSimple]>;
303+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStSTU]>;
304+
305+
// using dummy values from previous entry
306+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntGeneral]>;
307+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntISEL]>;
308+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntCompare]>;
309+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntDivW]>;
310+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntMulHW]>;
311+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntMulHWU]>;
312+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntMulLI]>;
313+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntRotate]>;
314+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntShift]>;
315+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_IntTrapW]>;
316+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_BrB]>;
317+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_BrCR]>;
318+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_BrMCR]>;
319+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_BrMCRX]>;
320+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStDCBA]>;
321+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStDCBF]>;
322+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStDCBI]>;
323+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLoad]>;
324+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLoadUpd]>;
325+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLoadUpdX]>;
326+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStStore]>;
327+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStSTUX]>;
328+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStICBI]>;
329+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLHA]>;
330+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLHAU]>;
331+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLHAUX]>;
332+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLMW]>;
333+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStLWARX]>;
334+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStSTWCX]>;
335+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_LdStSync]>;
336+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFSR]>;
337+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMTMSR]>;
338+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMTSR]>;
339+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprTLBSYNC]>;
340+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFCR]>;
341+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFCRF]>;
342+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFPMR]>;
343+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFMSR]>;
344+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFSPR]>;
345+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMTPMR]>;
346+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMFTB]>;
347+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMTSPR]>;
348+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprMTSRIN]>;
349+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_FPDGeneral]>;
350+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_FPSGeneral]>;
351+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_FPDivD]>;
352+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_FPDivS]>;
353+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_VecGeneral]>;
354+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_VecComplex]>;
355+
356+
// not included as part of the original e500 itinerary-based model
357+
def : ItinRW<[LSU_6C, SU_1C, DIS_1C], [IIC_SprISYNC]>;
358+
359+
} // SchedModel = PPCE500Model

0 commit comments

Comments
 (0)