diff --git a/lib/Target/PowerPC/PPCSchedule.td b/lib/Target/PowerPC/PPCSchedule.td index dc12e76f7ff..f02e52d39ce 100644 --- a/lib/Target/PowerPC/PPCSchedule.td +++ b/lib/Target/PowerPC/PPCSchedule.td @@ -7,20 +7,11 @@ // //===----------------------------------------------------------------------===// -#include "../TargetSchedule.td" - -//===----------------------------------------------------------------------===// -// PowerPC chips sets supported by scheduling (Apple naming) -// -def G3 : Processor; -def G4 : Processor; -def G4Plus : Processor; -def G5 : Processor; +#include "../Target.td" //===----------------------------------------------------------------------===// // Functional units across PowerPC chips sets // -def NoUnit : FuncUnit; // Instruction not supported on chip set def BPU : FuncUnit; // Branch unit def SLU : FuncUnit; // Store/load unit def SRU : FuncUnit; // special register unit @@ -518,3 +509,38 @@ def VecVSR : InstrItinClass; // xoris IntGeneral // + +//===----------------------------------------------------------------------===// +// PowerPC Subtarget features. +// + +def F64Bit : SubtargetFeature<"64bit", + "Should 64 bit instructions be used">; +def F64BitRegs : SubtargetFeature<"64bitregs", + "Should 64 bit registers be used">; +def FAltivec : SubtargetFeature<"altivec", + "Should Altivec instructions be used">; +def FGPUL : SubtargetFeature<"gpul", + "Should GPUL instructions be used">; +def FFSQRT : SubtargetFeature<"fsqrt", + "Should the fsqrt instruction be used">; + +//===----------------------------------------------------------------------===// +// PowerPC chips sets supported +// + +def : Processor<"601", G3Itineraries, []>; +def : Processor<"602", G3Itineraries, []>; +def : Processor<"603", G3Itineraries, []>; +def : Processor<"604", G3Itineraries, []>; +def : Processor<"750", G3Itineraries, []>; +def : Processor<"7400", G4Itineraries, [FAltivec]>; +def : Processor<"g4", G4Itineraries, [FAltivec]>; +def : Processor<"7450", G4PlusItineraries, [FAltivec]>; +def : Processor<"g4+", G4PlusItineraries, [FAltivec]>; +def : Processor<"970", G5Itineraries, + [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; +def : Processor<"g5", G5Itineraries, + [FAltivec, FGPUL, FFSQRT, F64Bit, F64BitRegs]>; + + diff --git a/lib/Target/PowerPC/PPCScheduleG3.td b/lib/Target/PowerPC/PPCScheduleG3.td index 3931e2084b6..30cc8652c7c 100644 --- a/lib/Target/PowerPC/PPCScheduleG3.td +++ b/lib/Target/PowerPC/PPCScheduleG3.td @@ -12,7 +12,7 @@ //===----------------------------------------------------------------------===// -def G3Itineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, diff --git a/lib/Target/PowerPC/PPCScheduleG4.td b/lib/Target/PowerPC/PPCScheduleG4.td index 6984ae9b0a6..2b1818a24fb 100644 --- a/lib/Target/PowerPC/PPCScheduleG4.td +++ b/lib/Target/PowerPC/PPCScheduleG4.td @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -def G4Itineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, diff --git a/lib/Target/PowerPC/PPCScheduleG4Plus.td b/lib/Target/PowerPC/PPCScheduleG4Plus.td index 7d028c2c657..d5b95289c68 100644 --- a/lib/Target/PowerPC/PPCScheduleG4Plus.td +++ b/lib/Target/PowerPC/PPCScheduleG4Plus.td @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -def G4PlusItineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, diff --git a/lib/Target/PowerPC/PPCScheduleG5.td b/lib/Target/PowerPC/PPCScheduleG5.td index 4738b892992..a34ff9909d0 100644 --- a/lib/Target/PowerPC/PPCScheduleG5.td +++ b/lib/Target/PowerPC/PPCScheduleG5.td @@ -11,7 +11,7 @@ // //===----------------------------------------------------------------------===// -def G5Itineraries : ProcessorItineraries]>, InstrItinData]>, InstrItinData]>, diff --git a/lib/Target/Target.td b/lib/Target/Target.td index 4e362231237..994a71df21b 100644 --- a/lib/Target/Target.td +++ b/lib/Target/Target.td @@ -241,6 +241,45 @@ class Target { list AssemblyWriters = [DefaultAsmWriter]; } +//===----------------------------------------------------------------------===// +// Pull in the common support for scheduling +// +include "../TargetSchedule.td" + +//===----------------------------------------------------------------------===// +// SubtargetFeature - A characteristic of the chip set. +// +class SubtargetFeature { + // Name - Feature name. Used by command line (-mattr=) to determine the + // appropriate target chip. + // + string Name = n; + + // Desc - Feature description. Used by command line (-mattr=) to display help + // information. + // + string Desc = d; +} + +//===----------------------------------------------------------------------===// +// Processor chip sets - These values represent each of the chip sets supported +// by the scheduler. Each Processor definition requires corresponding +// instruction itineraries. +// +class Processor f> { + // Name - Chip set name. Used by command line (-mcpu=) to determine the + // appropriate target chip. + // + string Name = n; + + // ProcItin - The scheduling information for the target processor. + // + ProcessorItineraries ProcItin = pi; + + // Features - list of + list Features; +} + //===----------------------------------------------------------------------===// // Pull in the common support for DAG isel generation // diff --git a/lib/Target/TargetSchedule.td b/lib/Target/TargetSchedule.td index 9b4ad022d81..89c00cdc702 100644 --- a/lib/Target/TargetSchedule.td +++ b/lib/Target/TargetSchedule.td @@ -12,13 +12,6 @@ // //===----------------------------------------------------------------------===// -//===----------------------------------------------------------------------===// -// Processor chip sets - These values represent each of the chip sets supported -// by the scheduler. Each Processor definition requires corresponding -// instruction itineraries. -// -class Processor; - //===----------------------------------------------------------------------===// // Processor functional unit - These values represent the function units // available across all chip sets for the target. Eg., IntUnit, FPUnit, ... @@ -68,7 +61,6 @@ class InstrItinData stages> { // Processor itineraries - These values represent the set of all itinerary // classes for a given chip set. // -class ProcessorItineraries iid> { - Processor Proc = proc; +class ProcessorItineraries iid> { list IID = iid; }