This patch adds a new -march=gfx906 option, and a new multilib to go with it.

gfx906 is ISA compatible with gfx900 (at least as far as the compiler support goes), but unfortunately the metadata in the object files is not compatible, so we need a whole extra multilib (booo!). Or, at least that's the easiest solution to use for now.

Andrew
Add -march=gfx906 for AMD GCN.

2019-06-06  Andrew Stubbs  <a...@codesourcery.com>

	gcc/
	* config.gcc (amdgcn-*-*): Allow --with-arch=gfx906.
	* config/gcn/gcn.opt (gpu_type): Add gfx906.
	* config/gcn/t-gcn-hsa (MULTILIB_OPTIONS): Add gfx906 multilib.
	(MULTILIB_DIRNAMES): Rename gcn5 to gfx900.
	Add gfx906.

diff --git a/gcc/config.gcc b/gcc/config.gcc
index 67c3c2c7a42..6b00c387247 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -4127,7 +4127,7 @@ case "${target}" in
 		for which in arch tune; do
 			eval "val=\$with_$which"
 			case ${val} in
-			"" | carrizo | fiji | gfx900 )
+			"" | carrizo | fiji | gfx900 | gfx906 )
 				# OK
 				;;
 			*)
diff --git a/gcc/config/gcn/gcn.opt b/gcc/config/gcn/gcn.opt
index 2fd3996edba..bdc878f35ad 100644
--- a/gcc/config/gcn/gcn.opt
+++ b/gcc/config/gcn/gcn.opt
@@ -34,6 +34,9 @@ Enum(gpu_type) String(fiji) Value(PROCESSOR_FIJI)
 EnumValue
 Enum(gpu_type) String(gfx900) Value(PROCESSOR_VEGA)
 
+EnumValue
+Enum(gpu_type) String(gfx906) Value(PROCESSOR_VEGA)
+
 march=
 Target RejectNegative Joined ToLower Enum(gpu_type) Var(gcn_arch) Init(PROCESSOR_CARRIZO)
 Specify the name of the target GPU.
diff --git a/gcc/config/gcn/t-gcn-hsa b/gcc/config/gcn/t-gcn-hsa
index 085ba429c9d..1600a586ac4 100644
--- a/gcc/config/gcn/t-gcn-hsa
+++ b/gcc/config/gcn/t-gcn-hsa
@@ -42,8 +42,8 @@ ALL_HOST_OBJS += gcn-run.o
 gcn-run$(exeext): gcn-run.o
 	+$(LINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) -o $@ $< -ldl
 
-MULTILIB_OPTIONS = march=gfx900
-MULTILIB_DIRNAMES = gcn5
+MULTILIB_OPTIONS = march=gfx900 march=gfx906
+MULTILIB_DIRNAMES = gfx900 gfx906
 
 PASSES_EXTRA += $(srcdir)/config/gcn/gcn-passes.def
 gcn-tree.o: $(srcdir)/config/gcn/gcn-tree.c

Reply via email to