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 78BDC383CCCB for ; Wed, 31 Aug 2022 01:46:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 78BDC383CCCB Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 255CC300089; Wed, 31 Aug 2022 01:46:22 +0000 (UTC) From: Tsukasa OI To: Andrew Burgess , Palmer Dabbelt , Mike Frysinger Cc: Tsukasa OI , gdb-patches@sourceware.org Subject: [PATCH 0/1] sim: Fix RISC-V multiply instructions on simulator Date: Wed, 31 Aug 2022 01:46:07 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Aug 2022 01:46:28 -0000 Hi, Due to opcodes changes (to add the 'Zmmul' extension in the commit 0938b032daa5 "RISC-V: Add 'Zmmul' extension in assembler."), the instruction simulator for RISC-V is now broken. This is because only one side of my 'Zmmul' patchset is applied. Tracker on GitHub: Previous: 'Zmmul' v5: In the current master, multiply instructions of the RISC-V simulator doesn't work. The cause was simple. The RISC-V simulator supports 'I', 'M' and 'A' extensions and the instruction is identified by those instruction classes: - INSN_CLASS_I (for 'I') - INSN_CLASS_M (for 'M') - INSN_CLASS_A (for 'A') After adding the 'Zmmul' extension, INSN_CLASS_M is splitted to: - INSN_CLASS_ZMMUL (multiply instructions) - INSN_CLASS_M (division instructions) So, the simulator must handle INSN_CLASS_ZMMUL separately. My 'Zmmul' patchset fixed that and I added a testcase (checks whether all RV32M instructions run without any fault) but only opcodes part is applied so it's now broken state for the simulator. This is the simulator part of the original 'Zmmul' patchset (from PATCH v5). Note: To confirm that the simulator is fixed, it requires another patch. Without the patch above, all multiply instructions will still work. Still, testing whether the simulator works with this extension (with `make check-sim') requires it. Thanks, Tsukasa Tsukasa OI (1): sim: Fix RISC-V multiply instructions on simulator sim/riscv/sim-main.c | 1 + sim/testsuite/riscv/m-ext.s | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sim/testsuite/riscv/m-ext.s base-commit: 803584b96d97e1f6ea50b0a0064d2a03ab0baa60 -- 2.34.1