Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POWER] vec_bperm missing documented signatures #50276

Closed
llvmbot opened this issue Jun 29, 2021 · 1 comment
Closed

[POWER] vec_bperm missing documented signatures #50276

llvmbot opened this issue Jun 29, 2021 · 1 comment
Labels
backend:PowerPC bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics

Comments

@llvmbot
Copy link
Member

llvmbot commented Jun 29, 2021

Bugzilla Link 50932
Version trunk
OS Windows NT
Reporter LLVM Bugzilla Contributor

Extended Description

According to the documentation for XL C/C++ 16.1.1 (https://www.ibm.com/docs/en/SSXVZZ_16.1.1/com.ibm.compilers.linux.doc/compiler.pdf), vec_bperm should have two signatures. On POWER8:

vector unsigned char
vec_bperm(vector unsigned char a, vector unsigned char b);

And on POWER9 there should also be:

vector unsigned long
vec_bperm(vector unsigned long long a, vector unsigned char b);

Neither of these is present in clang; instead, there is a single signature (see

#if defined(__powerpc64__) && defined(__SIZEOF_INT128__)
static __inline__ vector unsigned long long __attribute__((__always_inline__))
vec_bperm(vector unsigned __int128 __a, vector unsigned char __b) {
return __builtin_altivec_vbpermq((vector unsigned char)__a,
(vector unsigned char)__b);
}
#endif
#endif
) which doesn't match either of the documented signatures:

vector unsigned long long
vec_bperm(vector unsigned __int128 a, vector unsigned char b);

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@RKSimon RKSimon added backend:PowerPC clang:headers Headers provided by Clang, e.g. for intrinsics labels Dec 31, 2021
@mr-c
Copy link

mr-c commented May 21, 2023

The IBM manuals for Open XL C/C++ for Linux 16.1 - 17.1.1 list a variation on your request (returning vector unsigned long long instead of vector unsigned long):

vector unsigned long long
vec_bperm(vector unsigned long long a, vector unsigned char b);

Checking an archive of the manual you linked to shows the same definition
https://web.archive.org/web/20211206100745/https://www.ibm.com/docs/en/SSXVZZ_16.1.1/com.ibm.compilers.linux.doc/compiler.pdf
image

Looks like this was fixed in 09b67aa a.k.a https://reviews.llvm.org/D107899 as part of clang-14

Therefore I think this issue can be closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:PowerPC bugzilla Issues migrated from bugzilla clang:headers Headers provided by Clang, e.g. for intrinsics
Projects
None yet
Development

No branches or pull requests

4 participants