From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 78EC5385840F for ; Mon, 18 Jul 2022 16:31:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 78EC5385840F Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-286-eESnIepUOTKrIx1verc7Ag-1; Mon, 18 Jul 2022 12:31:41 -0400 X-MC-Unique: eESnIepUOTKrIx1verc7Ag-1 Received: by mail-wm1-f71.google.com with SMTP id m10-20020a7bcb8a000000b003a2d979099cso4425689wmi.3 for ; Mon, 18 Jul 2022 09:31:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=stI1rZT/Q8P6P88JHwcKJ6ZNd48qFKsgUJxJZ0ZoO3Y=; b=LlcSXnolUGNXIvMtYnuaAwqwpC85jaRXSI6Nl1EtLHbPFSK5QfLDhufnzoKjLHAbuk ee4j3ntPHreF0AJjf8WtITXoWDanXAjq55D2FFhLfw6P77UF2A1mHg/DShplxl6hgMFE +PixPsPMSidABX9zMStZ1LCAfsemctMneVqs1WuGXQMCXUDTiCzVPetATxuTb/tLIlml E0ZlLRSGH0PGJISgFSjPAkb1ThsjnFt7XzmM0bnMgRiZujhFD0zAbyGEzV0XaOAM+fA9 qvYG/faUhItxTU/7mMUAYOS5DcrnYpHc0/CXYCIIkqLUSAVOkLcm4jAD0MqrBLSQtVNz jDxg== X-Gm-Message-State: AJIora9CQUw26bAo0IYe66Foj2c4ZMxWMZ7WiV9cBbw3ETcK7L99P0Ay oeW1F6HOES3FP5QrVHzaYn+7TiIQO2Cz0qv2DAQAYtichzkIBb3GLnBNisUZFWiT99sbs/66qP+ Q9DscUPQB50BmHzXth8FkW/bv2z1TI0tYcSO7WBMnZOi7QtdoUADcqHjP5AyPN1+w/wNQIg== X-Received: by 2002:adf:d22a:0:b0:21d:86b9:f150 with SMTP id k10-20020adfd22a000000b0021d86b9f150mr23338388wrh.388.1658161899711; Mon, 18 Jul 2022 09:31:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tIE9izt7nblIN+1uBS8pRV4RXmUjL9RUZYGBE7Xd76eJc+6tciKVU+E/FS3KKXF1/FxgOmfA== X-Received: by 2002:adf:d22a:0:b0:21d:86b9:f150 with SMTP id k10-20020adfd22a000000b0021d86b9f150mr23338372wrh.388.1658161899470; Mon, 18 Jul 2022 09:31:39 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id q18-20020adfdfd2000000b0021bbdc3375fsm11129984wrn.68.2022.07.18.09.31.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jul 2022 09:31:39 -0700 (PDT) From: Andrew Burgess To: binutils@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 1/2] opcodes: add new sub-mnemonic disassembler style Date: Mon, 18 Jul 2022 17:31:33 +0100 Message-Id: <5e70342a930400db9327baffb34961c8d81a6740.1658161688.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: References: <20220712133609.3348690-1-aburgess@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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 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: Mon, 18 Jul 2022 16:31:43 -0000 When adding libopcodes disassembler styling support for AArch64, it feels like the results would be improved by having a new sub-mnemonic style. This will be used in cases like: add w16, w7, w1, uxtb #2 ^^^^----- Here And: cinc w0, w1, ne ^^----- Here This commit just adds the new style, and prepares objdump to handle the style. A later commit will add AArch64 styling, and will actually make use of the style. As this style is currently unused, there should be no user visible changes after this commit. --- binutils/objdump.c | 2 ++ include/dis-asm.h | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/binutils/objdump.c b/binutils/objdump.c index 67824053527..4076587151c 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -2167,6 +2167,7 @@ objdump_color_for_disassembler_style (enum disassembler_style style) { case dis_style_symbol: color = 32; break; case dis_style_assembler_directive: + case dis_style_sub_mnemonic: case dis_style_mnemonic: color = 33; break; case dis_style_register: color = 34; break; case dis_style_address: @@ -2185,6 +2186,7 @@ objdump_color_for_disassembler_style (enum disassembler_style style) { case dis_style_symbol: color = 40; break; case dis_style_assembler_directive: + case dis_style_sub_mnemonic: case dis_style_mnemonic: color = 142; break; case dis_style_register: color = 27; break; case dis_style_address: diff --git a/include/dis-asm.h b/include/dis-asm.h index 4f91df12498..f1a83dc84e5 100644 --- a/include/dis-asm.h +++ b/include/dis-asm.h @@ -62,6 +62,13 @@ enum disassembler_style instructions. */ dis_style_mnemonic, + /* Some architectures include additional mnemonic like fields within the + instruction operands, e.g. on aarch64 'add w16, w7, w1, lsl #2' where + the 'lsl' is an additional piece of text that describes how the + instruction should behave. This sub-mnemonic style can be used for + these pieces of text. */ + dis_style_sub_mnemonic, + /* For things that aren't real machine instructions, but rather assembler directives, e.g. .byte, etc. */ dis_style_assembler_directive, -- 2.25.4