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.129.124]) by sourceware.org (Postfix) with ESMTPS id 324603857374 for ; Thu, 21 Jul 2022 08:56:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 324603857374 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-547-0eyReG3oOS2JTx8aHlL-zA-1; Thu, 21 Jul 2022 04:56:51 -0400 X-MC-Unique: 0eyReG3oOS2JTx8aHlL-zA-1 Received: by mail-wr1-f69.google.com with SMTP id t12-20020adfa2cc000000b0021e564cde06so141963wra.17 for ; Thu, 21 Jul 2022 01:56:51 -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=TySr9JkGWwxGRFFHC3QPXhmnBn4lyfoT5r+AzKii1YzEWbXcM6Fox0AwwaFDzawvRM ruS+bJc48eTH8lCLWZaAJTizfnsShxuCTA5hCtqj9hig8XnDZ/mX+llQ5PDj/ETuO3MR mHmoO1mO3nO1A08+ODEyeo/M7iLHW2TI9NMD5nuvSpYn6Xjp+SuNwqTpkU5HVW5tynTO tAxRgxkdR1vsrm44hHY+upGfDdy/tAsuWIHgLBiTdTx265aH3ZpET04Iy6PAbjXUBNVS A4+sHkKrOY+EX2bu52vGBhvOIzv9xaC7lF6USfXE32QC3QH5mN/X5H+IinhxxXG9ovzp 5X+w== X-Gm-Message-State: AJIora9oJAfPJPHGsao6R0g3w4CjdskbUO+VlbAjZa8T9T9awkZejGQD EuiLZM+XzXEksL6wGsMblItH+Ybzc2gepRN3Ub3jnAO21ajJAb4+3EH/H5LCsLKuVIDKxgd8XYn FJ0lo6wgWwS2NwIQibOhB8OzfIilSdXPO1sQ0TAXR66jgBYnymssXcI13lD4eiJsuq9uHeg== X-Received: by 2002:a05:600c:3b29:b0:3a3:1fa6:768 with SMTP id m41-20020a05600c3b2900b003a31fa60768mr7384905wms.193.1658393809887; Thu, 21 Jul 2022 01:56:49 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s/8urxLVB1T3str2iomhplrmJag4ZuwZEwZrsLSbdE5a7Paf2V0EiEWfuFr31VzfWz9Ob6zg== X-Received: by 2002:a05:600c:3b29:b0:3a3:1fa6:768 with SMTP id m41-20020a05600c3b2900b003a31fa60768mr7384868wms.193.1658393809330; Thu, 21 Jul 2022 01:56:49 -0700 (PDT) Received: from localhost (15.72.115.87.dyn.plus.net. [87.115.72.15]) by smtp.gmail.com with ESMTPSA id z11-20020a05600c0a0b00b003a17ab4e7c8sm6113273wmp.39.2022.07.21.01.56.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jul 2022 01:56:48 -0700 (PDT) From: Andrew Burgess To: binutils@sourceware.org Cc: Richard Earnshaw , Andrew Burgess Subject: [PATCHv5 1/2] opcodes: add new sub-mnemonic disassembler style Date: Thu, 21 Jul 2022 09:56:42 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: 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.8 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_LOW, 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: Thu, 21 Jul 2022 08:56:56 -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