On Tue, Jul 07, 2020 at 12:45:08PM -0500, Aaron Sawdey via Gcc-patches wrote:
> Updated slightly, removed -Wno-psabi as requested and also fixed the
> fact that it wasn't actually checking __builtin_cpu_is or
> __builtin_cpu_supports. OK for trunk and backport to 10?

But you don't need that, and neither is it wanted even (we also want
the tests to run on systems with an older glibc, or no glibc at all).
Instead, you want to have a mma_hw selector (or abbreviation, with
a name with "powerpc" in it).

> +/* { dg-require-effective-target power10_hw } */

This already means that we are running on a system that can execute
ISA 3.1 insns (it tests if some specific "pli" works).

> +  if ( !__builtin_cpu_is ("power10"))
> +    {
> +      printf ("Error: __builtin_cpu_is says this is not power10\n");
> +      ret++;
> +    }

This means it will not run on later CPUs?  Not good.

> +  if ( !__builtin_cpu_supports ("arch_3_1"))
> +    {
> +      printf ("Error: __builtin_cpu_supports says arch_3_1 not 
> supported.\n");
> +      ret++;
> +    }

This is always already tested for by that power10_hw selector.

> +  if ( !__builtin_cpu_supports ("mma"))
> +    {
> +      printf ("Error: __builtin_cpu_supports says mma not supported.\n");
> +      ret++;
> +    }

And for this, we probably want a mma_hw sooner rather than later.


Segher

Reply via email to