[PATCH] D80723: [PowerPC] Convert vec_splats functions to macros
Colin Samples via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu May 28 07:35:12 PDT 2020
vddvss created this revision.
vddvss added reviewers: nemanjai, PowerPC.
Herald added subscribers: cfe-commits, shchenz, kbarton.
Herald added a project: clang.
This commit converts the `vec_splats` functions in altivec.h to macros, solving an issue where `vec_splats` calls could not assign to variables of static storage duration, such as:
static vector int x = vec_splats(1);
Since `vec_splats` was implemented as a function, code such as in this example <https://code.videolan.org/videolan/dav1d/-/blob/059ad248d6b8b5a6115875acd9631746c8c3dc34/src/ppc/looprestoration_init_tmpl.c#L55> would result in a compile-time error in `clang`. This differs from `gcc`, which allows this construct.
This updates tests accordingly, and fixes PR44276 and PR44455. Sorry for the delay in getting this to you.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D80723
Files:
clang/lib/Headers/altivec.h
clang/test/CodeGen/ppc-emmintrin.c
clang/test/CodeGen/ppc-mmintrin.c
clang/test/CodeGen/ppc-pmmintrin.c
clang/test/CodeGen/ppc-smmintrin.c
clang/test/CodeGen/ppc-tmmintrin.c
clang/test/CodeGen/ppc-xmmintrin.c
clang/test/CodeGen/pr44276.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80723.266860.patch
Type: text/x-patch
Size: 105468 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200528/237caaf5/attachment-0001.bin>
More information about the cfe-commits
mailing list