From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 30653382CDEA for ; Sat, 27 Aug 2022 00:24:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30653382CDEA 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 6D2C3300089; Sat, 27 Aug 2022 00:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1661559844; bh=CiTKqSamUjDM2XUC/PYUFad32MF9xFPipIXVMrBFxjM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=iBn+otnnd3QMqC5lj8xaCxyRVEsv2Ve2nybApLcl4RG3+BQqqETqbhNxEqq8uW8+K tVCf9QXVfoZ2AMnWVgERY4rpaCMv/fx3P6WIAQGCD78oKBOue1WsICQbesfXcA72vB esFed6rF1fFHD99N/W1s9KU85oQD46q1ONn7ZF3w= From: Tsukasa OI To: Tsukasa OI , "H . Peter Anvin" , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Nelson Chu Cc: binutils@sourceware.org Subject: [PATCH v8 6/7] RISC-V: Clarify that `wide' is only used for ADDIW Date: Sat, 27 Aug 2022 00:22:58 +0000 Message-Id: <8cf90e057194efd7bafea24eb30eabc8c5ba6107.1661559777.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_MANYTO,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 List-Id: The `wide' parameter on the `maybe_print_address' function is only used for the ADDIW/C.ADDIW instructions and there's no reasonable usecases except those two. This commit renames the parameter from `wide' to `is_addiw' to clarify that this parameter is only used for ADDIW instructions. opcodes/ChangeLog: * riscv-dis.c (maybe_print_address): Clarify and rename the last parameter so that this is only used for ADDIW instructions. --- opcodes/riscv-dis.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index 160cc40f865..7322db10d24 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -172,7 +172,7 @@ arg_print (struct disassemble_info *info, unsigned long val, static void maybe_print_address (struct riscv_private_data *pd, int base_reg, int offset, - int wide) + int is_addiw) { if (pd->hi_addr[base_reg] != (bfd_vma)-1) { @@ -187,8 +187,8 @@ maybe_print_address (struct riscv_private_data *pd, int base_reg, int offset, return; /* Don't print the address. */ pd->to_print_addr = true; - /* Sign-extend a 32-bit value to a 64-bit value. */ - if (wide) + /* On ADDIW, sign-extend a 32-bit value to a 64-bit value. */ + if (is_addiw) pd->print_addr = (bfd_vma)(int32_t) pd->print_addr; /* Fit into a 32-bit value on RV32. */ -- 2.34.1