public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] aarch64: Add support for -mcpu=grace
@ 2024-06-26  7:39 Kyrylo Tkachov
  2024-06-26 21:02 ` Andrew Pinski
  0 siblings, 1 reply; 3+ messages in thread
From: Kyrylo Tkachov @ 2024-06-26  7:39 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Hi all,

This adds support for the NVIDIA Grace CPU to aarch64.
We reuse the tuning decisions for the Neoverse V2 core, but include a
number of architecture features that are not enabled by default in
-mcpu=neoverse-v2.

This allows Grace users to more simply target the CPU with -mcpu=grace
rather than remembering what extensions to tag on top of
-mcpu=neoverse-v2.

Bootstrapped and tested on aarch64-none-linux-gnu.
I’m pushing this to trunk.
I have patches tested for the 14, 13, 12, 11 branches as well that I’d like to push there to make it simpler for our users to target Grace.
They are the same as this one logically, but they just account for slight syntactic differences and flag definitions that have happened since those branches.
Thanks,
Kyrill

	* config/aarch64/aarch64-cores.def (grace): New entry.	
	* config/aarch64/aarch64-tune.md: Regenerate
	* doc/invoke.texi (AArch64 Options): Document the above.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>


[-- Attachment #2: grace.patch --]
[-- Type: application/octet-stream, Size: 4838 bytes --]

commit a0544442b928edba226300ada941dbbc03b0a669
Author: Kyrylo Tkachov <ktkachov@nvidia.com>
Date:   Wed Jun 19 14:56:02 2024 +0530

    [aarch64] Add support for -mcpu=grace
    
    This adds support for the NVIDIA Grace CPU to aarch64.
    We reuse the tuning decisions for the Neoverse V2 core, but include a
    number of architecture features that are not enabled by default in
    -mcpu=neoverse-v2.
    
    This allows Grace users to more simply target the CPU with -mcpu=grace
    rather than remembering what extensions to tag on top of
    -mcpu=neoverse-v2.
    
    Bootstrapped and tested on aarch64-none-linux-gnu.
    
            * config/aarch64/aarch64-cores.def (grace): New entry.
            * config/aarch64/aarch64-tune.md: Regenerate
            * doc/invoke.texi (AArch64 Options): Document the above.
    
    Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>

diff --git a/gcc/config/aarch64/aarch64-cores.def b/gcc/config/aarch64/aarch64-cores.def
index 0e05e81761c..e58bc0f27de 100644
--- a/gcc/config/aarch64/aarch64-cores.def
+++ b/gcc/config/aarch64/aarch64-cores.def
@@ -194,6 +194,8 @@ AARCH64_CORE("neoverse-n2", neoversen2, cortexa57, V9A, (I8MM, BF16, SVE2_BITPER
 AARCH64_CORE("cobalt-100",   cobalt100, cortexa57, V9A, (I8MM, BF16, SVE2_BITPERM, RNG, MEMTAG, PROFILE), neoversen2, 0x6d, 0xd49, -1)
 
 AARCH64_CORE("neoverse-v2", neoversev2, cortexa57, V9A, (I8MM, BF16, SVE2_BITPERM, RNG, MEMTAG, PROFILE), neoversev2, 0x41, 0xd4f, -1)
+AARCH64_CORE("grace", grace, cortexa57, V9A, (I8MM, BF16, SVE2_BITPERM, SVE2_AES, SVE2_SHA3, SVE2_SM4, PROFILE), neoversev2, 0x41, 0xd4f, -1)
+
 AARCH64_CORE("demeter", demeter, cortexa57, V9A, (I8MM, BF16, SVE2_BITPERM, RNG, MEMTAG, PROFILE), neoversev2, 0x41, 0xd4f, -1)
 
 /* Generic Architecture Processors.  */
diff --git a/gcc/config/aarch64/aarch64-tune.md b/gcc/config/aarch64/aarch64-tune.md
index 9b1f32a0330..719fd3dc62a 100644
--- a/gcc/config/aarch64/aarch64-tune.md
+++ b/gcc/config/aarch64/aarch64-tune.md
@@ -1,5 +1,5 @@
 ;; -*- buffer-read-only: t -*-
 ;; Generated automatically by gentune.sh from aarch64-cores.def
 (define_attr "tune"
-	"cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88,thunderxt88p1,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,ampere1,ampere1a,ampere1b,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa78,cortexa78ae,cortexa78c,cortexa65,cortexa65ae,cortexx1,cortexx1c,neoversen1,ares,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,neoversev1,zeus,neoverse512tvb,saphira,oryon1,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55,cortexr82,cortexa510,cortexa520,cortexa710,cortexa715,cortexa720,cortexx2,cortexx3,cortexx4,neoversen2,cobalt100,neoversev2,demeter,generic,generic_armv8_a,generic_armv9_a"
+	"cortexa34,cortexa35,cortexa53,cortexa57,cortexa72,cortexa73,thunderx,thunderxt88,thunderxt88p1,octeontx,octeontxt81,octeontxt83,thunderxt81,thunderxt83,ampere1,ampere1a,ampere1b,emag,xgene1,falkor,qdf24xx,exynosm1,phecda,thunderx2t99p1,vulcan,thunderx2t99,cortexa55,cortexa75,cortexa76,cortexa76ae,cortexa77,cortexa78,cortexa78ae,cortexa78c,cortexa65,cortexa65ae,cortexx1,cortexx1c,neoversen1,ares,neoversee1,octeontx2,octeontx2t98,octeontx2t96,octeontx2t93,octeontx2f95,octeontx2f95n,octeontx2f95mm,a64fx,tsv110,thunderx3t110,neoversev1,zeus,neoverse512tvb,saphira,oryon1,cortexa57cortexa53,cortexa72cortexa53,cortexa73cortexa35,cortexa73cortexa53,cortexa75cortexa55,cortexa76cortexa55,cortexr82,cortexa510,cortexa520,cortexa710,cortexa715,cortexa720,cortexx2,cortexx3,cortexx4,neoversen2,cobalt100,neoversev2,grace,demeter,generic,generic_armv8_a,generic_armv9_a"
 	(const (symbol_ref "((enum attr_tune) aarch64_tune)")))
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index c790e2f3518..29866eb42e9 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -21425,8 +21425,8 @@ performance of the code.  Permissible values for this option are:
 @samp{ares}, @samp{exynos-m1}, @samp{emag}, @samp{falkor},
 @samp{oryon-1},
 @samp{neoverse-512tvb}, @samp{neoverse-e1}, @samp{neoverse-n1},
-@samp{neoverse-n2}, @samp{neoverse-v1}, @samp{neoverse-v2}, @samp{qdf24xx},
-@samp{saphira}, @samp{phecda}, @samp{xgene1}, @samp{vulcan},
+@samp{neoverse-n2}, @samp{neoverse-v1}, @samp{neoverse-v2}, @samp{grace},
+@samp{qdf24xx}, @samp{saphira}, @samp{phecda}, @samp{xgene1}, @samp{vulcan},
 @samp{octeontx}, @samp{octeontx81},  @samp{octeontx83},
 @samp{octeontx2}, @samp{octeontx2t98}, @samp{octeontx2t96}
 @samp{octeontx2t93}, @samp{octeontx2f95}, @samp{octeontx2f95n},

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aarch64: Add support for -mcpu=grace
  2024-06-26  7:39 [PATCH] aarch64: Add support for -mcpu=grace Kyrylo Tkachov
@ 2024-06-26 21:02 ` Andrew Pinski
  2024-06-27  6:52   ` Kyrylo Tkachov
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Pinski @ 2024-06-26 21:02 UTC (permalink / raw)
  To: Kyrylo Tkachov; +Cc: gcc-patches

On Wed, Jun 26, 2024 at 12:40 AM Kyrylo Tkachov <ktkachov@nvidia.com> wrote:
>
> Hi all,
>
> This adds support for the NVIDIA Grace CPU to aarch64.
> We reuse the tuning decisions for the Neoverse V2 core, but include a
> number of architecture features that are not enabled by default in
> -mcpu=neoverse-v2.
>
> This allows Grace users to more simply target the CPU with -mcpu=grace
> rather than remembering what extensions to tag on top of
> -mcpu=neoverse-v2.
>
> Bootstrapped and tested on aarch64-none-linux-gnu.
> I’m pushing this to trunk.

> RNG

I noticed this is missing from grace but is included in neoverse-v2.
Is that expected?

Thanks,
Andrew Pinski


> I have patches tested for the 14, 13, 12, 11 branches as well that I’d like to push there to make it simpler for our users to target Grace.
> They are the same as this one logically, but they just account for slight syntactic differences and flag definitions that have happened since those branches.
> Thanks,
> Kyrill
>
>         * config/aarch64/aarch64-cores.def (grace): New entry.
>         * config/aarch64/aarch64-tune.md: Regenerate
>         * doc/invoke.texi (AArch64 Options): Document the above.
>
> Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] aarch64: Add support for -mcpu=grace
  2024-06-26 21:02 ` Andrew Pinski
