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 | 2fe4c67374ae453dd652c311677e52e0181df518 (patch) | |
tree | 6c8d67634d023d9f6e096a495565a9909175f3f8 /clang/lib/Driver/Tools.cpp | |
parent | af02bbe84f653125d50bfded5f854baf48c307f9 (diff) | |
download | bcm5719-llvm-2fe4c67374ae453dd652c311677e52e0181df518.tar.gz bcm5719-llvm-2fe4c67374ae453dd652c311677e52e0181df518.zip |
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.
llvm-svn: 174140
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index cb7cc2381da..844367ee441 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/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, |