bfd, binutils: add gfx11 amdgpu architectures

Message ID 20230928142256.26768-1-simon.marchi@efficios.com
State Accepted
Headers
Series bfd, binutils: add gfx11 amdgpu architectures |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Simon Marchi Sept. 28, 2023, 2:22 p.m. UTC
  Teach bfd and readelf about some recent gfx11 architectures.  This code
is taken from the rocgdb 5.7.x branch [1].

[1] https://github.com/rocm-Developer-Tools/rocgdb/tree/rocm-5.7.x

bfd/ChangeLog:

	* archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
	bfd_mach_amdgcn_gfx1102): New.
	* bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
	bfd_mach_amdgcn_gfx1102): New.
	* cpu-amdgcn.c (arch_info_struct): Add entries for
	bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
	bfd_mach_amdgcn_gfx1102.

binutils/ChangeLog:

	* readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100,
	gfx1101, gfx1102.

include/ChangeLog:

	* elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100,
	EF_AMDGPU_MACH_AMDGCN_GFX1101,
	EF_AMDGPU_MACH_AMDGCN_GFX1102): New.

Change-Id: I95a8a62942e359781a1c9fa2079950fbcf2a78b8
Co-Authored-By: Laurent Morichetti <laurent.morichetti@amd.com>
Cc: Lancelot Six <lancelot.six@amd.com>
---
 bfd/archures.c       | 3 +++
 bfd/bfd-in2.h        | 3 +++
 bfd/cpu-amdgcn.c     | 5 ++++-
 binutils/readelf.c   | 3 +++
 include/elf/amdgpu.h | 3 +++
 5 files changed, 16 insertions(+), 1 deletion(-)


base-commit: 054f25955c2b77f6e21073bfdd70a60e9df1ffe7
  

Comments

Simon Marchi Oct. 12, 2023, 3:03 a.m. UTC | #1
Ping.

