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 F31F83858284 for ; Mon, 26 Sep 2022 12:27:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F31F83858284 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 1DD16300089; Mon, 26 Sep 2022 12:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1664195230; bh=kg9NI+qCQiQiAcgb2WUoRrEvgklC24MFuWZN5AZYOiY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=bi51mTboDJH2Bjc8zDcuhOzlpHeSpPGAxhgL5SPlzBRBjZqa5qAyNJU+pXAnjpZDW 3saPFZhmfG/1qAxKWjRgPOyQZM7tyA3Y3DaZo0UwwBbiJp1o3lk19laUuDO3Y5m6Ya U2QHYf/rryd3BzYOPwvm/igq/p7i+cT1bPcRTAok= From: Tsukasa OI To: Tsukasa OI , Nelson Chu , Kito Cheng , Palmer Dabbelt Cc: binutils@sourceware.org Subject: [PATCH v2 1/6] RISC-V: Fix immediates to have "immediate" style Date: Mon, 26 Sep 2022 12:26:50 +0000 Message-Id: <9f9d826b0a2f12e6fceabc4416638c1f4f1002c2.1664195181.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,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: This commit fixes certain print calls on immediate operands to have dis_style_immediate. opcodes/ChangeLog: * riscv-dis.c (print_insn_args): Fix immediates to have "immediate" style. (riscv_disassemble_data): Likewise. --- opcodes/riscv-dis.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index f2d399260c1..a944e7865fe 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -480,7 +480,7 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info break; case 'y': - print (info->stream, dis_style_text, "0x%x", + print (info->stream, dis_style_immediate, "0x%x", (int)EXTRACT_OPERAND (BS, l)); break; @@ -549,17 +549,17 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info if (riscv_csr_hash[csr] != NULL) print (info->stream, dis_style_text, "%s", riscv_csr_hash[csr]); else - print (info->stream, dis_style_text, "0x%x", csr); + print (info->stream, dis_style_immediate, "0x%x", csr); break; } case 'Y': - print (info->stream, dis_style_text, "0x%x", + print (info->stream, dis_style_immediate, "0x%x", (int) EXTRACT_OPERAND (RNUM, l)); break; case 'Z': - print (info->stream, dis_style_text, "%d", rs1); + print (info->stream, dis_style_immediate, "%d", rs1); break; case 'X': /* Integer immediate. */ @@ -963,7 +963,7 @@ riscv_disassemble_data (bfd_vma memaddr ATTRIBUTE_UNUSED, (*info->fprintf_styled_func) (info->stream, dis_style_assembler_directive, ".byte\t"); (*info->fprintf_styled_func) - (info->stream, dis_style_assembler_directive, "0x%02llx", + (info->stream, dis_style_immediate, "0x%02llx", (unsigned long long) data); break; case 2: -- 2.34.1