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 B8158385380A for ; Mon, 3 Oct 2022 10:45:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B8158385380A 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 01F14300089; Mon, 3 Oct 2022 10:45:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1664793923; bh=bCHnXUqP57gpXEm2gWh52Az9tJul6rVte8okbk76V6A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Mime-Version:Content-Transfer-Encoding; b=tqp5Li7FE75nuAkC/p1L8i6IT00QGLxUwIrKNWyXK/KkHv8lEkAsD8Ortnb5Y5Fs7 TgVCBS99lJ+zH5TFOQ+mKnES8tqhYdsnxk63ZAItK2DnCbq1KNgf8iEjGxub4UvvCj i4kqMkWiqn/9h+OizCwiG/0Vp6E7gwBuCCDl3JyU= 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 5/6] RISC-V: Fix T-Head immediate types on printing Date: Mon, 3 Oct 2022 10:44:03 +0000 Message-Id: <5abe1d8a7694417b990e11d8f6cd6789573872e5.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 two minor typing-related issues for T-Head immediate operands. 1. A signed type must be specified when printing with %i. 2. unsigned/signed int is not portable enough for max 32-bit immediates. Instead, we should use unsigned/signed long. The format string is changed accordingly. opcodes/ChangeLog: * riscv-dis.c (print_insn_args): Fix T-Head immediate types on printing. --- opcodes/riscv-dis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opcodes/riscv-dis.c b/opcodes/riscv-dis.c index 7f5ca4dcb85..c0edc4c7d6b 100644 --- a/opcodes/riscv-dis.c +++ b/opcodes/riscv-dis.c @@ -596,11 +596,11 @@ print_insn_args (const char *oparg, insn_t l, bfd_vma pc, disassemble_info *info oparg--; if (!sign) - print (info->stream, dis_style_immediate, "%u", - (unsigned)EXTRACT_U_IMM (n, s, l)); + print (info->stream, dis_style_immediate, "%lu", + (unsigned long)EXTRACT_U_IMM (n, s, l)); else - print (info->stream, dis_style_immediate, "%i", - (unsigned)EXTRACT_S_IMM (n, s, l)); + print (info->stream, dis_style_immediate, "%li", + (signed long)EXTRACT_S_IMM (n, s, l)); break; default: goto undefined_modifier; -- 2.34.1