From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender-0.a4lg.com [IPv6:2401:2500:203:30b:4000:6bfe:4757:0]) by sourceware.org (Postfix) with ESMTPS id 7D0093857BA6 for ; Thu, 6 Oct 2022 08:34:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D0093857BA6 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 65CC0300089; Thu, 6 Oct 2022 08:34:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1665045297; bh=acimRrd39eVXSZElGyQN6iizyPCfcBp/9jgMqMoh+u8=; h=Message-ID:Date:Mime-Version:Subject:To:References:Cc:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=Nece9yo4MZBZ9JRdmEoojQ9AjL/yK/I+D25jka9r18EoYdqQiWVXeYSmxT6Ek48Te 2scx7/Hy5TpTUOUQKUHFGRy+NFJKrkrdiOcS0dtr0pC/PpQ/DOFtWsEWLf73FbzWWr GATTH/PzZyZlPsL7EseDKmMIZM217yDkAwgO25xM= Message-ID: <65f01021-9da7-a895-3cfb-95b959e930c7@irq.a4lg.com> Date: Thu, 6 Oct 2022 17:34:55 +0900 Mime-Version: 1.0 Subject: Re: [PATCH v2 2/2] RISC-V: Improve "bits undefined" diagnostics Content-Language: en-US To: Jan Beulich References: Cc: Binutils From: Tsukasa OI In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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: On 2022/10/06 17:26, Jan Beulich wrote: > On 06.10.2022 06:40, Tsukasa OI via Binutils wrote: >> --- a/gas/config/tc-riscv.c >> +++ b/gas/config/tc-riscv.c >> @@ -1312,8 +1312,8 @@ validate_riscv_insn (const struct riscv_opcode *opc, int length) >> if (used_bits != required_bits) >> { >> as_bad (_("internal: bad RISC-V opcode " >> - "(bits 0x%lx undefined): %s %s"), >> - ~(unsigned long)(used_bits & required_bits), >> + "(bits 0x%llx undefined or invalid): %s %s"), >> + (unsigned long long)(used_bits ^ required_bits), > > May I encourage the use of the # format modifier in cases like this > one (i.e. %#llx here), for producing a one character shorter string > literal? Iirc a respective adjustment was done pretty recently to > some other parts of binutils. I would disagree if it was a part of the core disassembling portion but... seems okay here (as exact formatting is not important). It would have changed the behavior if (used_bits ^ required_bits) is not zero (e.g. with "%#x": "0" (0), "0x1" (1)...) but here, (used_bits ^ required_bits) cannot be zero. So, the behavior won't change either. Thanks, Tsukasa > > Jan >