]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn: Change -m(no-)xnack to -mxnack=(on,off,any)
authorTobias Burnus <tobias@codesourcery.com>
Fri, 26 May 2023 16:07:34 +0000 (18:07 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Fri, 26 May 2023 16:10:13 +0000 (18:10 +0200)
commit366e3d30b8d5dc2bf226696987dfbd2a7df192f5
tree0cca8ed345c234d5690e1bdd673539373f0943ae
parent497e8e2420e3fc0209ae240f61050d0257023d6b
amdgcn: Change -m(no-)xnack to -mxnack=(on,off,any)

Since object code target ID V4, xnack has the values unspecified, '+' and '-',
which with this commit is represented in GCC as 'any', 'on', and 'off',
following the precidence for 'sram(-)ecc' and -msram-ecc=.

The current default was 'no' and is now 'off'; however, once XNACK is
implemented, the default should be probably 'any'.

This commit updates the commandline options to permit the new tristate and
updates the documentation. As the feature itself is currently not really
supported in GCC, the change should not affect real-world users.

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.

2023-05-26  Andrew Stubbs  <ams@codesourcery.com>
    Tobias Burnus  <tobias@codesourcery.com>

* config/gcn/gcn-hsa.h (XNACKOPT): New macro.
(ASM_SPEC): Use XNACKOPT.
* config/gcn/gcn-opts.h (enum sram_ecc_type): Rename to ...
(enum hsaco_attr_type): ... this, and generalize the names.
(TARGET_XNACK): New macro.
* config/gcn/gcn.cc (gcn_option_override): Update to sorry for all
but -mxnack=off.
(output_file_start): Update xnack handling.
(gcn_hsa_declare_function_name): Use TARGET_XNACK.
* config/gcn/gcn.opt (-mxnack): Add the "on/off/any" syntax.
(sram_ecc_type): Rename to ...
(hsaco_attr_type: ... this.)
* config/gcn/mkoffload.cc (SET_XNACK_ANY): New macro.
(TEST_XNACK): Delete.
(TEST_XNACK_ANY): New macro.
(TEST_XNACK_ON): New macro.
(main): Support the new -mxnack=on/off/any syntax.
* doc/invoke.texi (-mxnack): Update for new syntax.
12 files changed:
gcc/config/gcn/gcn-hsa.h
gcc/config/gcn/gcn-opts.h
gcc/config/gcn/gcn.cc
gcc/config/gcn/gcn.opt
gcc/config/gcn/mkoffload.cc
gcc/doc/invoke.texi
gcc/testsuite/gfortran.dg/gomp/allocate-4.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocate-5.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocate-6.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocate-7.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocators-1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/gomp/allocators-2.f90 [new file with mode: 0644]