On 2023-09-28 10:22, Simon Marchi wrote:
> Teach bfd and readelf about some recent gfx11 architectures.  This code
> is taken from the rocgdb 5.7.x branch [1].
> 
> [1] https://github.com/rocm-Developer-Tools/rocgdb/tree/rocm-5.7.x
> 
> bfd/ChangeLog:
> 
> 	* archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
> 	bfd_mach_amdgcn_gfx1102): New.
> 	* bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
> 	bfd_mach_amdgcn_gfx1102): New.
> 	* cpu-amdgcn.c (arch_info_struct): Add entries for
> 	bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
> 	bfd_mach_amdgcn_gfx1102.
> 
> binutils/ChangeLog:
> 
> 	* readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100,
> 	gfx1101, gfx1102.
> 
> include/ChangeLog:
> 
> 	* elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100,
> 	EF_AMDGPU_MACH_AMDGCN_GFX1101,
> 	EF_AMDGPU_MACH_AMDGCN_GFX1102): New.
> 
> Change-Id: I95a8a62942e359781a1c9fa2079950fbcf2a78b8
> Co-Authored-By: Laurent Morichetti <laurent.morichetti@amd.com>
> Cc: Lancelot Six <lancelot.six@amd.com>
> ---
>  bfd/archures.c       | 3 +++
>  bfd/bfd-in2.h        | 3 +++
>  bfd/cpu-amdgcn.c     | 5 ++++-
>  binutils/readelf.c   | 3 +++
>  include/elf/amdgpu.h | 3 +++
>  5 files changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/bfd/archures.c b/bfd/archures.c
> index b59979e60acc..c4455de7c289 100644
> --- a/bfd/archures.c
> +++ b/bfd/archures.c
> @@ -575,6 +575,9 @@ DESCRIPTION
>  .#define bfd_mach_amdgcn_gfx1030 0x036
>  .#define bfd_mach_amdgcn_gfx1031 0x037
>  .#define bfd_mach_amdgcn_gfx1032 0x038
> +.#define bfd_mach_amdgcn_gfx1100 0x041
> +.#define bfd_mach_amdgcn_gfx1101 0x046
> +.#define bfd_mach_amdgcn_gfx1102 0x047
>  .  bfd_arch_last
>  .  };
>  */
> diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
> index eddb9902f5e4..cf748b48c528 100644
> --- a/bfd/bfd-in2.h
> +++ b/bfd/bfd-in2.h
> @@ -1831,6 +1831,9 @@ enum bfd_architecture
>  #define bfd_mach_amdgcn_gfx1030 0x036
>  #define bfd_mach_amdgcn_gfx1031 0x037
>  #define bfd_mach_amdgcn_gfx1032 0x038
> +#define bfd_mach_amdgcn_gfx1100 0x041
> +#define bfd_mach_amdgcn_gfx1101 0x046
> +#define bfd_mach_amdgcn_gfx1102 0x047
>    bfd_arch_last
>    };
>  
> diff --git a/bfd/cpu-amdgcn.c b/bfd/cpu-amdgcn.c
> index 9d6c26056f3f..d9be7a399d97 100644
> --- a/bfd/cpu-amdgcn.c
> +++ b/bfd/cpu-amdgcn.c
> @@ -52,7 +52,10 @@ static const bfd_arch_info_type arch_info_struct[] =
>    N (bfd_mach_amdgcn_gfx1012, "amdgcn:gfx1012", false, NN (7)),
>    N (bfd_mach_amdgcn_gfx1030, "amdgcn:gfx1030", false, NN (8)),
>    N (bfd_mach_amdgcn_gfx1031, "amdgcn:gfx1031", false, NN (9)),
> -  N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NULL)
> +  N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NN (10)),
> +  N (bfd_mach_amdgcn_gfx1100, "amdgcn:gfx1100", false, NN (11)),
> +  N (bfd_mach_amdgcn_gfx1101, "amdgcn:gfx1101", false, NN (12)),
> +  N (bfd_mach_amdgcn_gfx1102, "amdgcn:gfx1102", false, NULL)
>  };
>  
>  const bfd_arch_info_type bfd_amdgcn_arch =
> diff --git a/binutils/readelf.c b/binutils/readelf.c
> index be2f3851c63a..4fd0a104a526 100644
> --- a/binutils/readelf.c
> +++ b/binutils/readelf.c
> @@ -4533,6 +4533,9 @@ decode_AMDGPU_machine_flags (char *out, unsigned int e_flags, Filedata *filedata
>      AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1031, "gfx1031")
>      AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1032, "gfx1032")
>      AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1033, "gfx1033")
> +    AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1100, "gfx1100")
> +    AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1101, "gfx1101")
> +    AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1102, "gfx1102")
>      AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX602, "gfx602")
>      AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX705, "gfx705")
>      AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX805, "gfx805")
> diff --git a/include/elf/amdgpu.h b/include/elf/amdgpu.h
> index d44244194e9d..15720356ac02 100644
> --- a/include/elf/amdgpu.h
> +++ b/include/elf/amdgpu.h
> @@ -67,8 +67,11 @@
>  #define EF_AMDGPU_MACH_AMDGCN_GFX1034 0x03e
>  #define EF_AMDGPU_MACH_AMDGCN_GFX90A  0x03f
>  #define EF_AMDGPU_MACH_AMDGCN_GFX940  0x040
> +#define EF_AMDGPU_MACH_AMDGCN_GFX1100 0x041
>  #define EF_AMDGPU_MACH_AMDGCN_GFX1013 0x042
>  #define EF_AMDGPU_MACH_AMDGCN_GFX1036 0x045
> +#define EF_AMDGPU_MACH_AMDGCN_GFX1101 0x046
> +#define EF_AMDGPU_MACH_AMDGCN_GFX1102 0x047
>  
>  /* Code object v3 machine flags.  */
>  
> 
> base-commit: 054f25955c2b77f6e21073bfdd70a60e9df1ffe7
  
Nick Clifton Nov. 10, 2023, 2:22 p.m. UTC | #2
Hi Simon,

> Ping.

Oops - sorry.

>> bfd/ChangeLog:
>>
>> 	* archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
>> 	bfd_mach_amdgcn_gfx1102): New.
>> 	* bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
>> 	bfd_mach_amdgcn_gfx1102): New.
>> 	* cpu-amdgcn.c (arch_info_struct): Add entries for
>> 	bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
>> 	bfd_mach_amdgcn_gfx1102.
>>
>> binutils/ChangeLog:
>>
>> 	* readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100,
>> 	gfx1101, gfx1102.
>>
>> include/ChangeLog:
>>
>> 	* elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100,
>> 	EF_AMDGPU_MACH_AMDGCN_GFX1101,
>> 	EF_AMDGPU_MACH_AMDGCN_GFX1102): New.

Approved - please apply.

Cheers
   Nick
  
Simon Marchi Nov. 10, 2023, 6:20 p.m. UTC | #3
On 11/10/23 09:22, Nick Clifton wrote:
> Hi Simon,
> 
>> Ping.
> 
> Oops - sorry.
> 
>>> bfd/ChangeLog:
>>>
>>>     * archures.c (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
>>>     bfd_mach_amdgcn_gfx1102): New.
>>>     * bfd-in2.h (bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
>>>     bfd_mach_amdgcn_gfx1102): New.
>>>     * cpu-amdgcn.c (arch_info_struct): Add entries for
>>>     bfd_mach_amdgcn_gfx1100, bfd_mach_amdgcn_gfx1101,
>>>     bfd_mach_amdgcn_gfx1102.
>>>
>>> binutils/ChangeLog:
>>>
>>>     * readelf.c (decode_AMDGPU_machine_flags): Handle gfx1100,
>>>     gfx1101, gfx1102.
>>>
>>> include/ChangeLog:
>>>
>>>     * elf/amdgpu.h (EF_AMDGPU_MACH_AMDGCN_GFX1100,
>>>     EF_AMDGPU_MACH_AMDGCN_GFX1101,
>>>     EF_AMDGPU_MACH_AMDGCN_GFX1102): New.
> 
> Approved - please apply.

