gcc provides -mpopcntd and -mno-popcntd for controlling the popcntd target
feature; support these options as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178235
91177308-0d34-0410-b5e6-
96231b3b80d8
def mno_altivec : Flag<["-"], "mno-altivec">, Alias<fno_altivec>;
def mmfcrf : Flag<["-"], "mmfcrf">, Group<m_Group>;
def mno_mfcrf : Flag<["-"], "mno-mfcrf">, Group<m_Group>;
+def mpopcntd : Flag<["-"], "mpopcntd">, Group<m_Group>;
+def mno_popcntd : Flag<["-"], "mno-popcntd">, Group<m_Group>;
def mqpx : Flag<["-"], "mqpx">, Group<m_Group>;
def mno_qpx : Flag<["-"], "mno-qpx">, Group<m_Group>;
def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>;
bool PPCTargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
StringRef Name,
bool Enabled) const {
- if (Name == "altivec" || Name == "mfocrf" || Name == "qpx") {
+ if (Name == "altivec" || Name == "mfocrf" || Name == "popcntd" ||
+ Name == "qpx") {
Features[Name] = Enabled;
return true;
}
options::OPT_mmfcrf, options::OPT_mno_mfcrf,
"mfocrf");
+ AddTargetFeature(Args, CmdArgs,
+ options::OPT_mpopcntd, options::OPT_mno_popcntd,
+ "popcntd");
+
// It is really only possible to turn qpx off because turning qpx on is tied
// to using the a2q CPU.
if (Args.hasFlag(options::OPT_mno_qpx, options::OPT_mqpx, false)) {
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-mfcrf -mmfcrf -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-MFCRF %s
// CHECK-MFCRF: "-target-feature" "+mfocrf"
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOPOPCNTD %s
+// CHECK-NOPOPCNTD: "-target-feature" "-popcntd"
+
+// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-popcntd -mpopcntd -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-POPCNTD %s
+// CHECK-POPCNTD: "-target-feature" "+popcntd"
+