From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id D4AFD3858D1E for ; Tue, 31 Jan 2023 01:51:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D4AFD3858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-15f97c478a8so17577574fac.13 for ; Mon, 30 Jan 2023 17:51:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=xG6so0svaCWzbgEdLIYpkCmC0I8HZQ13DFvncYLbJkA=; b=xeA+QK2E72PHo+18/0Y5TLxNMpTVouLtY+vtn9HFR3sVBZnD2q4UD23OzoCWWpn5CU ZETOcQWCiPgcB35xqZerA4E8ondAuM75+TdWewssOohVYb4IxOmmGW/4s7SH2EPv6dsm jCiXskBimGDmpKzt22LCUYJH1xvsZQucKQmtI47v9wMt1uv2qYx5xPvRPfhb3Pr/zj+2 VnwliduWVbX2oyv4kPtbZg30Yvx2AbJRxcUzY5I1Z7zNxacjgxafI2AlJzcvYuUz/pzm /UZNesEl4iqR0WXPAMAGOZ2jQaD7v9UbSC2k5bNY5dKjfUhnOIage4dKFGZxhx2MEkgs AYkw== 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:message-id :reply-to; bh=xG6so0svaCWzbgEdLIYpkCmC0I8HZQ13DFvncYLbJkA=; b=YD+2AAUR7T6zgv1rhi828R89JRFRg5wLVYcMTHI95hSVE7VWK/ZrBOymh5xy6xcsTV ECSC5qqtOW+I3/38cBa6rwYiup1b1LXdc1M3+bpVVa2iGm6xxPkTh+wVLMh2HK/nHR9T HislwaVydRxrFxQJ5/V/4qeHMUywja1a51Dr/jNxFFK3L4SX37/xpKNc/lRTvL78VlA6 3SH2v+g4HnYHIDiV5GkWCsOaU1BueVwdqf0baoLBDie4vKF1NxezXr2JRO7evlvgTY8C rNsIHN4lw39S1OH7nziodtENaPcVGqwYBEX3qIomrUqKnK8nAqkWEO+DIRAOcjXk2Nmt ZsFA== X-Gm-Message-State: AO0yUKX391hcMY9lNpfJzBDm7LAsPJGnlq0MowZCQSP03EwxXto8Ipki eFi4BJQ05NEUqNJCEVb5GJaOac3A35LgHDOIZzckSgvLWPyNqA== X-Google-Smtp-Source: AK7set9h9zlYqch3oWZVf1Af6bWfPzDzYnir7mAprBdIMSlAoGpDgzViZQxZ14uOI+hkXBifd2lyvFGQWVzym0V0zaM= X-Received: by 2002:a05:6870:f593:b0:163:aadd:a457 with SMTP id eh19-20020a056870f59300b00163aadda457mr726000oab.201.1675129875251; Mon, 30 Jan 2023 17:51:15 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nelson Chu Date: Tue, 31 Jan 2023 09:51:04 +0800 Message-ID: Subject: Re: [PATCH] RISC-V: don't disassemble unrecognized insns as .byte To: "Maciej W. Rozycki" Cc: Jan Beulich , Binutils , Palmer Dabbelt , Andrew Waterman , Jim Wilson , Kito Cheng Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,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: On Mon, Jan 30, 2023 at 11:33 AM Maciej W. Rozycki wrote: > > Hi Nelson, > > > 0000000000000000 <.text>: > > 0: 0001 .short 0x0001 > > 2: 0001 .2byte 0x1 > > 4: 0001 .short 0x0001 > > ... > > > > The .byte in assembly will also be treated as data to dump, so > > ideally, dump these unrecognized instructions as .insn is probably > > more reasonable and won't be confused. > > I wasn't aware about the RISC-V `.insn' pseudo-op. I think it will make > a lot of sense to use it here then, so I'd be happier with either: > > 2: 0001 .insn 0x0001 > > or: > > 2: 0001 .insn 0x2, 0x1 > > and analogously for unrecognised instructions comprised of a higher number > of parcels according to the opcode allocation, e.g.: > > Disassembly of section .text: > 0000000000000000 .insn 0x00000000001f > > or: > > Disassembly of section .text: > 0000000000000000 .insn 0x6, 0x1f > > (here in the `--prefix-addresses' format). The single-argument format may > by clearer to the casual eye at the cost of extra leading zeros with some > encodings. Yeah, dump these unrecognized instructions into the .insn directives with the field looks better. Thanks for pointing this out :-) Nelson