[PowerPC] Add range checks for P10 Vector Builtins
authorQuinn Pham <quinn.pham@ibm.com>
Mon, 13 Sep 2021 17:30:25 +0000 (12:30 -0500)
committerQuinn Pham <Quinn.Pham@ibm.com>
Thu, 23 Sep 2021 16:05:49 +0000 (11:05 -0500)
commitf9912fe4eac91f27965c22d015b3109c5158d050
treeb70cb66cb9afe1a00b909f91daf81fed951942a3
parenta95061691e43fd9a4216e60917715bdc58660d17
[PowerPC] Add range checks for P10 Vector Builtins

This patch adds range checking for some Power10 altivec builtins and
changes the signature of a builtin to match documentation. For `vec_cntm`,
range checking is done via SemaChecking. For `vec_splati_ins`, the second
argument is masked to extract the 0th bit so that we always receive either a `0`
or a `1`.

Reviewed By: lei, amyk

Differential Revision: https://reviews.llvm.org/D109710
clang/lib/Headers/altivec.h
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins-ppc-p10vector-error.c [new file with mode: 0644]
clang/test/CodeGen/builtins-ppc-p10vector.c