Jim Laskey | 076866c | 2005-10-18 16:23:40 +0000 | [diff] [blame] | 1 | //===- TargetSchedule.td - Target Independent Scheduling ---*- tablegen -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by James M. Laskey and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | // |
| 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 Laskey | 076866c | 2005-10-18 16:23:40 +0000 | [diff] [blame] | 16 | // 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 | // |
| 23 | class 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 | // |
| 31 | class InstrStage<int latency, list<FuncUnit> units> { |
| 32 | int Latency = latency; // length of stage in machine cycles |
| 33 | 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 | // |
| 49 | class InstrItinClass; |
| 50 | |
| 51 | //===----------------------------------------------------------------------===// |
| 52 | // Instruction itinerary data - These values provide a runtime map of an |
| 53 | // instruction itinerary class (name) to it's itinerary data. |
| 54 | // |
| 55 | class InstrItinData<InstrItinClass Class, list<InstrStage> stages> { |
| 56 | InstrItinClass TheClass = Class; |
| 57 | list<InstrStage> Stages = stages; |
| 58 | } |
| 59 | |
| 60 | //===----------------------------------------------------------------------===// |
| 61 | // Processor itineraries - These values represent the set of all itinerary |
| 62 | // classes for a given chip set. |
| 63 | // |
Jim Laskey | 0de8796 | 2005-10-19 13:34:52 +0000 | [diff] [blame^] | 64 | class ProcessorItineraries<list<InstrItinData> iid> { |
Jim Laskey | 076866c | 2005-10-18 16:23:40 +0000 | [diff] [blame] | 65 | list<InstrItinData> IID = iid; |
| 66 | } |