Index: llvm/lib/Target/PowerPC/PPC.td =================================================================== --- llvm/lib/Target/PowerPC/PPC.td +++ llvm/lib/Target/PowerPC/PPC.td @@ -209,36 +209,80 @@ // came before them, the idea is to make implementations of new processors // less error prone and easier to read. // Namely: -// list Power8FeatureList = ... -// list FutureProcessorSpecificFeatureList = -// [ features that Power8 does not support ] -// list FutureProcessorFeatureList = -// !listconcat(Power8FeatureList, FutureProcessorSpecificFeatureList) +// list P8InheritableFeatures = ... +// list FutureProcessorAddtionalFeatures = +// [ features that Power8 does not support but inheritable ] +// list FutureProcessorSpecificFeatures = +// [ features that Power8 does not support and not inheritable ] +// list FutureProcessorInheritableFeatures = +// !listconcat(P8InheritableFeatures, FutureProcessorAddtionalFeatures) +// list FutureProcessorFeatures = +// !listconcat(FutureProcessorInheritableFeatures, +// FutureProcessorSpecificFeatures) // Makes it explicit and obvious what is new in FutureProcesor vs. Power8 as // well as providing a single point of definition if the feature set will be // used elsewhere. def ProcessorFeatures { - list Power7FeatureList = - [DirectivePwr7, FeatureAltivec, FeatureVSX, - FeatureMFOCRF, FeatureFCPSGN, FeatureFSqrt, FeatureFRE, - FeatureFRES, FeatureFRSQRTE, FeatureFRSQRTES, - FeatureRecipPrec, FeatureSTFIWX, FeatureLFIWAX, - FeatureFPRND, FeatureFPCVT, FeatureISEL, - FeaturePOPCNTD, FeatureCMPB, FeatureLDBRX, - Feature64Bit /*, Feature64BitRegs */, - FeatureBPERMD, FeatureExtDiv, - FeatureMFTB, DeprecatedDST, FeatureTwoConstNR]; - list Power8SpecificFeatures = - [DirectivePwr8, FeatureP8Altivec, FeatureP8Vector, FeatureP8Crypto, - FeatureHTM, FeatureDirectMove, FeatureICBT, FeaturePartwordAtomic]; - list Power8FeatureList = - !listconcat(Power7FeatureList, Power8SpecificFeatures); - list Power9SpecificFeatures = - [DirectivePwr9, FeatureP9Altivec, FeatureP9Vector, FeatureISA3_0, - FeatureVectorsUseTwoUnits, FeaturePPCPreRASched, FeaturePPCPostRASched]; - list Power9FeatureList = - !listconcat(Power8FeatureList, Power9SpecificFeatures); + // Power7 + list P7InheritableFeatures = [DirectivePwr7, + FeatureAltivec, + FeatureVSX, + FeatureMFOCRF, + FeatureFCPSGN, + FeatureFSqrt, + FeatureFRE, + FeatureFRES, + FeatureFRSQRTE, + FeatureFRSQRTES, + FeatureRecipPrec, + FeatureSTFIWX, + FeatureLFIWAX, + FeatureFPRND, + FeatureFPCVT, + FeatureISEL, + FeaturePOPCNTD, + FeatureCMPB, + FeatureLDBRX, + Feature64Bit, + /* Feature64BitRegs, */ + FeatureBPERMD, + FeatureExtDiv, + FeatureMFTB, + DeprecatedDST, + FeatureTwoConstNR]; + list P7SpecificFeatures = []; + list P7Features = + !listconcat(P7InheritableFeatures, P7SpecificFeatures); + + // Power8 + list P8AdditionalFeatures = [DirectivePwr8, + FeatureP8Altivec, + FeatureP8Vector, + FeatureP8Crypto, + FeatureHTM, + FeatureDirectMove, + FeatureICBT, + FeaturePartwordAtomic]; + list P8SpecificFeatures = []; + list P8InheritableFeatures = + !listconcat(P7InheritableFeatures, P8AdditionalFeatures); + list P8Features = + !listconcat(P8InheritableFeatures, P8SpecificFeatures); + + // Power9 + list P9AdditionalFeatures = [DirectivePwr9, + FeatureP9Altivec, + FeatureP9Vector, + FeatureISA3_0, + FeatureVectorsUseTwoUnits, + FeaturePPCPreRASched, + FeaturePPCPostRASched]; + list P9SpecificFeatures = []; + list P9InheritableFeatures = + !listconcat(P8InheritableFeatures, P9AdditionalFeatures); + list P9Features = + !listconcat(P9InheritableFeatures, P9SpecificFeatures); } // Note: Future features to add when support is extended to more @@ -438,9 +482,9 @@ FeatureSTFIWX, FeatureLFIWAX, FeatureCMPB, FeatureFPRND, Feature64Bit, FeatureMFTB, DeprecatedDST]>; -def : ProcessorModel<"pwr7", P7Model, ProcessorFeatures.Power7FeatureList>; -def : ProcessorModel<"pwr8", P8Model, ProcessorFeatures.Power8FeatureList>; -def : ProcessorModel<"pwr9", P9Model, ProcessorFeatures.Power9FeatureList>; +def : ProcessorModel<"pwr7", P7Model, ProcessorFeatures.P7Features>; +def : ProcessorModel<"pwr8", P8Model, ProcessorFeatures.P8Features>; +def : ProcessorModel<"pwr9", P9Model, ProcessorFeatures.P9Features>; def : Processor<"ppc", G3Itineraries, [Directive32, FeatureHardFloat, FeatureMFTB]>; def : Processor<"ppc32", G3Itineraries, [Directive32, FeatureHardFloat, @@ -451,7 +495,7 @@ FeatureFRSQRTE, FeatureSTFIWX, Feature64Bit /*, Feature64BitRegs */, FeatureMFTB]>; -def : ProcessorModel<"ppc64le", P8Model, ProcessorFeatures.Power8FeatureList>; +def : ProcessorModel<"ppc64le", P8Model, ProcessorFeatures.P8Features>; //===----------------------------------------------------------------------===// // Calling Conventions