@ 2024-06-27  6:52   ` Kyrylo Tkachov
  0 siblings, 0 replies; 3+ messages in thread
From: Kyrylo Tkachov @ 2024-06-27  6:52 UTC (permalink / raw)
  To: Andrew Pinski; +Cc: gcc-patches

Hi Andrew,

> On 26 Jun 2024, at 23:02, Andrew Pinski <pinskia@gmail.com> wrote:
> 
> External email: Use caution opening links or attachments
> 
> 
> On Wed, Jun 26, 2024 at 12:40 AM Kyrylo Tkachov <ktkachov@nvidia.com> wrote:
>> 
>> Hi all,
>> 
>> This adds support for the NVIDIA Grace CPU to aarch64.
>> We reuse the tuning decisions for the Neoverse V2 core, but include a
>> number of architecture features that are not enabled by default in
>> -mcpu=neoverse-v2.
>> 
>> This allows Grace users to more simply target the CPU with -mcpu=grace
>> rather than remembering what extensions to tag on top of
>> -mcpu=neoverse-v2.
>> 
>> Bootstrapped and tested on aarch64-none-linux-gnu.
>> I’m pushing this to trunk.
> 
>> RNG
> 
> I noticed this is missing from grace but is included in neoverse-v2.
> Is that expected?

Yes, RNG is an optional configuration feature of Neoverse V2 (according to the TRM) and Grace doesn’t implement it. In fact, I don’t think the base -mcpu=neoverse-v2 should include it either (I’m testing a patch to remove it)

Thanks,
Kyrill


> 
> Thanks,
> Andrew Pinski
> 
> 
>> I have patches tested for the 14, 13, 12, 11 branches as well that I’d like to push there to make it simpler for our users to target Grace.
>> They are the same as this one logically, but they just account for slight syntactic differences and flag definitions that have happened since those branches.
>> Thanks,
>> Kyrill
>> 
>>        * config/aarch64/aarch64-cores.def (grace): New entry.
>>        * config/aarch64/aarch64-tune.md: Regenerate
>>        * doc/invoke.texi (AArch64 Options): Document the above.
>> 
>> Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-27  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26  7:39 [PATCH] aarch64: Add support for -mcpu=grace Kyrylo Tkachov
2024-06-26 21:02 ` Andrew Pinski
2024-06-27  6:52   ` Kyrylo Tkachov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).