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 058DD3858402 for ; Mon, 10 Jan 2022 08:22:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 058DD3858402 Received: by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id B3F39300089; Mon, 10 Jan 2022 08:22:28 +0000 (UTC) From: Tsukasa OI To: Tsukasa OI Cc: binutils@sourceware.org Subject: [PATCH 0/1] RISC-V: Fix mask for some fcvt instructions Date: Mon, 10 Jan 2022 17:22:10 +0900 Message-Id: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.2 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.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, 10 Jan 2022 08:22:33 -0000 This patch fixes wrong mask used in following RISC-V instructions: - fcvt.s.wu - fcvt.s.lu - fcvt.d.lu - fcvt.q.lu For instance, 'fcvt.s.wu' instruction should have mask value "MASK_FCVT_S_WU|MASK_RM", not "MASK_FCVT_S_W|MASK_RM". Fortunately, this kind of error will not cause functional problem since MASK_FCVT_S_W and MASK_FCVT_S_WU have exactly the same value of 0xfff0007f. However, it's always good to fix this kind of stuff because it's definately an error and can be a code clarity problem. ... More of that, it can grow. Actually, I found this issue while implementing 'Zfh' and 'Zfhmin' instructions (yes, I copied 'F' instructions to make 'fcvt.h.wu' and 'fcvt.h.lu' instructions and found something is wrong). This is not hypothetical situation and happened before. For first three instructions ('fcvt.s.wu', 'fcvt.s.lu' and 'fcvt.d.lu'), it contained errors from very first (commit e23eba971dd409b999dd83d8df0f842680c1c642; the first time RISC-V is merged into GNU Binutils) and 'fcvt.q.lu' with an error is added in commit cc917fd93d2a836adfd61b91df021cf835e88fd1 (apparently, the author copied the 'D' instructions code without realizing a problem behind it). I machine-checked the entire riscv_opcodes and it should be the first **and** the last. Tsukasa OI (1): RISC-V: Fix mask for some fcvt instructions opcodes/riscv-opc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) base-commit: 4cfa9e3f28c8c5156b9773cc94192233947d351c -- 2.32.0