[PATCH], PR 60672, Add xxsldwi/xxpermdi builtins to altivec.h

David Edelsohn dje.gcc@gmail.com
Thu Mar 27 18:14:00 GMT 2014


On Thu, Mar 27, 2014 at 1:43 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> One of the users within IBM noticed that we did not provide builtins for the
> XXSLDWI (vector shift left) and XXPERMDI (permute 64-bit values to make 128-bit
> vector) instructions.  It turns out, we had provided these builtins, but we had
> not documented them, nor did we add them to altivec.h with a user visible name.
>
> When I added these builtins several years ago, I did not understand the naming
> scheme for overloaded functions (i.e. __builtin_vec_<xxx> in the compiler, and
> vec_<xxx> in altivec.h), so I added the overloaded builtin as
> __builtin_vsx_xxsldwi and __builtin_vsx_xxpermdi.  This patch does not fix the
> historical accident, but instead just uses the name that is created.
>
> I can change the name, and provide a #define for somebody using the old name,
> or we can just leave the compiler generating the old name, and altivec.h just
> has to adapt.
>
> I have done bootstraps and make check with no regressions.  Are these patches
> ok to apply to 4.9 and backported to 4.8 when the rest of the changes go in?
>
> [gcc]
> 2014-03-27  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/60672
>         * config/rs6000/altivec.h (vec_xxsldwi): Add missing define to
>         enable use of xxsldwi and xxpermdi builtin functions.
>         (vec_xxpermdi): Likewise.
>
>         * doc/extend.texi (PowerPC AltiVec/VSX Built-in Functions):
>         Document use of vec_xxsldwi and vec_xxpermdi builtins.
>
> [gcc/testsuite]
> 2014-03-27  Michael Meissner  <meissner@linux.vnet.ibm.com>
>
>         PR target/60672
>         * gcc.target/powerpc/pr60676.c: New file, make sure xxsldwi and
>         xxpermdi builtins are supported.

Thanks for fixing the missing functions and documentation.

Just to clarify the explanation, the builtin name remains
__builtin_vsx_<xxx>, but the altivec.h macro definition \ is
vec_<xxx>.

Okay.

Thanks, David



More information about the Gcc-patches mailing list