Commit aa84ec84 by Andrew Stubbs Committed by Andrew Stubbs

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
parent 9fd052e7
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> 2019-11-22 Jan Hubicka <jh@suse.cz>
* ggc-page.c (ggc_collect): Call memory_block_pool::trim. * ggc-page.c (ggc_collect): Call memory_block_pool::trim.
...@@ -4922,6 +4922,14 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree) ...@@ -4922,6 +4922,14 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree)
sgpr = MAX_NORMAL_SGPR_COUNT - extra_regs; 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.align\t256\n", file);
fputs ("\t.type\t", file); fputs ("\t.type\t", file);
assemble_name (file, name); assemble_name (file, name);
...@@ -4960,7 +4968,7 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree) ...@@ -4960,7 +4968,7 @@ gcn_hsa_declare_function_name (FILE *file, const char *name, tree)
"\t\tcompute_pgm_rsrc2_excp_en = 0\n", "\t\tcompute_pgm_rsrc2_excp_en = 0\n",
(vgpr - 1) / 4, (vgpr - 1) / 4,
/* Must match wavefront_sgpr_count */ /* Must match wavefront_sgpr_count */
(sgpr + extra_regs + 7) / 8 - 1, granulated_sgprs,
/* The total number of SGPR user data registers requested. This /* The total number of SGPR user data registers requested. This
number must match the number of user data registers enabled. */ number must match the number of user data registers enabled. */
cfun->machine->args.nsgprs); cfun->machine->args.nsgprs);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment