https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85830
Carl Love <cel at us dot ibm.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |cel at us dot ibm.com
--- Comment #1 from Carl Love <cel at us dot ibm.com> ---
The Power 64-Bi ELF V2 ABI specification revision 1.4 May 10, 2017 has the
following builtins defined for popcount
vector signed char vec_vpopcnt (vector signed char);
vector unsigned char vec_vpopcnt (vector unsigned char);
vector unsigned int vec_vpopcnt (vector int);
vector signed long long vec_vpopcnt (vector signed long long);
vector unsigned long long vec_vpopcnt (vector unsigned long long);
vector unsigned short vec_vpopcnt (vector unsigned short);
vector int vec_vpopcnt (vector int);
vector short vec_vpopcnt (vector short);
vector signed char vec_vpopcntb (vector signed char);
vector unsigned char vec_vpopcntb (vector unsigned char);
vector signed long long vec_vpopcntd (vector signed long long);
vector unsigned long long vec_vpopcntd (vector unsigned long long)
vector unsigned short vec_vpopcnth (vector unsigned short);
vector short vec_vpopcnth (vector short);
vector unsigned int vec_vpopcntw (vector unsigned int);
vector int vec_vpopcntw (vector int);
The functions vec_popcntb, vec_popcnth, vec_popcntw, vec_popcntd do not
appear in the ABI as supported or depricated functions.
In altivec.h they are defined as:
#define vec_popcnt __builtin_vec_vpopcntu
#define vec_popcntb __builtin_vec_vpopcntub
#define vec_popcnth __builtin_vec_vpopcntuh
#define vec_popcntw __builtin_vec_vpopcntuw
#define vec_popcntd __builtin_vec_vpopcntud
It does appear they should be removed from altivec.h.
The user should use the builtin vec_popcnt(a) where a is the unsigned long long
or unsigned int as desired. These builtins are support on at least
gcc version 8.3.1 and later.