From patchwork Thu Sep 28 14:22:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 146150 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3350694vqu; Thu, 28 Sep 2023 07:23:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0cmoUW8mGzCbnlKMj/+8ST/5VxYRlpI9dgQaGLnTt3qJkU0VBTazCqeLYnRWYkakBoVsI X-Received: by 2002:a17:907:d8e:b0:9a5:794f:f3c5 with SMTP id go14-20020a1709070d8e00b009a5794ff3c5mr1363732ejc.6.1695910995921; Thu, 28 Sep 2023 07:23:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695910995; cv=none; d=google.com; s=arc-20160816; b=q9uqSQDKXFJgYKlQJdkM+l+J5Ya04jzM/hpoXsrrXUfsYuexYuLIQ/adevXdDOZtyt k36srMqM8gWGCVWRXzuege7SGhnVx6QlTYS0hfrKzs4MGHmci0aPSJgd67wyufTbsEUD szOT9mX1MPvL/+38XdMLXkk77PR8CUGiC9ca0FhQajed7Dh+BlRlV+spBx6nv/JDjfv2 kHjZ+wdHmGW2+AQ7w7xjM8GC7YiA1BS+cj4JFKmePqjOhf6crbMRY+qftBQR/KVQ2eym kv99XiFXSoSXkJ5f/wx9MFiLW7wNfAz3KqUwh8Qgcbae7MtmJxns1WDhwq8jILJ0tKHf Dwcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=C//uxPHU1zH78X3lCFe5y3lCDS8/65Cy/P/wuKi+syQ=; fh=LtgSZdymCq6LY1TYqi9C9vc10KmIHwUKYwEY2HnxPr8=; b=EqOvaLbMu/4jDGTpsdpEy30/eEzmq9xeRk9oNJ23ri+Hachlbec0w6btuncRDPjxq8 F11iwq81nzawNue5ioN3fPLgCMBSbp3eoexfSWppDIfgcvtoMChmNCoGXQunRcwnc1C0 2pWvYHWo1mJveT3B/Sd233ftKAjfrYg4WfLj92bHMds36BkX6xby6IGQ+K4iRvwQAwLc 2CdMfLu3P2olKquAzcwQ2C6lF+vdd4HDofhZicsWMqsWOHQEOe+oDbgjUbMyQFHnO1XI XyM6zzJr0dv3pR7KRv5LW/pkKmPaPxSpWVxE7A2LGeRTmdC+xLOdwftFrh7BZoOSHUYy R8KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ndkxOgXy; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id kj8-20020a170907764800b0099bcd27b459si14293426ejc.20.2023.09.28.07.23.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 07:23:15 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=ndkxOgXy; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 983673857C66 for ; Thu, 28 Sep 2023 14:23:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 983673857C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695910994; bh=C//uxPHU1zH78X3lCFe5y3lCDS8/65Cy/P/wuKi+syQ=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ndkxOgXyATa4BHpFYSfr8ako7WR/3+7uSELBclK/t5csQj+dy5fFuQ7YfNzzsFOij /ZOpPELgipW1b6Dc+UKGRzYyzUwUjopBJkNlkf7nZqr18Y8yVbC2EDVBFQyhBcJ3WQ r7t+SKfbKgAPgSH2Zk0oqqiSLxnv1ZIHesu/UWrs= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 861AB3858C52 for ; Thu, 28 Sep 2023 14:23:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 861AB3858C52 Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CF83F1E092; Thu, 28 Sep 2023 10:23:02 -0400 (EDT) To: binutils@sourceware.org Cc: Simon Marchi , Laurent Morichetti , Lancelot Six Subject: [PATCH] bfd, binutils: add gfx11 amdgpu architectures Date: Thu, 28 Sep 2023 10:22:42 -0400 Message-ID: <20230928142256.26768-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3497.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Simon Marchi via Binutils From: Simon Marchi Reply-To: Simon Marchi Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778291568240223471 X-GMAIL-MSGID: 1778291568240223471 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 Cc: Lancelot Six --- 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 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. */