Add support for System z vector language extensions
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Thu, 30 Jul 2015 14:08:36 +0000 (14:08 +0000)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Thu, 30 Jul 2015 14:08:36 +0000 (14:08 +0000)
commit3c5038a535c8a70a23ee8259efab875233732163
tree6e76992d696e4934ce415139a05f38c141d776b7
parent40631133b4997c593bd2af7877ae71c2461727c5
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
19 files changed:
clang/include/clang/Basic/DiagnosticParseKinds.td
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/TokenKinds.def
clang/include/clang/Driver/Options.td
clang/include/clang/Parse/Parser.h
clang/include/clang/Sema/Sema.h
clang/lib/Basic/IdentifierTable.cpp
clang/lib/Basic/Module.cpp
clang/lib/Basic/Targets.cpp
clang/lib/Driver/Tools.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Parse/Parser.cpp
clang/lib/Sema/DeclSpec.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaExprCXX.cpp
clang/lib/Sema/SemaLookup.cpp
clang/test/CodeGen/zvector.c [new file with mode: 0644]
clang/test/Preprocessor/predefined-arch-macros.c
clang/test/Sema/zvector.c [new file with mode: 0644]