[Bug target/85830] vec_popcntd is improperly defined in altivec.h
cel at us dot ibm.com
gcc-bugzilla@gcc.gnu.org
Thu Aug 27 18:15:38 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85830
--- Comment #2 from Carl Love <cel at us dot ibm.com> ---
Hit the save button a little too fast missed putting in everything I intended
to put in. Lets try to get it all in.
(In reply to Carl Love from comment #1)
> The Power 64-Bi ELF V2 ABI specification revision 1.4 May 10, 2017 has the
> following builtins defined for popcount
>
VEC_POPCNT (ARG1) Purpose: Returns a vector containing the number of bits set
in each element of the input vector.
Result value:The value of each element of the result is the
number of bits set in the corresponding input
element.
vector unsigned char vec_popcnt (vector signed char);
vector unsigned char vec_popcnt (vector unsigned char);
vector unsigned int vec_popcnt (vector signed int);
vector unsigned int vec_popcnt (vector unsigned int);
vector unsigned long long vec_popcnt (vector signed long long);
vector unsigned long long vec_popcnt (vector unsigned long long);
vector unsigned short vec_popcnt (vector signed short);
vector unsigned short vec_popcnt (vector unsigned short);
In section A.6. Deprecated Compatibility Functions we have listed:
> 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.
More information about the Gcc-bugs
mailing list