From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id E7BC3385801B for ; Thu, 14 Jul 2022 11:18:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7BC3385801B Received: by mail-pj1-x1029.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so8300219pjl.5 for ; Thu, 14 Jul 2022 04:18:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PvDZmxLlDG8SwLSPdbuZPvjcJrYWoJgM7Svkwtbn9NY=; b=uxAS45t4edaEtjOkO7kXPt9qoC4eEgu+kG97K9d+1h687JKn1xv1KU/cNhgnDPKQKX duRnwE1YMELXGkCmwgfbDlYMfpHqEQV/2NhnKItDd/ms+/ipQHRn0bDyziLOWW1wtv94 Udy+6ycztQA7uwA9J1Dg3wWzXQQ1lAIxFibkIQWvixaq2DCT5vhcpPf5HlkCfOU0KtNN gZFFwcfjerxoH6QmSEG3m/D+0bK+bKVmTynxRFUjxOx3Wec0QO1v44poUQ1MWrDZNZdP OqRfIveoBXcqc7SLusC2c84Trb9rm8KC8L39IspcMhYO53CkWzbWC2vbZbkJWct2GBYd FjSw== X-Gm-Message-State: AJIora/hOXXAhwJNj4yELCvbVKjVRb7oHxHQjiuSzXdixbHAvOqlyvfZ 6WJwLUwt8abKqz02/uy/mGsSD5JYaAI= X-Google-Smtp-Source: AGRyM1sgkXk3ApDswPtYoi7Ln2yd0tx+okyzRQmVKsaw5o+m/LOAlVHYkPgjclA6GOf9OnrOX7Kq1g== X-Received: by 2002:a17:902:f551:b0:16c:505c:ebf8 with SMTP id h17-20020a170902f55100b0016c505cebf8mr7907085plf.70.1657797522976; Thu, 14 Jul 2022 04:18:42 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:3d89:8c2d:9f36:23af]) by smtp.gmail.com with ESMTPSA id y199-20020a6264d0000000b0051bba89c2bcsm1401554pfb.58.2022.07.14.04.18.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 04:18:42 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id D158211408D3; Thu, 14 Jul 2022 20:48:39 +0930 (ACST) Date: Thu, 14 Jul 2022 20:48:39 +0930 From: Alan Modra To: Jan Beulich Cc: Andrew Burgess , binutils@sourceware.org Subject: Re: [PATCH] libopcodes/ppc: add support for disassembler styling Message-ID: References: <20220712133609.3348690-1-aburgess@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3028.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jul 2022 11:18:45 -0000 On Thu, Jul 14, 2022 at 08:08:07AM +0200, Jan Beulich wrote: > On 14.07.2022 04:09, Alan Modra via Binutils wrote: > > On Tue, Jul 12, 2022 at 02:36:09PM +0100, Andrew Burgess via Binutils wrote: > >> I think the only slightly weird case was how things like '4*cr1+eq' > >> are styled. As best I can tell, this construct, used for example in > >> this instruction: > >> > >> crand 4*cr1+lt,4*cr1+gt,4*cr1+eq > >> > >> is used to access a field of a control register (NOTE: I know very > >> little about the PPC ISA, so please correct me if I'm wrong). As > >> such, I have styled the entire construct as a register. In some cases > >> constructs similar to the above can be simplified to just 'eq', as > >> this is still referencing a register field, this is still styled as a > >> register. > > > > This field is also present in conditional branches, and looking at > > those is perhaps is the best way to understand what ought to be done > > here. > > > > eg. this instruction > > lab: beq 7,lab > > disassembles with "objdump -d" to > > beq cr7,0 > > and with "objdump -d -Mraw" to see the underlying hardware insn > > bc 12,4*cr7+eq,0 > > > > So the field probably ought to disassemble the "4*" and "+" as text, > > the "eq" the same as the opcode mnemonic, > > Or maybe that new type which was introduced for Arm64? Yes, dis_style_sub_mnemonic works too. > > and the "cr7" as a > > register. At least, that seems a reasonable way to highlight the > > "interesting bits" to me. -- Alan Modra Australia Development Lab, IBM