From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 554 invoked by alias); 3 Jun 2014 08:22:33 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 543 invoked by uid 89); 3 Jun 2014 08:22:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f178.google.com Received: from mail-vc0-f178.google.com (HELO mail-vc0-f178.google.com) (209.85.220.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 03 Jun 2014 08:22:31 +0000 Received: by mail-vc0-f178.google.com with SMTP id hy4so2733068vcb.9 for ; Tue, 03 Jun 2014 01:22:29 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.52.164.70 with SMTP id yo6mr207035vdb.67.1401783749031; Tue, 03 Jun 2014 01:22:29 -0700 (PDT) Received: by 10.52.121.195 with HTTP; Tue, 3 Jun 2014 01:22:28 -0700 (PDT) In-Reply-To: <20140603050153.GB15355@redacted.bos.redhat.com> References: <20140603050011.GA15355@redacted.bos.redhat.com> <20140603050153.GB15355@redacted.bos.redhat.com> Date: Tue, 03 Jun 2014 08:22:00 -0000 Message-ID: Subject: Re: [PATCH 1/2] aarch64: extend decode_adrp to decode immediate offset From: Marcus Shawcroft To: Kyle McMartin Cc: "gdb-patches@sourceware.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00068.txt.bz2 Hi, On 3 June 2014 06:01, Kyle McMartin wrote: > @@ -264,16 +264,28 @@ decode_add_sub_imm (CORE_ADDR addr, uint32_t insn, unsigned *rd, unsigned *rn, > Return 1 if the opcodes matches and is decoded, otherwise 0. */ > > static int > -decode_adrp (CORE_ADDR addr, uint32_t insn, unsigned *rd) > +decode_adrp (CORE_ADDR addr, uint32_t insn, int *page, unsigned *rd, > + int64_t *imm) Given that this now decodes both adrp and adr the function name seems inappropriate, how about following the convention used in the other decode_ functions and changing to something like decode_adrp_adr ().. ? Returning both 'page' and 'imm' isn't necessary and I don't think it makes sense given that logically both adr and adrp are used to construct an address. Looking at this patch and the following patch I think you can achieve the same functionality by having the decodes of both adrp and adr return a value in 'imm'. In the case of an adrp decode just returning: imm = page << 12 .... Cheers /Marcus