From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by sourceware.org (Postfix) with ESMTPS id D1B48385354A for ; Tue, 6 Sep 2022 12:22:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D1B48385354A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ej1-x631.google.com with SMTP id qh18so22795343ejb.7 for ; Tue, 06 Sep 2022 05:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=Bsfd0CligV8cZ1aTs0Mu6Sf4SYW1IUbBt70qMpBTJdk=; b=RsEldpF+ORPbaeDXdeQBXxA+jxFyKCoE5m2K5bGOEhjULjUeOPIqDt63DrFZ3vWxsZ oaCzUGuxej/P76pJWjvrrVxhtgY+aU4SY1UXR0kjq/f+ChLHmf7AxyZe8Jds10bxSKGz 33by+a8o/ryL1DUElGRh3Da9nzkro5Snfwfj03MqC8+q9Ip6nmVye+CfSA4Ufh1rRQPj 7QsbXxjKTy11+xryEn+/fd74WmBTuIyS4L30q7Ik6q7OcCU8OiADQPcV6A9TTLCwLVVG ZBh9KqTae+2+ZpxT+itL7Qs0Y9d4jB4mVG31GA8gpNiSBWcDtFM3OWSpYOMaxhtmYO1n RpcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=Bsfd0CligV8cZ1aTs0Mu6Sf4SYW1IUbBt70qMpBTJdk=; b=o8D//LSDHzrUwa0tHNhOfKhBKAl2+2JahzSHwKevgOUvEWYb4kZ1cmaAsScmjRojz0 u4NcMAXNKhtRqNflHYZDbaBlXrrbaPd5u8GlN5R1hqXP4aap3OPBkHc/nfEnloofYTnk 61EBnLHKEck3FksQ8DwF9g87k73lKQfnqRX3pLkX85E3NjHIdjpUz9MxJLN+DcfFoERY 5B5n4VDAQyrdJZlByeAV/LRBQvYW1dn+ARMwIeSKjg1gmCrjPSYWpFJs2oYjuzYxmWnY oscfhLynoJGok3MJXjeew0cX/S7WgsfsPKBSfGzLHY694TctZgHgoxNvTcBFDvyZDDpF J6kQ== X-Gm-Message-State: ACgBeo1V9gCzsP21LySwwN+xU0vi7jYZJvUYxyXhnOqPlneMc6/+ka8g O5UXyjLBNZVY+WwjB/SVvU+LemfwsdNsbw== X-Google-Smtp-Source: AA6agR6Xc1Wri+4z28hZPkvHNBzW7jZOC7439oUGTFDqS+XbRLPv9vhQrvoXdttDf0CggxlZu7Gxpw== X-Received: by 2002:a17:906:e12:b0:750:bf91:caa4 with SMTP id l18-20020a1709060e1200b00750bf91caa4mr14767176eji.387.1662466939479; Tue, 06 Sep 2022 05:22:19 -0700 (PDT) Received: from beast.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id y21-20020a170906525500b0073d7e58b1bcsm6571632ejm.157.2022.09.06.05.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 05:22:19 -0700 (PDT) From: Christoph Muellner To: binutils@sourceware.org, Nelson Chu , Kito Cheng , Jim Wilson , Philipp Tomsich , Palmer Dabbelt , Cooper Qu , Lifang Xia , Yunhai Shang , Zhiwei Liu Cc: =?UTF-8?q?Christoph=20M=C3=BCllner?= Subject: [PATCH 01/13] RISC-V: Add generic support for vendor extensions Date: Tue, 6 Sep 2022 14:22:01 +0200 Message-Id: <20220906122213.1243129-2-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220906122213.1243129-1-christoph.muellner@vrull.eu> References: <20220906122213.1243129-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,JMQ_SPF_NEUTRAL,KAM_MANYTO,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: From: Christoph Müllner This patch introduces changes that allow the integration of vendor ISA extensions: * Define a list of vendor extensions (riscv_supported_vendor_x_ext) where vendor extensions can be added * Introduce a section with a table in the documentation where vendor extensions can be added To add a vendor extension that consists of instructions only, the following things need to be done: * Add the extension to the riscv_supported_vendor_x_ext list * Add lookup entry in riscv_multi_subset_supports * Documenting the extension in c-riscv.texti * Add test cases for all instructions * Add MATCH*/MASK* constants and DECLARE_INSN() for all instructions * Add new instruction class to enum riscv_insn_class * Define the instructions in riscv_opcodes * Additional changes if necessary (depending on the instructions) Signed-off-by: Christoph Müllner --- bfd/elfxx-riscv.c | 9 +++++++-- gas/doc/c-riscv.texi | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/bfd/elfxx-riscv.c b/bfd/elfxx-riscv.c index 8cb3c8d4930..d712dc3e3a7 100644 --- a/bfd/elfxx-riscv.c +++ b/bfd/elfxx-riscv.c @@ -1221,12 +1221,18 @@ static struct riscv_supported_ext riscv_supported_std_zxm_ext[] = {NULL, 0, 0, 0, 0} }; +static struct riscv_supported_ext riscv_supported_vendor_x_ext[] = +{ + {NULL, 0, 0, 0, 0} +}; + const struct riscv_supported_ext *riscv_all_supported_ext[] = { riscv_supported_std_ext, riscv_supported_std_z_ext, riscv_supported_std_s_ext, riscv_supported_std_zxm_ext, + riscv_supported_vendor_x_ext, NULL }; @@ -1482,8 +1488,7 @@ riscv_get_default_ext_version (enum riscv_spec_class *default_isa_spec, case RV_ISA_CLASS_ZXM: table = riscv_supported_std_zxm_ext; break; case RV_ISA_CLASS_Z: table = riscv_supported_std_z_ext; break; case RV_ISA_CLASS_S: table = riscv_supported_std_s_ext; break; - case RV_ISA_CLASS_X: - break; + case RV_ISA_CLASS_X: table = riscv_supported_vendor_x_ext; break; default: table = riscv_supported_std_ext; } diff --git a/gas/doc/c-riscv.texi b/gas/doc/c-riscv.texi index 21d867e9cf0..30afd200b7d 100644 --- a/gas/doc/c-riscv.texi +++ b/gas/doc/c-riscv.texi @@ -20,6 +20,7 @@ * RISC-V-Modifiers:: RISC-V Assembler Modifiers * RISC-V-Formats:: RISC-V Instruction Formats * RISC-V-ATTRIBUTE:: RISC-V Object Attribute +* RISC-V-CustomExts:: RISC-V Custom (Vendor-Defined) Extensions @end menu @node RISC-V-Options @@ -692,3 +693,16 @@ the privileged specification. It will report errors if object files of different privileged specification versions are merged. @end table + +@node RISC-V-CustomExts +@section RISC-V Custom (Vendor-Defined) Extensions +@cindex custom (vendor-defined) extensions, RISC-V +@cindex RISC-V custom (vendor-defined) extensions + +The following table lists the custom (vendor-defined) RISC-V +extensions supported and provides the location of their +publicly-released documentation: + +@table @r + +@end table -- 2.37.2