[PATCH][amdgcn] Add runtime ISA check for amdgcn offloading

Jakub Jelinek jakub@redhat.com
Mon Jan 20 10:25:00 GMT 2020


On Mon, Jan 20, 2020 at 10:00:09AM +0000, Andrew Stubbs wrote:
> > @@ -396,6 +396,88 @@ struct gcn_image_desc
> >    struct global_var_info *global_variables;
> >  };
> > +/* This enum mirrors the corresponding LLVM enum's values for all ISAs that we
> > +   support.
> > +   See https://llvm.org/docs/AMDGPUUsage.html#amdgpu-ef-amdgpu-mach-table */
> > +
> > +typedef enum {
> > +  EF_AMDGPU_MACH_AMDGCN_GFX801 = 0x028,
> > +  EF_AMDGPU_MACH_AMDGCN_GFX803 = 0x02a,
> > +  EF_AMDGPU_MACH_AMDGCN_GFX900 = 0x02c,
> > +  EF_AMDGPU_MACH_AMDGCN_GFX906 = 0x02f,
> > +} EF_AMDGPU_MACH;
> > +
> > +const static int EF_AMDGPU_MACH_MASK = 0x000000ff;
> > +typedef EF_AMDGPU_MACH gcn_isa;
> > +
> > +const static char* gcn_gfx801_s = "gfx801";
> > +const static char* gcn_gfx803_s = "gfx803";
> > +const static char* gcn_gfx900_s = "gfx900";
> > +const static char* gcn_gfx906_s = "gfx906";
> > +const static int gcn_isa_name_len = 6;

Does this mean that GCN has 4 incompatible ISA sets and one can't compile
for some ISA set that covers them all?  Or is that just in case one wants
specific optimizations for the hw he has and nothing else?

Also, GNU coding conventions say that the above should use "char *gcn"
rather than "char* gcn".

	Jakub



More information about the Gcc-patches mailing list