diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2024-01-03 16:53:52 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@codesourcery.com> | 2024-01-08 09:57:44 +0000 |
commit | 78dff4c25c1b959e4682d7da50d00fb371849a46 (patch) | |
tree | 285af52ce2307c34da6c3740cfca3d659ffffca4 /gcc/config | |
parent | c5c3aab38132ea34dc1ee69d93fded787e6ac7a4 (diff) | |
download | gcc-78dff4c25c1b959e4682d7da50d00fb371849a46.zip gcc-78dff4c25c1b959e4682d7da50d00fb371849a46.tar.gz gcc-78dff4c25c1b959e4682d7da50d00fb371849a46.tar.bz2 |
amdgcn: Match new XNACK defaults in mkoffload
The patch that disabled XNACK by default for ISA other than gfx90a was missing
the matching mkoffload changes. This patch should fix offload.
gcc/ChangeLog:
* config/gcn/mkoffload.cc (TEST_XNACK_UNSET): New.
(elf_flags): Remove XNACK from the default value.
(main): Set a default XNACK according to the arch.
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/gcn/mkoffload.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/config/gcn/mkoffload.cc b/gcc/config/gcn/mkoffload.cc index 03cd040..5b7de00 100644 --- a/gcc/config/gcn/mkoffload.cc +++ b/gcc/config/gcn/mkoffload.cc @@ -84,6 +84,7 @@ == EF_AMDGPU_FEATURE_XNACK_ON_V4) #define TEST_XNACK_OFF(VAR) ((VAR & EF_AMDGPU_FEATURE_XNACK_V4) \ == EF_AMDGPU_FEATURE_XNACK_OFF_V4) +#define TEST_XNACK_UNSET(VAR) ((VAR & EF_AMDGPU_FEATURE_XNACK_V4) == 0) #define SET_SRAM_ECC_ON(VAR) VAR = ((VAR & ~EF_AMDGPU_FEATURE_SRAMECC_V4) \ | EF_AMDGPU_FEATURE_SRAMECC_ON_V4) @@ -122,8 +123,7 @@ static struct obstack files_to_cleanup; enum offload_abi offload_abi = OFFLOAD_ABI_UNSET; uint32_t elf_arch = EF_AMDGPU_MACH_AMDGCN_GFX803; // Default GPU architecture. -uint32_t elf_flags = - (EF_AMDGPU_FEATURE_XNACK_ANY_V4 | EF_AMDGPU_FEATURE_SRAMECC_ANY_V4); +uint32_t elf_flags = EF_AMDGPU_FEATURE_SRAMECC_ANY_V4; static int gcn_stack_size = 0; /* Zero means use default. */ @@ -1005,6 +1005,25 @@ main (int argc, char **argv) gcc_unreachable (); } + /* Disable XNACK mode on architectures where it doesn't work (well). + Set default to "any" otherwise. */ + switch (elf_arch) + { + case EF_AMDGPU_MACH_AMDGCN_GFX803: + case EF_AMDGPU_MACH_AMDGCN_GFX900: + case EF_AMDGPU_MACH_AMDGCN_GFX906: + case EF_AMDGPU_MACH_AMDGCN_GFX908: + case EF_AMDGPU_MACH_AMDGCN_GFX1030: + SET_XNACK_OFF (elf_flags); + break; + case EF_AMDGPU_MACH_AMDGCN_GFX90a: + if (TEST_XNACK_UNSET (elf_flags)) + SET_XNACK_ANY (elf_flags); + break; + default: + fatal_error (input_location, "unhandled architecture"); + } + /* Build arguments for compiler pass. */ struct obstack cc_argv_obstack; obstack_init (&cc_argv_obstack); |