[clang] b5e96e0 - [PowerPC] Add more missing overloads to altivec.h
Nemanja Ivanovic via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 22 20:27:46 PDT 2021
Author: Nemanja Ivanovic
Date: 2021-03-22T22:25:28-05:00
New Revision: b5e96e0ad601bddbf102606d7a3d8ae6e68d1688
URL: https://github.com/llvm/llvm-project/commit/b5e96e0ad601bddbf102606d7a3d8ae6e68d1688
DIFF: https://github.com/llvm/llvm-project/commit/b5e96e0ad601bddbf102606d7a3d8ae6e68d1688.diff
LOG: [PowerPC] Add more missing overloads to altivec.h
Add vec_gbb as a synonym for vec_vgbbd but for doubleword vectors.
Added:
Modified:
clang/lib/Headers/altivec.h
clang/test/CodeGen/builtins-ppc-p8vector.c
Removed:
################################################################################
diff --git a/clang/lib/Headers/altivec.h b/clang/lib/Headers/altivec.h
index 55b84f93422e..7e154c9b5219 100644
--- a/clang/lib/Headers/altivec.h
+++ b/clang/lib/Headers/altivec.h
@@ -16844,6 +16844,16 @@ vec_vgbbd(vector unsigned char __a) {
return __builtin_altivec_vgbbd(__a);
}
+static __inline__ vector signed long long __ATTRS_o_ai
+vec_gbb(vector signed long long __a) {
+ return __builtin_altivec_vgbbd((vector unsigned char)__a);
+}
+
+static __inline__ vector unsigned long long __ATTRS_o_ai
+vec_gbb(vector unsigned long long __a) {
+ return __builtin_altivec_vgbbd((vector unsigned char)__a);
+}
+
static __inline__ vector long long __ATTRS_o_ai
vec_vbpermq(vector signed char __a, vector signed char __b) {
return __builtin_altivec_vbpermq((vector unsigned char)__a,
diff --git a/clang/test/CodeGen/builtins-ppc-p8vector.c b/clang/test/CodeGen/builtins-ppc-p8vector.c
index 8f9c62b875db..ea73cefc0706 100644
--- a/clang/test/CodeGen/builtins-ppc-p8vector.c
+++ b/clang/test/CodeGen/builtins-ppc-p8vector.c
@@ -1606,6 +1606,14 @@ void test1() {
// CHECK-LE: llvm.ppc.altivec.vgbbd
// CHECK-PPC: warning: implicit declaration of function 'vec_gb'
+ res_vsll = vec_gbb(vsll);
+// CHECK: llvm.ppc.altivec.vgbbd
+// CHECK-LE: llvm.ppc.altivec.vgbbd
+
+ res_vull = vec_gbb(vull);
+// CHECK: llvm.ppc.altivec.vgbbd
+// CHECK-LE: llvm.ppc.altivec.vgbbd
+
res_vull = vec_bperm(vux, vux);
// CHECK: llvm.ppc.altivec.vbpermq
// CHECK-LE: llvm.ppc.altivec.vbpermq
More information about the cfe-commits
mailing list