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 81DEC3857022 for ; Mon, 3 Oct 2022 10:44:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81DEC3857022 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 CA5F5300089; Mon, 3 Oct 2022 10:44:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1664793881; bh=XhP0yFeHlXr+D43FVFxRhICNf12gZNGIM4evY+j5uVA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=ooH8csgCt8QcKqskawPrLH2tK5o5nfV7glIfDvVfIGmQUKFoGcyhckOWHP7SiOaMk /emqvDpMDu6ZfmLFM159LGqzsnnOtvVsH1DfhSHezMT6qQeWaAGscW2xjZLkPS8eaF m7WhwPvBWho6ze5iif7cjaH1A83sj0hubXJBveeU= From: Tsukasa OI To: Tsukasa OI , =?UTF-8?q?Christoph=20M=C3=BCllner?= , Nelson Chu , Kito Cheng , Palmer Dabbelt , Andrew Burgess Cc: binutils@sourceware.org Subject: [PATCH v3 1/6] RISC-V: Fix immediates to have "immediate" style Date: Mon, 3 Oct 2022 10:43:59 +0000 Message-Id: <7ba14fc4472ce97d4f7a4433cad8a571e89f82f4.1664793840.git.research_trasio@irq.a4lg.com> In-Reply-To: References: Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,GIT_PATCH_0,KAM_MANYTO,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 6ac69490b78..a5bfa97058a 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