The amdhsa.version depends on the code object version; while V3 had 1.0,
V4 has 1.1 and V5 (and V6) have 1.2. GCC used 1.0 but generated since
a while either V4 or, with -march=gfx...-generic, V6. Now it uses the
proper version again.
gcc/ChangeLog:
* config/gcn/gcn.cc (gcn_hsa_declare_function_name): Update
'amdhsa.version' output to match used code version.
* config/gcn/gen-gcn-device-macros.awk: Add a comment to
crosslink.
#if 1
/* The following is YAML embedded in assembler; tabs are not allowed. */
- fputs (" .amdgpu_metadata\n"
- " amdhsa.version:\n"
- " - 1\n"
- " - 0\n"
- " amdhsa.kernels:\n"
- " - .name: ", file);
+
+ /* 'amdhsa.version': code object V3 = 1.0, V4 = 1.1, V5/V6 = 1.2. */
+ /* Keep in sync with 'amdhsa-code-object' in gen-gcn-device-macros.awk. */
+ fprintf (file,
+ " .amdgpu_metadata\n"
+ " amdhsa.version:\n"
+ " - 1\n"
+ " - %d\n"
+ " amdhsa.kernels:\n"
+ " - .name: ",
+ gcn_devices[gcn_arch].generic_version ? 2 /* V6 */ : 1 /* V4 */);
assemble_name (file, name);
fputs ("\n .symbol: ", file);
assemble_name (file, name);
# same. - LLVM <= 17 defaults to 4 while LLVM >= 18 defaults to 5.
# GCC supports LLVM >= 13.0.1 and only LLVM >= 14 supports version 5.
# Code object V6 is supported since LLVM 19.
-
+#
+# Keep in sync with 'amdhsa.version' in gcn.cc
+#
END {
print ""
print ""