From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 9952C3857718 for ; Tue, 12 Sep 2023 01:40:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9952C3857718 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id EB06C300089; Tue, 12 Sep 2023 01:40:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1694482841; bh=pSBxpQvkfR54xjxFbMecb0WPpzZ6FJ2KVqyRFP55scM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=Y8b3KVAZANVIggxd3IiItXgrliIH2982JrO2aJGiyQMDEseokd3N1FOyiOAbEtSJR aat63/fOwpi8wOwjW4yVl1kGOj+tHQyP2eLVoimgfxP9dkrg886GGYlibJiC6L37qd CPC1Fu8Z4Ul/SD/rbN5lQLbr2gqQ+DpdMPicpd1c= From: Tsukasa OI To: Tsukasa OI Cc: binutils@sourceware.org Subject: [REVIEW ONLY v3 0/1] RISC-V (unratified): Add 'Smrnmi' extension Date: Tue, 12 Sep 2023 01:40:16 +0000 Message-ID: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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: *** WAIT FOR SPECIFICATION FREEZE *** This is an implementation for unratified and not frozen RISC-V extension and not intended to be merged for now. The only intent to submit this patchset is to test new instructions for your (possibly virtual) environment and early review for fast adoption after ratification. This is the review-only PATCH v3 to keep track with the latest GNU Binutils. In this version, I didn't add anything new but rebases on the latest master (previous one should cause merge conflicts). This patchset adds following unratified extension to GNU Binutils: - Smrnmi (Resumable NMI) version 0.4 (may change on ratification) ... which adds "mnret" instruction and 4 CSRs related to RNMI. This extension provides "resumable NMIs" to provide special non-maskable interrupts (NMIs) with "resume" capability (normally, NMIs are are only used for hardware error conditions and not resumable; however on some conditions, there are some cases where using NMIs fits better yet resumable after proper handling by the NMI handler [which may fail though]). This is based on a draft version of the RISC-V ISA Manual: Note that it has **different** CSR values between proposed RNMI version 0.4 and RNMI as optionally implemented in SiFive U74-MC: | CSR | proposed | SiFive | | --------- | -------- | ------ | | mnscratch | 0x740 | 0x350 | | mnepc | 0x741 | 0x351 | | mncause | 0x742 | 0x352 | | mnstatus | 0x744 | 0x353 | Also, although that 4 CSRs are assigned with actual numbers (this is why I'm not attaching "CSR instantiation" script in this patchset), it may be changed before ratification. Be careful. Tsukasa OI (1): UNRATIFIED RISC-V: Add 'Smrnmi' extension and its CSRs bfd/elfxx-riscv.c | 6 ++++++ gas/config/tc-riscv.c | 4 ++++ gas/testsuite/gas/riscv/csr-dw-regnums.d | 4 ++++ gas/testsuite/gas/riscv/csr-dw-regnums.s | 5 +++++ gas/testsuite/gas/riscv/csr-version-1p10.d | 8 ++++++++ gas/testsuite/gas/riscv/csr-version-1p10.l | 16 ++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p11.d | 8 ++++++++ gas/testsuite/gas/riscv/csr-version-1p11.l | 16 ++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p12.d | 8 ++++++++ gas/testsuite/gas/riscv/csr-version-1p12.l | 16 ++++++++++++++++ gas/testsuite/gas/riscv/csr-version-1p9p1.d | 8 ++++++++ gas/testsuite/gas/riscv/csr-version-1p9p1.l | 16 ++++++++++++++++ gas/testsuite/gas/riscv/csr.s | 6 ++++++ gas/testsuite/gas/riscv/smrnmi-noarch.d | 3 +++ gas/testsuite/gas/riscv/smrnmi-noarch.l | 2 ++ gas/testsuite/gas/riscv/smrnmi.d | 10 ++++++++++ gas/testsuite/gas/riscv/smrnmi.s | 2 ++ include/opcode/riscv-opc.h | 15 +++++++++++++++ include/opcode/riscv.h | 1 + opcodes/riscv-opc.c | 3 +++ 20 files changed, 157 insertions(+) create mode 100644 gas/testsuite/gas/riscv/smrnmi-noarch.d create mode 100644 gas/testsuite/gas/riscv/smrnmi-noarch.l create mode 100644 gas/testsuite/gas/riscv/smrnmi.d create mode 100644 gas/testsuite/gas/riscv/smrnmi.s base-commit: 318d3bda5cad124bd11eebb0349d0f183ba625b1 -- 2.42.0