blob: 38461c5a380ed79c8a356af6319714e603499c02 [file] [log] [blame]
Jim Laskey076866c2005-10-18 16:23:40 +00001//===- TargetSchedule.td - Target Independent Scheduling ---*- tablegen -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey076866c2005-10-18 16:23:40 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file defines the target-independent scheduling interfaces which should
11// be implemented by each target which is using TableGen based scheduling.
12//
13//===----------------------------------------------------------------------===//
14
15//===----------------------------------------------------------------------===//
Jim Laskey076866c2005-10-18 16:23:40 +000016// Processor functional unit - These values represent the function units
17// available across all chip sets for the target. Eg., IntUnit, FPUnit, ...
18// These may be independent values for each chip set or may be shared across
19// all chip sets of the target. Each functional unit is treated as a resource
20// during scheduling and has an affect instruction order based on availability
21// during a time interval.
22//
23class FuncUnit;
24
25//===----------------------------------------------------------------------===//
26// Instruction stage - These values represent a step in the execution of an
27// instruction. The latency represents the number of discrete time slots used
28// need to complete the stage. Units represent the choice of functional units
29// that can be used to complete the stage. Eg. IntUnit1, IntUnit2.
30//
Jim Laskeyf5fc2cb2005-10-21 19:05:19 +000031class InstrStage<int cycles, list<FuncUnit> units> {
32 int Cycles = cycles; // length of stage in machine cycles
Jim Laskey076866c2005-10-18 16:23:40 +000033 list<FuncUnit> Units = units; // choice of functional units
34}
35
36//===----------------------------------------------------------------------===//
37// Instruction itinerary - An itinerary represents a sequential series of steps
38// required to complete an instruction. Itineraries are represented as lists of
39// instruction stages.
40//
41
42//===----------------------------------------------------------------------===//
43// Instruction itinerary classes - These values represent 'named' instruction
44// itinerary. Using named itineraries simplifies managing groups of
45// instructions across chip sets. An instruction uses the same itinerary class
46// across all chip sets. Thus a new chip set can be added without modifying
47// instruction information.
48//
49class InstrItinClass;
Chris Lattner3b0d1d72006-01-27 01:41:38 +000050def NoItinerary : InstrItinClass;
Jim Laskey076866c2005-10-18 16:23:40 +000051
52//===----------------------------------------------------------------------===//
53// Instruction itinerary data - These values provide a runtime map of an
54// instruction itinerary class (name) to it's itinerary data.
55//
56class InstrItinData<InstrItinClass Class, list<InstrStage> stages> {
57 InstrItinClass TheClass = Class;
58 list<InstrStage> Stages = stages;
59}
60
61//===----------------------------------------------------------------------===//
62// Processor itineraries - These values represent the set of all itinerary
63// classes for a given chip set.
64//
Jim Laskey0de87962005-10-19 13:34:52 +000065class ProcessorItineraries<list<InstrItinData> iid> {
Jim Laskey076866c2005-10-18 16:23:40 +000066 list<InstrItinData> IID = iid;
67}
Chris Lattnerf690e6f2005-10-23 22:07:20 +000068
69// NoItineraries - A marker that can be used by processors without schedule
70// info.
71def NoItineraries : ProcessorItineraries<[]>;
72