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 | // |
Jim Laskey | f5fc2cb | 2005-10-21 19:05:19 +0000 | [diff] [blame] | 31 | class InstrStage<int cycles, list<FuncUnit> units> { |
| 32 | int Cycles = cycles; // length of stage in machine cycles |
Jim Laskey | 076866c | 2005-10-18 16:23:40 +0000 | [diff] [blame] | 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; |
Chris Lattner | 3b0d1d7 | 2006-01-27 01:41:38 +0000 | [diff] [blame] | 50 | def NoItinerary : InstrItinClass; |
Jim Laskey | 076866c | 2005-10-18 16:23:40 +0000 | [diff] [blame] | 51 | |
| 52 | //===----------------------------------------------------------------------===// |
| 53 | // Instruction itinerary data - These values provide a runtime map of an |
| 54 | // instruction itinerary class (name) to it's itinerary data. |
| 55 | // |
| 56 | class 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 Laskey | 0de8796 | 2005-10-19 13:34:52 +0000 | [diff] [blame] | 65 | class ProcessorItineraries<list<InstrItinData> iid> { |
Jim Laskey | 076866c | 2005-10-18 16:23:40 +0000 | [diff] [blame] | 66 | list<InstrItinData> IID = iid; |
| 67 | } |
Chris Lattner | f690e6f | 2005-10-23 22:07:20 +0000 | [diff] [blame] | 68 | |
| 69 | // NoItineraries - A marker that can be used by processors without schedule |
| 70 | // info. |
| 71 | def NoItineraries : ProcessorItineraries<[]>; |
| 72 | |