]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/config/gcn/gcn.cc
amdgcn: Support XNACK mode
authorAndrew Stubbs <ams@codesourcery.com>
Mon, 31 Jul 2023 16:52:06 +0000 (17:52 +0100)
committerAndrew Stubbs <ams@codesourcery.com>
Wed, 13 Dec 2023 15:30:42 +0000 (15:30 +0000)
commit392f70cc11089f6da2611177de5f3e8baad6d327
treee4261951c70f9e61bbdfa988736b7fb277b76713
parente6bb4d997953d3ad28082a1dccb69657c6f441d9
amdgcn: Support XNACK mode

The XNACK feature allows memory load instructions to restart safely following
a page-miss interrupt.  This is useful for shared-memory devices, like APUs,
and to implement OpenMP Unified Shared Memory.

To support the feature we must be able to set the appropriate meta-data and
set the load instructions to early-clobber.  When the port supports scheduling
of s_waitcnt instructions there will be further requirements.

gcc/ChangeLog:

* config/gcn/gcn-hsa.h (NO_XNACK): Ignore missing -march.
(XNACKOPT): Match on/off; ignore any.
* config/gcn/gcn-valu.md (gather<mode>_insn_1offset<exec>):
Add xnack compatible alternatives.
(gather<mode>_insn_2offsets<exec>): Likewise.
* config/gcn/gcn.cc (gcn_option_override): Permit -mxnack for devices
other than Fiji and gfx1030.
(gcn_expand_epilogue): Remove early-clobber problems.
(gcn_hsa_declare_function_name): Obey -mxnack setting.
* config/gcn/gcn.md (xnack): New attribute.
(enabled): Rework to include "xnack" attribute.
(*movbi): Add xnack compatible alternatives.
(*mov<mode>_insn): Likewise.
(*mov<mode>_insn): Likewise.
(*mov<mode>_insn): Likewise.
(*movti_insn): Likewise.
* config/gcn/gcn.opt (-mxnack): Change the default to "any".
* doc/invoke.texi: Remove placeholder notice for -mxnack.
gcc/config/gcn/gcn-hsa.h
gcc/config/gcn/gcn-valu.md
gcc/config/gcn/gcn.cc
gcc/config/gcn/gcn.md
gcc/config/gcn/gcn.opt
gcc/doc/invoke.texi