[Clang] Add option to handle behaviour of vector bool/vector pixel.
authorStefan Pintilie <stefanp@ca.ibm.com>
Fri, 11 Jun 2021 10:39:28 +0000 (05:39 -0500)
committerStefan Pintilie <stefanp@ca.ibm.com>
Mon, 28 Jun 2021 16:16:37 +0000 (11:16 -0500)
commitc3fe847f9d90de5a6a76fd1d5f5823ab4719accc
treed9f2c4a6ae1a4673d8b58ef34a3ba70e7f8c8c84
parentcccc7e5aa8088b3b721e1f430c47d199575fae9b
[Clang] Add option to handle behaviour of vector bool/vector pixel.

Added the option `-altivec-src-compat=[mixed,gcc,xl]`. The default at this time is `mixed`.

The default behavior for clang is for all vector compares to return a scalar unless the vectors being
compared are vector bool or vector pixel. In that case the compare returns a
vector. With the gcc case all vector compares return vectors and in the xl case
all vector compares return scalars.

This patch does not change the default behavior of clang.

This option will be used in future patches to implement behaviour compatibility for the vector bool/pixel types.

Reviewed By: bmahjour

Differential Revision: https://reviews.llvm.org/D103615
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/LangOptions.h
clang/include/clang/Driver/Options.td
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGen/vector-compat-pixel-bool-ternary.c [new file with mode: 0644]
clang/test/CodeGen/vector-compat-pixel-bool.c [new file with mode: 0644]
clang/test/CodeGen/vector-compat-ternary.c [new file with mode: 0644]
clang/test/CodeGen/vector-compat.c [new file with mode: 0644]