summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorUlrich Weigand <ulrich.weigand@de.ibm.com>2015-07-30 14:08:36 +0000
committerUlrich Weigand <ulrich.weigand@de.ibm.com>2015-07-30 14:08:36 +0000
commit3c5038a535c8a70a23ee8259efab875233732163 (patch)
tree6e76992d696e4934ce415139a05f38c141d776b7 /clang/lib/Frontend/CompilerInvocation.cpp
parent40631133b4997c593bd2af7877ae71c2461727c5 (diff)
downloadbcm5719-llvm-3c5038a535c8a70a23ee8259efab875233732163.tar.gz
bcm5719-llvm-3c5038a535c8a70a23ee8259efab875233732163.zip
Add support for System z vector language extensions
The z13 vector facility has an associated language extension, closely modeled on AltiVec/VSX. The main differences are: - vector long, vector float and vector pixel are not supported - vector long long and vector double are supported (like VSX) - comparison operators return a vector rather than a scalar integer - shift operators behave like the OpenCL shift operators - vector bool is only supported as argument to certain operators; some operators allow mixing a bool with a non-bool vector This patch adds clang support for the extension. It is closely modelled on the AltiVec support. Similarly to the -faltivec option, there's a new -fzvector option to enable the extensions (as well as an -mzvector alias for compatibility with GCC). There's also a separate LangOpt. The extension as implemented here is intended to be compatible with the -mzvector extension recently implemented by GCC. Based on a patch by Richard Sandiford. Differential Revision: http://reviews.llvm.org/D11001 llvm-svn: 243642
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 2fdbcb9ac43..b496c7c01a9 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1264,6 +1264,7 @@ void CompilerInvocation::setLangDefaults(LangOptions &Opts, InputKind IK,
// OpenCL has some additional defaults.
if (Opts.OpenCL) {
Opts.AltiVec = 0;
+ Opts.ZVector = 0;
Opts.CXXOperatorNames = 1;
Opts.LaxVectorConversions = 0;
Opts.DefaultFPContract = 1;
@@ -1452,6 +1453,9 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
if (Args.hasArg(OPT_faltivec))
Opts.AltiVec = 1;
+ if (Args.hasArg(OPT_fzvector))
+ Opts.ZVector = 1;
+
if (Args.hasArg(OPT_pthread))
Opts.POSIXThreads = 1;
OpenPOWER on IntegriCloud