From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by sourceware.org (Postfix) with ESMTPS id 792C33857415 for ; Sun, 18 Sep 2022 07:24:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 792C33857415 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-ed1-x530.google.com with SMTP id 29so37015069edv.2 for ; Sun, 18 Sep 2022 00:24:02 -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=9C3Zb6YhtiK53k+RrkKfARNIFYg+jv56bDN8yKxfyZ4=; b=iEAMwrmTFPKlhuFk3ovZxTEe/JFYNpe++txci9g8Yhih2mplzPKYFRBJmCKtGua8ZJ iwg1Gd1pMITjP+Uum/BLEcVy+RqnDFTRcq0lvH1woRAegWn27GEYzU6cCoMYk6gbD0SO QzKYA51cCujkJINjHArcZsTmIxtqxRAg2OuT5c0sWLt/toKYFlcTbMqTNmhnQF5PEweF xZiAGADoPTuIoechZevbESaTMPsD39PPJmrVpEVp1y/EEW2veAMOxDG6NWb7OkyNIy5r MLHKxbjb9Q95w9AfJYS9YlAsH/plFtWLFxJvT/3Ka/ci17sQ5BbxoRV147afNJ9T9dn4 AHWw== 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=9C3Zb6YhtiK53k+RrkKfARNIFYg+jv56bDN8yKxfyZ4=; b=NatbNhEvd646FrrFCJYVK5r/UEYv0DkKUAUnSyjjkZi6WeyVcUHXfdbFRS4JDOtcfO Eht83ZCo43ZqJ7R21iTIYN2fwfGo4tKIXweOSuPpkHn5wkW2WnYkfrgg6vkOzbhaEqas 7ie+8sH0Xolu/pyD8VYhECxakTTa5h3OfZgoYRvojIyvLkVZIie736DiahYGLq2wJec/ fulir1UkYXA4ftXyrGTwNyFwlilmBLUonNDvfRAZuw/lCxAAoxBTwJesE6ielqc+lNPO 8bNk5P6uDzOvLhAxfS1ZofRbYx3VuCkkxvUUm+Xd2L+Gjfp1MUiPfOpxZYJxyZ/VOaoK UHrw== X-Gm-Message-State: ACrzQf0ZfA8Xjc92RdlM9z8gQs1KuOu0E606IPGsqdea0E9zhcrbPEJV bNK+YaUJNnms7brEeFyp5NMGl5+t72zsGXRo X-Google-Smtp-Source: AMsMyM5vyPuI8NYLy1I1gsOFTRPDPNIyGgDO80BZhyBOfMxEbYuxY5QK0YD4JJfLxcHG4VCtX4v7iw== X-Received: by 2002:aa7:cfd1:0:b0:451:de20:3392 with SMTP id r17-20020aa7cfd1000000b00451de203392mr10680725edy.16.1663485841054; Sun, 18 Sep 2022 00:24:01 -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 e24-20020a170906315800b0073d15dfdc09sm13754108eje.11.2022.09.18.00.24.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Sep 2022 00:24:00 -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 v2 01/11] RISC-V: Add generic support for vendor extensions Date: Sun, 18 Sep 2022 09:23:46 +0200 Message-Id: <20220918072356.2496130-2-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220918072356.2496130-1-christoph.muellner@vrull.eu> References: <20220918072356.2496130-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.4 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 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 e03b312a381..1d891dee610 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