Hi!

On Wed, Jan 26, 2022 at 10:03:36PM +0100, Jakub Jelinek wrote:
> When writing testcases for the previously posted patch, I have noticed
> that 3 of the headers aren't valid C89 (I didn't have any dg-options
> so -ansi -pedantic-errors was implied and these errors were reported).

Hrm.  Do they even work like that?

> Note, as can be seen even in this patch, seems older rs6000/*intrin.h
> headers uglify not just argument names (__A instead of A etc.), but also
> automatic variable names and other local identifiers, while e.g. emmintrin.h
> or bmi2intrin.h clearly uglify only the argument names and not local
> variables.  I think that should be fixed but don't have time for that myself
> (libstdc++ or e.g. the x86 headers uglify everything; this is so that one
> can
> #define result a + b
> #include <x86intrin.h>
> etc.).

Heh, I argued for this before, but mistakenly for arguments as well.
Not that I can remember right now how function arguments can mess up
either?

> --- gcc/config/rs6000/bmi2intrin.h.jj 2022-01-26 20:42:53.132315506 +0000
> +++ gcc/config/rs6000/bmi2intrin.h    2022-01-26 20:46:33.687983641 +0000
> @@ -115,10 +115,11 @@ _pext_u64 (unsigned long long __X, unsig
>     the Power8 Bit permute instruction.  */
>    if (__builtin_constant_p (__M) && (__builtin_popcountl (__M) <= 8))
>      {
> +      long i;
>        /* Also if the pext mask is constant, then the popcount is
>         constant, we can evaluate the following loop at compile
>         time and use a constant bit permute vector.  */
> -      for (long i = 0; i < __builtin_popcountl (__M); i++)
> +      for (i = 0; i < __builtin_popcountl (__M); i++)

Please put the declaration immediately before it is used, not at the
start of the function?

Okay for trunk like that.  Thanks!  Also any and all backports you want
are fine.


Segher

Reply via email to