[PowerPC] Implement vector bool/pixel initialization under -faltivec-src-compat=xl
authorAmy Kwan <amy.kwan1@ibm.com>
Mon, 19 Jul 2021 13:20:06 +0000 (08:20 -0500)
committerAmy Kwan <amy.kwan1@ibm.com>
Mon, 19 Jul 2021 14:10:06 +0000 (09:10 -0500)
commitdd5aa657a520adcff84bb6149dd20cd8a2c8c6c6
tree6f35e7afc8da2e95595ceb713008f429a2bf49f8
parentf46321207f7d28f21d0dfb3635933d1bd84b5e05
[PowerPC] Implement vector bool/pixel initialization under -faltivec-src-compat=xl

This patch implements the initialization of vectors under the
-faltivec-src-compat=xl option introduced in https://reviews.llvm.org/D103615.

Under this option, the initialization of scalar vectors, vector bool, and vector
pixel are treated the same, where the initialization value is splatted across
the whole vector.

This patch does not change the behaviour of the -faltivec-src-compat=mixed option,
which is the current default for Clang.

Differential Revision: https://reviews.llvm.org/D106120
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaCast.cpp
clang/lib/Sema/SemaExpr.cpp
clang/test/CodeGen/vector-bool-pixel-altivec-init-no-parentheses.c [new file with mode: 0644]
clang/test/CodeGen/vector-bool-pixel-altivec-init.c [new file with mode: 0644]