From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from cstnet.cn (smtp25.cstnet.cn [159.226.251.25]) by sourceware.org (Postfix) with ESMTP id B4AF53858416 for ; Mon, 15 Nov 2021 03:04:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B4AF53858416 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=iscas.ac.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=iscas.ac.cn Received: from localhost.localdomain (unknown [120.78.13.226]) by APP-05 (Coremail) with SMTP id zQCowAA3F+whzpFhRu5OBw--.40999S2; Mon, 15 Nov 2021 11:04:02 +0800 (CST) From: jiawei To: binutils@sourceware.org Cc: kito.cheng@sifive.com, nelson.chu@sifive.com, jimw@sifive.com, philipp.tomsich@vrull.eu, mjos@pqshield.com, ben.marshall@pqshield.com, cmuellner@ventanamicro.com, palmer@dabbelt.com, andrew@sifive.com, lazyparser@gmail.com, siyu@isrc.iscas.ac.cn, schwab@linux-m68k.org, jbeulich@suse.com, jiawei Subject: [PATCH v4 0/3] RISC-V: Support Scalar Cryptography extension Date: Mon, 15 Nov 2021 11:03:40 +0800 Message-Id: <20211115030343.276103-1-jiawei@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowAA3F+whzpFhRu5OBw--.40999S2 X-Coremail-Antispam: 1UD129KBjvJXoWxtF4kCw48WrykJw47uFy3Jwb_yoW7CFyDp3 y8GF1FkrZ5JFnrtFn7Kr1jqF4fJw1rWryY934fZ3WayrWftrWUtrn3tw13AFs3tFW8Wwn5 ur429r1rury3tFDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUv214x267AKxVW8JVW5JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0 rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK02 1l84ACjcxK6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j 6F4UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr 1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv 7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r 1j6r4UM4x0Y48IcxkI7VAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02 628vn2kIc2xKxwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s026c 02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_Jw0_ GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20xvEc7 CjxVAFwI0_Gr0_Cr1lIxAIcVCF04k26cxKx2IYs7xG6rW3Jr0E3s1lIxAIcVC2z280aVAF wI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa 7VUbXdbUUUUUU== X-Originating-IP: [120.78.13.226] X-CM-SenderInfo: 5mld4v3l6l2u1dvotugofq/1tbiCwkGAFz4kl1PHgABs- X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Nov 2021 03:04:18 -0000 This patch is support Scalar Cryptography extension(k-ext v1.0.0-rc6) as binutils part, you can find gcc patches part in https://github.com/WuSiYu/riscv-gcc/tree/trunk-crypto-rebase by siyu@isrc.iscas.ac.cn. The first patch fix the order check with 'z' begin sub-extension, it set 'zb' before 'zk' as a right case. Some instruction in 'zbkb' and 'zbkc' is both used by Bitmanip and Scalar Cryptography extension, we just redefine the class with them. Here is the github repo link contain this patch: https://github.com/pz9115/riscv-binutils-gdb/commits/k-ext-rebase, the old version of this work is form https://github.com/riscv-collab/riscv-binutils-gdb/pull/254, Thanks for Nelson Chu and Jim Wilson's review and help. Version logs: v2: Add missing arch "k" in riscv_supported_std_ext[] to make the order check right with "zk" behind "zb" as Neslon Chu's comment. v3: Remove the trailing spaces as Andreas Schwab's comment. Add commit for each patch and add split testcases into sub-extension tests as Christoph Muellner's comment. v4: Change letter order in riscv_supported_std_ext[], Move INSN_CLASS_* into follow patch, Fix SHFL/UNSHFL Mask error, Fix typo error, Add CSR_CLASS ZKR for ES_CSR as Neslon Chu's comment. jiawei (3): RISC-V: Minimal support of scalar crypto extension RISC-V: Scalar crypto instructions and operand set RISC-V: Scalar crypto instruction and Entropy Source CSR testcases bfd/elfxx-riscv.c | 53 ++++++++++++ gas/config/tc-riscv.c | 29 +++++++ gas/testsuite/gas/riscv/k-ext-64.d | 47 ++++++++++ gas/testsuite/gas/riscv/k-ext-64.s | 38 ++++++++ gas/testsuite/gas/riscv/k-ext.d | 44 ++++++++++ gas/testsuite/gas/riscv/k-ext.s | 35 ++++++++ .../gas/riscv/priv-reg-fail-version-1p10.d | 2 +- .../gas/riscv/priv-reg-fail-version-1p11.d | 2 +- .../gas/riscv/priv-reg-fail-version-1p9p1.d | 2 +- .../gas/riscv/priv-reg-version-1p10.d | 1 + .../gas/riscv/priv-reg-version-1p11.d | 1 + .../gas/riscv/priv-reg-version-1p9p1.d | 1 + gas/testsuite/gas/riscv/priv-reg.s | 3 + gas/testsuite/gas/riscv/zbkb-32.d | 22 +++++ gas/testsuite/gas/riscv/zbkb-32.s | 13 +++ gas/testsuite/gas/riscv/zbkb-64.d | 24 ++++++ gas/testsuite/gas/riscv/zbkb-64.s | 15 ++++ gas/testsuite/gas/riscv/zbkc-32.d | 12 +++ gas/testsuite/gas/riscv/zbkc-64.d | 12 +++ gas/testsuite/gas/riscv/zbkc.s | 3 + gas/testsuite/gas/riscv/zbkx-32.d | 12 +++ gas/testsuite/gas/riscv/zbkx-64.d | 12 +++ gas/testsuite/gas/riscv/zbkx.s | 3 + gas/testsuite/gas/riscv/zknd-32.d | 12 +++ gas/testsuite/gas/riscv/zknd-32.s | 3 + gas/testsuite/gas/riscv/zknd-64.d | 15 ++++ gas/testsuite/gas/riscv/zknd-64.s | 6 ++ gas/testsuite/gas/riscv/zkne-32.d | 12 +++ gas/testsuite/gas/riscv/zkne-32.s | 3 + gas/testsuite/gas/riscv/zkne-64.d | 14 +++ gas/testsuite/gas/riscv/zkne-64.s | 5 ++ gas/testsuite/gas/riscv/zknh-32.d | 20 +++++ gas/testsuite/gas/riscv/zknh-32.s | 11 +++ gas/testsuite/gas/riscv/zknh-64.d | 18 ++++ gas/testsuite/gas/riscv/zknh-64.s | 9 ++ gas/testsuite/gas/riscv/zksed-32.d | 12 +++ gas/testsuite/gas/riscv/zksed-64.d | 12 +++ gas/testsuite/gas/riscv/zksed.s | 3 + gas/testsuite/gas/riscv/zksh-32.d | 12 +++ gas/testsuite/gas/riscv/zksh-64.d | 12 +++ gas/testsuite/gas/riscv/zksh.s | 3 + include/opcode/riscv-opc.h | 75 ++++++++++++++++ include/opcode/riscv.h | 18 ++++ opcodes/riscv-dis.c | 8 ++ opcodes/riscv-opc.c | 86 +++++++++++++++---- 45 files changed, 735 insertions(+), 20 deletions(-) create mode 100644 gas/testsuite/gas/riscv/k-ext-64.d create mode 100644 gas/testsuite/gas/riscv/k-ext-64.s create mode 100644 gas/testsuite/gas/riscv/k-ext.d create mode 100644 gas/testsuite/gas/riscv/k-ext.s create mode 100644 gas/testsuite/gas/riscv/zbkb-32.d create mode 100644 gas/testsuite/gas/riscv/zbkb-32.s create mode 100644 gas/testsuite/gas/riscv/zbkb-64.d create mode 100644 gas/testsuite/gas/riscv/zbkb-64.s create mode 100644 gas/testsuite/gas/riscv/zbkc-32.d create mode 100644 gas/testsuite/gas/riscv/zbkc-64.d create mode 100644 gas/testsuite/gas/riscv/zbkc.s create mode 100644 gas/testsuite/gas/riscv/zbkx-32.d create mode 100644 gas/testsuite/gas/riscv/zbkx-64.d create mode 100644 gas/testsuite/gas/riscv/zbkx.s create mode 100644 gas/testsuite/gas/riscv/zknd-32.d create mode 100644 gas/testsuite/gas/riscv/zknd-32.s create mode 100644 gas/testsuite/gas/riscv/zknd-64.d create mode 100644 gas/testsuite/gas/riscv/zknd-64.s create mode 100644 gas/testsuite/gas/riscv/zkne-32.d create mode 100644 gas/testsuite/gas/riscv/zkne-32.s create mode 100644 gas/testsuite/gas/riscv/zkne-64.d create mode 100644 gas/testsuite/gas/riscv/zkne-64.s create mode 100644 gas/testsuite/gas/riscv/zknh-32.d create mode 100644 gas/testsuite/gas/riscv/zknh-32.s create mode 100644 gas/testsuite/gas/riscv/zknh-64.d create mode 100644 gas/testsuite/gas/riscv/zknh-64.s create mode 100644 gas/testsuite/gas/riscv/zksed-32.d create mode 100644 gas/testsuite/gas/riscv/zksed-64.d create mode 100644 gas/testsuite/gas/riscv/zksed.s create mode 100644 gas/testsuite/gas/riscv/zksh-32.d create mode 100644 gas/testsuite/gas/riscv/zksh-64.d create mode 100644 gas/testsuite/gas/riscv/zksh.s -- 2.25.1