From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 127581 invoked by alias); 31 Aug 2019 12:04:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 127573 invoked by uid 89); 31 Aug 2019 12:04:00 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy= X-HELO: gate.crashing.org Received: from gate.crashing.org (HELO gate.crashing.org) (63.228.1.57) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 31 Aug 2019 12:03:58 +0000 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x7VC3uB9026453; Sat, 31 Aug 2019 07:03:56 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x7VC3t70026452; Sat, 31 Aug 2019 07:03:55 -0500 Date: Sat, 31 Aug 2019 14:13:00 -0000 From: Segher Boessenkool To: Alan Modra Cc: Michael Meissner , gcc-patches@gcc.gnu.org, dje.gcc@gmail.com Subject: Re: [PATCH, V3, #4 of 10], Add general prefixed/pcrel support Message-ID: <20190831120355.GT31406@gate.crashing.org> References: <20190826173320.GA7958@ibm-toto.the-meissners.org> <20190826204337.GD11790@ibm-toto.the-meissners.org> <20190830163511.GP31406@gate.crashing.org> <20190831010559.GE9227@bubble.grove.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190831010559.GE9227@bubble.grove.modra.org> User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg02130.txt.bz2 On Sat, Aug 31, 2019 at 10:36:00AM +0930, Alan Modra wrote: > On Fri, Aug 30, 2019 at 11:35:11AM -0500, Segher Boessenkool wrote: > > > - unsigned HOST_WIDE_INT val = INTVAL (XEXP (addr, 1)); > > > - return val + 0x8000 >= 0x10000 - (TARGET_POWERPC64 ? 8 : 12); > > > + HOST_WIDE_INT val = INTVAL (XEXP (addr, 1)); > > > + HOST_WIDE_INT extra = TARGET_POWERPC64 ? 8 : 12; > > > > The 8 vs. 12 could use a comment (yes, I know it was there already). Do you > > know what this is about, why it is 8 and 12? > > "extra" here covers the increase in offset needed to access the memory > using multiple registers. For example, when loading a TImode mem to > gprs you will load at offset+0 and offset+8 when powerpc64, and > offset+0, offset+4, offset+8, and offset+12 when powerpc32. Ah, so it is the size of the mode minus the size of the accesses done to get it... 16 - UNITS_PER_WORD may be a good way to express it? I don't see a way to say it that isn't still helped by a comment though. Thanks, Segher