diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-02-01 02:14:03 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-02-01 02:14:03 +0000 |
commit | 199402b9e081dedc28e19ab6e727470b34f2f64d (patch) | |
tree | 5346e9860482fe16144fc18355e74f56ad33b1d8 /lib/Driver/Tools.cpp | |
parent | a31f65b10e61ca8f2f427b1df176c10ea8a0efa2 (diff) |
Enable -fno-altivec, -mno-altivec for PowerPC.
Introduces these negation forms explicitly and uses them to control a new
"altivec" target feature for PowerPC. This allows avoiding generating
Altivec instructions on processors that support Altivec.
The new test case verifies that the Altivec "lvx" instruction is not
used when -fno-altivec is present on the command line.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174140 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index cb7cc2381d..844367ee44 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1084,6 +1084,12 @@ void Clang::AddPPCTargetArgs(const ArgList &Args, CmdArgs.push_back("-target-cpu"); CmdArgs.push_back(Args.MakeArgString(TargetCPUName.c_str())); } + + // Allow override of the Altivec feature. + if (Args.hasFlag(options::OPT_fno_altivec, options::OPT_faltivec, false)) { + CmdArgs.push_back("-target-feature"); + CmdArgs.push_back("-altivec"); + } } void Clang::AddSparcTargetArgs(const ArgList &Args, |