From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id qNtuCvuuPmNzkgYAWB0awg (envelope-from ) for ; Thu, 06 Oct 2022 06:33:31 -0400 Received: by simark.ca (Postfix, from userid 112) id 1DE351E112; Thu, 6 Oct 2022 06:33:31 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=bTB5kDWZ; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id BCF951E0CB for ; Thu, 6 Oct 2022 06:33:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1A411383FB83 for ; Thu, 6 Oct 2022 10:33:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A411383FB83 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665052410; bh=VlsXfoWrxY9eY1HJNLy0wPrwHlF6CZYYep9PSvVtWv4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bTB5kDWZ1dczUQ+nQXLEdUf18+X0Wz8yyg7IuYHSpJusDPHBPCEAAoJ3SYthKri5V A/zbHWqNqQn3hgq6ITtZgn48Dxt9Xm0GyQZLT9ZhstHzU4Jl+9uUEcGdVoYNRhzDxL IRR/mAs9VljVP5UN/2g9CTnbCqN0UGASWyN6IbfM= Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id BDF723854164 for ; Thu, 6 Oct 2022 10:33:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BDF723854164 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 1F688300089; Thu, 6 Oct 2022 10:33:08 +0000 (UTC) To: Tsukasa OI , Palmer Dabbelt Subject: [PING^3 PATCH 0/1] sim/riscv: PR29595, Fix broken RISC-V simulater after implementing 'Zmmul' Date: Thu, 6 Oct 2022 10:32:59 +0000 Message-Id: In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit 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: , From: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" NOTE: the cover letter and subject may change each time I ping. Hello, As I describe later, this patchset fixes now-broken RISC-V instruction simulator. I hope this patchset is approved as fast as possible since it's clearly a functional blocker for GDB 13.1. The patch is a PING (3) of . Issue Tracker on Sourceware Bugzilla: Tracker on GitHub: Previous: 'Zmmul' v5: 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. For multiply/divide instructions in the 'M' extension, only division / remainder instructions work and **multiply instructions cause a trap**. This is because only one side of my 'Zmmul' patchset is applied and GDB- part of my 'Zmmul' patchset (this) is not approved yet. 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. Regards, Tsukasa Tsukasa OI (1): sim/riscv: PR29595, Fix multiply instructions 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: 80e0c6dc91f52fad32c3ff3cf20da889d77013ac -- 2.34.1