Thanks Nick, will push.

Simon
  

Patch

diff --git a/bfd/archures.c b/bfd/archures.c
index b59979e60acc..c4455de7c289 100644
--- a/bfd/archures.c
+++ b/bfd/archures.c
@@ -575,6 +575,9 @@  DESCRIPTION
 .#define bfd_mach_amdgcn_gfx1030 0x036
 .#define bfd_mach_amdgcn_gfx1031 0x037
 .#define bfd_mach_amdgcn_gfx1032 0x038
+.#define bfd_mach_amdgcn_gfx1100 0x041
+.#define bfd_mach_amdgcn_gfx1101 0x046
+.#define bfd_mach_amdgcn_gfx1102 0x047
 .  bfd_arch_last
 .  };
 */
diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h
index eddb9902f5e4..cf748b48c528 100644
--- a/bfd/bfd-in2.h
+++ b/bfd/bfd-in2.h
@@ -1831,6 +1831,9 @@  enum bfd_architecture
 #define bfd_mach_amdgcn_gfx1030 0x036
 #define bfd_mach_amdgcn_gfx1031 0x037
 #define bfd_mach_amdgcn_gfx1032 0x038
+#define bfd_mach_amdgcn_gfx1100 0x041
+#define bfd_mach_amdgcn_gfx1101 0x046
+#define bfd_mach_amdgcn_gfx1102 0x047
   bfd_arch_last
   };
 
diff --git a/bfd/cpu-amdgcn.c b/bfd/cpu-amdgcn.c
index 9d6c26056f3f..d9be7a399d97 100644
--- a/bfd/cpu-amdgcn.c
+++ b/bfd/cpu-amdgcn.c
@@ -52,7 +52,10 @@  static const bfd_arch_info_type arch_info_struct[] =
   N (bfd_mach_amdgcn_gfx1012, "amdgcn:gfx1012", false, NN (7)),
   N (bfd_mach_amdgcn_gfx1030, "amdgcn:gfx1030", false, NN (8)),
   N (bfd_mach_amdgcn_gfx1031, "amdgcn:gfx1031", false, NN (9)),
-  N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NULL)
+  N (bfd_mach_amdgcn_gfx1032, "amdgcn:gfx1032", false, NN (10)),
+  N (bfd_mach_amdgcn_gfx1100, "amdgcn:gfx1100", false, NN (11)),
+  N (bfd_mach_amdgcn_gfx1101, "amdgcn:gfx1101", false, NN (12)),
+  N (bfd_mach_amdgcn_gfx1102, "amdgcn:gfx1102", false, NULL)
 };
 
 const bfd_arch_info_type bfd_amdgcn_arch =
diff --git a/binutils/readelf.c b/binutils/readelf.c
index be2f3851c63a..4fd0a104a526 100644
--- a/binutils/readelf.c
+++ b/binutils/readelf.c
@@ -4533,6 +4533,9 @@  decode_AMDGPU_machine_flags (char *out, unsigned int e_flags, Filedata *filedata
     AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1031, "gfx1031")
     AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1032, "gfx1032")
     AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1033, "gfx1033")
+    AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1100, "gfx1100")
+    AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1101, "gfx1101")
+    AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX1102, "gfx1102")
     AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX602, "gfx602")
     AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX705, "gfx705")
     AMDGPU_CASE (EF_AMDGPU_MACH_AMDGCN_GFX805, "gfx805")
diff --git a/include/elf/amdgpu.h b/include/elf/amdgpu.h
index d44244194e9d..15720356ac02 100644
--- a/include/elf/amdgpu.h
+++ b/include/elf/amdgpu.h
@@ -67,8 +67,11 @@ 
 #define EF_AMDGPU_MACH_AMDGCN_GFX1034 0x03e
 #define EF_AMDGPU_MACH_AMDGCN_GFX90A  0x03f
 #define EF_AMDGPU_MACH_AMDGCN_GFX940  0x040
+#define EF_AMDGPU_MACH_AMDGCN_GFX1100 0x041
 #define EF_AMDGPU_MACH_AMDGCN_GFX1013 0x042
 #define EF_AMDGPU_MACH_AMDGCN_GFX1036 0x045
+#define EF_AMDGPU_MACH_AMDGCN_GFX1101 0x046
+#define EF_AMDGPU_MACH_AMDGCN_GFX1102 0x047
 
 /* Code object v3 machine flags.  */