diff options
author | Andrew Stubbs <ams@codesourcery.com> | 2019-11-22 14:42:49 +0000 |
---|---|---|
committer | Andrew Stubbs <ams@gcc.gnu.org> | 2019-11-22 14:42:49 +0000 |
commit | aa84ec8415bd413b693e5ea0610e98f3b6216ad5 (patch) | |
tree | 9c86e22e0f51d7228bee7e91cac8ecc018136777 /gcc | |
parent | 9fd052e775623581d2d277a1688b9fde94cb18d2 (diff) | |
download | gcc-aa84ec8415bd413b693e5ea0610e98f3b6216ad5.zip gcc-aa84ec8415bd413b693e5ea0610e98f3b6216ad5.tar.gz gcc-aa84ec8415bd413b693e5ea0610e98f3b6216ad5.tar.bz2 |
Use GFX9 granulated sgprs count correctly.
2019-11-22 Andrew Stubbs <ams@codesourcery.com>
gcc/
* config/gcn/gcn.c (gcn_hsa_declare_function_name): Calculate
granulated_sgprs according to architecture.
From-SVN: r278617
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/gcn/gcn.c | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 62ddef2..2512838 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-11-22 Andrew Stubbs <ams@codesourcery.com> + + * config/gcn/gcn.c (gcn_hsa_declare_function_name): Calculate + granulated_sgprs according to architecture. + 2019-11-22 Jan Hubicka <jh@suse.cz> * ggc-page.c (ggc_collect): Call memory_block_pool::trim. diff --git a/gcc/config/gcn/gcn.c b/gcc/config/gcn/gcn.c index 26c1067..3a8c10e 100644 --- a/gcc/config/gcn/gcn.c +++ b/gcc/config/gcn/gcn.c @@ -4922,6 +4922,14 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree) sgpr = MAX_NORMAL_SGPR_COUNT - extra_regs; } + /* GFX8 allocates SGPRs in blocks of 8. + GFX9 uses blocks of 16. */ + int granulated_sgprs; + if (TARGET_GCN3) + granulated_sgprs = (sgpr + extra_regs + 7) / 8 - 1; + else if (TARGET_GCN5) + granulated_sgprs = 2 * ((sgpr + extra_regs + 15) / 16 - 1); + fputs ("\t.align\t256\n", file); fputs ("\t.type\t", file); assemble_name (file, name); @@ -4960,7 +4968,7 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree) "\t\tcompute_pgm_rsrc2_excp_en = 0\n", (vgpr - 1) / 4, /* Must match wavefront_sgpr_count */ - (sgpr + extra_regs + 7) / 8 - 1, + granulated_sgprs, /* The total number of SGPR user data registers requested. This number must match the number of user data registers enabled. */ cfun->machine->args.nsgprs); |