From 67161d24f45601e43abea98f2c3d7d7a462b6eab Mon Sep 17 00:00:00 2001 From: Peter Bergner Date: Thu, 25 Jun 2020 19:06:37 -0500 Subject: [PATCH] rs6000: Add support for __builtin_cpu_is ("power10") Add support for __builtin_cpu_is ("power10"). Also add documentation for the recently added "arch_3_1" and "mma" __builtin_cpu_supports arguments. 2020-06-25 Peter Bergner gcc/ * config/rs6000/rs6000-call.c (cpu_is_info) : New. * doc/extend.texi (PowerPC Built-in Functions): Document power10, arch_3_1 and mma. gcc/testsuite/ * gcc.target/powerpc/cpu-builtin-1.c: Add tests for power10, arch_3_1 and mma. --- gcc/config/rs6000/rs6000-call.c | 1 + gcc/doc/extend.texi | 6 ++++++ gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c | 3 +++ 3 files changed, 10 insertions(+) diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c index 3a109fe626f..d3cf2de8878 100644 --- a/gcc/config/rs6000/rs6000-call.c +++ b/gcc/config/rs6000/rs6000-call.c @@ -105,6 +105,7 @@ static const struct const char *cpu; unsigned int cpuid; } cpu_is_info[] = { + { "power10", PPC_PLATFORM_POWER10 }, { "power9", PPC_PLATFORM_POWER9 }, { "power8", PPC_PLATFORM_POWER8 }, { "power7", PPC_PLATFORM_POWER7 }, diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 95f7192e41e..343fbba8223 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -17123,6 +17123,8 @@ issues a warning. The following CPU names can be detected: @table @samp +@item power10 +IBM POWER10 Server CPU. @item power9 IBM POWER9 Server CPU. @item power8 @@ -17199,6 +17201,8 @@ CPU supports ISA 2.06 (eg, POWER7) CPU supports ISA 2.07 (eg, POWER8) @item arch_3_00 CPU supports ISA 3.0 (eg, POWER9) +@item arch_3_1 +CPU supports ISA 3.1 (eg, POWER10) @item archpmu CPU supports the set of compatible performance monitoring events. @item booke @@ -17232,6 +17236,8 @@ CPU supports icache snooping capabilities. CPU supports 128-bit IEEE binary floating point instructions. @item isel CPU supports the integer select instruction. +@item mma +CPU supports the matrix-multiply assist instructions. @item mmu CPU has a memory management unit. @item notb diff --git a/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c b/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c index 960e7fb4f5f..2bcf6f679da 100644 --- a/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c +++ b/gcc/testsuite/gcc.target/powerpc/cpu-builtin-1.c @@ -24,6 +24,7 @@ use_cpu_is_builtins (unsigned int *p) p[12] = __builtin_cpu_is ("ppc440"); p[13] = __builtin_cpu_is ("ppc405"); p[14] = __builtin_cpu_is ("ppc-cell-be"); + p[15] = __builtin_cpu_is ("power10"); #else p[0] = 0; #endif @@ -74,6 +75,8 @@ use_cpu_supports_builtins (unsigned int *p) p[38] = __builtin_cpu_supports ("darn"); p[39] = __builtin_cpu_supports ("scv"); p[40] = __builtin_cpu_supports ("htm-no-suspend"); + p[41] = __builtin_cpu_supports ("arch_3_1"); + p[42] = __builtin_cpu_supports ("mma"); #else p[0] = 0; #endif -- 2.30.2