From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-x535.google.com (mail-ed1-x535.google.com [IPv6:2a00:1450:4864:20::535]) by sourceware.org (Postfix) with ESMTPS id D5B2C3858D32 for ; Mon, 3 Oct 2022 11:06:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D5B2C3858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-ed1-x535.google.com with SMTP id m3so14025433eda.12 for ; Mon, 03 Oct 2022 04:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=Vr9PdVj5IM6N8/10S2igBm6y13zMN3qG94Pa61GRp74=; b=UORQXvWltYJ2eyScwqEWlP5zWGBYNswJkR0SfobFjDQI5B5GxFZkxxeoLlrClSxT74 ty4aPbmMIab4aoQRRYMGG73mTuqDH5VV1Ku3MJ4l7r30EuNCyHmRpC9JZXIpLSHRSQCn 3JfEv3phxTRIiPSVz3hqGMALWFTIRhsxkFU4eevNW+qdRwdT6cIZsd+dtxt2CUN2Z4t1 HMR+sJzKGaUcWMO5/CNXnBAlHTMEA8JWHPamNWXImJlxm6ftNTanu0uwATiA+UsRedfv b5rnh8fyyuxd8MmdoJHprsiiFxmbP6ikl00kO+nYC4l5KljPD9wJEk25CO4gMzxTYZOy NXfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=Vr9PdVj5IM6N8/10S2igBm6y13zMN3qG94Pa61GRp74=; b=ERy8NTmt3rwvT0B0JKxEYax5I8jf98Ds6WjIz27GokHu+QdoEmD5fvMUw7A4vtW4aM oV15/KBrkaWCpMFJlzGYW+bEHbVlOzmIDvs/B5Qbr14dW2Xfd43nXKzVvtoXK4Dsf2Aj 8kcUv2zQC09mjHa7K/jKiFcrIG5Pye7gmE88iOBrYAYSSUo3CogWYD7aa6jUFm1UMX38 nu5Q06GklgUPqNCWt13sW6ql1zziA1iDarFJ/umURxOtpwIdY1rfGjXZpF0hfv2l4Al4 LeKIDaM+P0h7h+sB7xKBpXLX2YB6efKPDo0RiiWHLMuQp0XH4dRuwTNNGgIKQ/m4N78x Kc3w== X-Gm-Message-State: ACrzQf1iOuk4nV3eTnrSvDuLcarx8z+daXH/T7Yaf2rRY28ZMbfrj1Ed apjULPcLa54q4awdkE7Qv89xV1hGN71W2vKK5Ks+xg== X-Google-Smtp-Source: AMsMyM7OPrtYGdD7yvT4iiPDQnpqrT45CjgJCLq7rwY9e9QcKooQWzam/n3VF6IpZYyP2mwOyMxvucUNSWe6uqo30u8= X-Received: by 2002:a05:6402:27d2:b0:458:ca1a:2f75 with SMTP id c18-20020a05640227d200b00458ca1a2f75mr7782195ede.18.1664795175590; Mon, 03 Oct 2022 04:06:15 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?Christoph_M=C3=BCllner?= Date: Mon, 3 Oct 2022 13:06:02 +0200 Message-ID: Subject: Re: [PATCH v2 5/6] RISC-V: Fix T-Head immediate types on printing To: Tsukasa OI Cc: Nelson Chu , Kito Cheng , Palmer Dabbelt , binutils@sourceware.org Content-Type: multipart/alternative; boundary="00000000000010b69705ea1f5537" X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,HTML_MESSAGE,JMQ_SPF_NEUTRAL,RCVD_IN_DNSWL_NONE,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: --00000000000010b69705ea1f5537 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 26, 2022 at 2:30 PM Tsukasa OI via Binutils < binutils@sourceware.org> wrote: > This commit fixes three minor typing-related issues for > T-Head immediate values. > > 1. The format string %i is renamed to %d (which is more common). > 2. Signed type must be specified when printing with %d. > 3. unsigned/signed int it not portable enough for max 32-bit immediates. > Instead, we should use unsigned/signed long. > The format string is changed accordingly. > Tested-by: Christoph M=C3=BCllner > > 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 1c75317fad1..df2a6f4e131 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, "%ld", > + (signed long)EXTRACT_S_IMM (n, s, l)); > break; > default: > goto undefined_modifier; > -- > 2.34.1 > > --00000000000010b69705ea1f5537--