Add -mqpx and -mno-qpx feature flags to toggle use of the PPC QPX vector instruction set
I've renamed the altivec test to ppc-features (because now there is more than one feature to test). llvm-svn: 174204
This commit is contained in:
parent
dbf46a16c7
commit
b58ce85ecc
|
@ -811,6 +811,8 @@ def mabi_EQ : Joined<["-"], "mabi=">, Group<m_Group>;
|
|||
def march_EQ : Joined<["-"], "march=">, Group<m_Group>;
|
||||
def maltivec : Flag<["-"], "maltivec">, Alias<faltivec>;
|
||||
def mno_altivec : Flag<["-"], "mno-altivec">, Alias<fno_altivec>;
|
||||
def mqpx : Flag<["-"], "mqpx">, Group<m_Group>;
|
||||
def mno_qpx : Flag<["-"], "mno-qpx">, Group<m_Group>;
|
||||
def mcmodel_EQ : Joined<["-"], "mcmodel=">, Group<m_Group>;
|
||||
def mconstant_cfstrings : Flag<["-"], "mconstant-cfstrings">, Group<clang_ignored_m_Group>;
|
||||
def mcpu_EQ : Joined<["-"], "mcpu=">, Group<m_Group>;
|
||||
|
|
|
@ -946,12 +946,14 @@ void PPCTargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
|
|||
.Case("pwr7", true)
|
||||
.Case("ppc64", true)
|
||||
.Default(false);
|
||||
|
||||
Features["qpx"] = (CPU == "a2q");
|
||||
}
|
||||
|
||||
bool PPCTargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
|
||||
StringRef Name,
|
||||
bool Enabled) const {
|
||||
if (Name == "altivec") {
|
||||
if (Name == "altivec" || Name == "qpx") {
|
||||
Features[Name] = Enabled;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1091,6 +1091,11 @@ void Clang::AddPPCTargetArgs(const ArgList &Args,
|
|||
CmdArgs.push_back("-target-feature");
|
||||
CmdArgs.push_back("-altivec");
|
||||
}
|
||||
|
||||
if (Args.hasFlag(options::OPT_mno_qpx, options::OPT_mqpx, false)) {
|
||||
CmdArgs.push_back("-target-feature");
|
||||
CmdArgs.push_back("-qpx");
|
||||
}
|
||||
}
|
||||
|
||||
void Clang::AddSparcTargetArgs(const ArgList &Args,
|
||||
|
|
|
@ -62,3 +62,9 @@
|
|||
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -fno-altivec -mcpu=ppc64 -### -o %t.o 2>&1 | FileCheck --check-prefix=CHECK-15 %s
|
||||
// CHECK-15: "-target-feature" "-altivec"
|
||||
|
||||
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-NOQPX %s
|
||||
// CHECK-NOQPX: "-target-feature" "-qpx"
|
||||
|
||||
// RUN: %clang -target powerpc64-unknown-linux-gnu %s -mno-qpx -mqpx -### -o %t.o 2>&1 | FileCheck -check-prefix=CHECK-QPX %s
|
||||
// CHECK-QPX-NOT: "-target-feature" "-qpx"
|
||||
|
Loading…
Reference in New Issue