@@ -385,6 +385,8 @@ void PPCTargetInfo::getTargetDefines(const LangOptions &Opts,
385385 Builder.defineMacro (" _ARCH_PWR9" );
386386 if (ArchDefs & ArchDefinePwr10)
387387 Builder.defineMacro (" _ARCH_PWR10" );
388+ if (ArchDefs & ArchDefinePwr11)
389+ Builder.defineMacro (" _ARCH_PWR11" );
388390 if (ArchDefs & ArchDefineA2)
389391 Builder.defineMacro (" _ARCH_A2" );
390392 if (ArchDefs & ArchDefineE500)
@@ -622,10 +624,17 @@ bool PPCTargetInfo::initFeatureMap(
622624 addP10SpecificFeatures (Features);
623625 }
624626
625- // Future CPU should include all of the features of Power 10 as well as any
627+ // Power11 includes all the same features as Power10 plus any features
628+ // specific to the Power11 core.
629+ if (CPU == " pwr11" || CPU == " power11" ) {
630+ initFeatureMap (Features, Diags, " pwr10" , FeaturesVec);
631+ addP11SpecificFeatures (Features);
632+ }
633+
634+ // Future CPU should include all of the features of Power 11 as well as any
626635 // additional features (yet to be determined) specific to it.
627636 if (CPU == " future" ) {
628- initFeatureMap (Features, Diags, " pwr10 " , FeaturesVec);
637+ initFeatureMap (Features, Diags, " pwr11 " , FeaturesVec);
629638 addFutureSpecificFeatures (Features);
630639 }
631640
@@ -696,6 +705,10 @@ void PPCTargetInfo::addP10SpecificFeatures(
696705 Features[" isa-v31-instructions" ] = true ;
697706}
698707
708+ // Add any Power11 specific features.
709+ void PPCTargetInfo::addP11SpecificFeatures (
710+ llvm::StringMap<bool > &Features) const {}
711+
699712// Add features specific to the "Future" CPU.
700713void PPCTargetInfo::addFutureSpecificFeatures (
701714 llvm::StringMap<bool > &Features) const {}
@@ -870,17 +883,17 @@ ArrayRef<TargetInfo::AddlRegName> PPCTargetInfo::getGCCAddlRegNames() const {
870883}
871884
872885static constexpr llvm::StringLiteral ValidCPUNames[] = {
873- {" generic" }, {" 440" }, {" 450" }, {" 601" }, {" 602" },
874- {" 603" }, {" 603e" }, {" 603ev" }, {" 604" }, {" 604e" },
875- {" 620" }, {" 630" }, {" g3" }, {" 7400" }, {" g4" },
876- {" 7450" }, {" g4+" }, {" 750" }, {" 8548" }, {" 970" },
877- {" g5" }, {" a2" }, {" e500" }, {" e500mc" }, {" e5500" },
878- {" power3" }, {" pwr3" }, {" power4" }, {" pwr4" }, {" power5" },
879- {" pwr5" }, {" power5x" }, {" pwr5x" }, {" power6" }, {" pwr6" },
880- {" power6x" }, {" pwr6x" }, {" power7" }, {" pwr7" }, {" power8" },
881- {" pwr8" }, {" power9" }, {" pwr9" }, {" power10" }, {" pwr10" },
882- {" powerpc " }, { " ppc " }, { " ppc32 " }, { " powerpc64 " }, { " ppc64 " },
883- {" powerpc64le" }, {" ppc64le" }, {" future" }};
886+ {" generic" }, {" 440" }, {" 450" }, {" 601" }, {" 602" },
887+ {" 603" }, {" 603e" }, {" 603ev" }, {" 604" }, {" 604e" },
888+ {" 620" }, {" 630" }, {" g3" }, {" 7400" }, {" g4" },
889+ {" 7450" }, {" g4+" }, {" 750" }, {" 8548" }, {" 970" },
890+ {" g5" }, {" a2" }, {" e500" }, {" e500mc" }, {" e5500" },
891+ {" power3" }, {" pwr3" }, {" power4" }, {" pwr4" }, {" power5" },
892+ {" pwr5" }, {" power5x" }, {" pwr5x" }, {" power6" }, {" pwr6" },
893+ {" power6x" }, {" pwr6x" }, {" power7" }, {" pwr7" }, {" power8" },
894+ {" pwr8" }, {" power9" }, {" pwr9" }, {" power10" }, {" pwr10" },
895+ {" power11 " }, { " pwr11 " }, { " powerpc " }, { " ppc " }, { " ppc32 " },
896+ {" powerpc64 " }, { " ppc64 " }, { " powerpc64le" }, {" ppc64le" }, {" future" }};
884897
885898bool PPCTargetInfo::isValidCPUName (StringRef Name) const {
886899 return llvm::is_contained (ValidCPUNames, Name);
0 commit comments