From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92912 invoked by alias); 30 Oct 2018 12:49:26 -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 92893 invoked by uid 89); 30 Oct 2018 12:49:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:e22-v6s, Hx-spam-relays-external:209.85.210.196, H*RU:209.85.210.196, HX-HELO:sk:mail-pf X-HELO: mail-pf1-f196.google.com Received: from mail-pf1-f196.google.com (HELO mail-pf1-f196.google.com) (209.85.210.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 30 Oct 2018 12:49:24 +0000 Received: by mail-pf1-f196.google.com with SMTP id e22-v6so2758186pfn.8 for ; Tue, 30 Oct 2018 05:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=TMqpMM6n4EoRxHqIOq+AvWJVY6ubzHtv00HvatNkyZQ=; b=ScaeKxY//9+FPakcxeMSxMKYJDOpl92OjyBjgdz3EMoKOufOKQ8qB8lIowpEsZHbhX Fd8nZAtIbRunin0eUn1rFLqaCODM91Losc/Se4QgfOC06BA4EXbuiie8EYnp4qpLagZr KR04GSpdv0ONEUYJS+N1cno9L3+SCwfTuVt6KuQ92uhFhOSTxokTXgQp8PzwrWWqELs9 qJykfre4ONVxXfk6LMb4Uz2PSTxtjbTswBSWNP+lc59T9FqvSLTI6d0XzFeA4htdJjHf 82zAwTq1ZzYKrzSJEiu5fD6xW9CPOPX/Nm5J+Mqsf42Qk07z1gxX1ucXDUT5uSE0n+P+ hZDg== Return-Path: Received: from localhost (g148.61-193-223.ppp.wakwak.ne.jp. [61.193.223.148]) by smtp.gmail.com with ESMTPSA id u124-v6sm43531373pgc.0.2018.10.30.05.49.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 05:49:21 -0700 (PDT) Date: Tue, 30 Oct 2018 14:44:00 -0000 From: Stafford Horne To: Segher Boessenkool Cc: GCC patches , Openrisc , Richard Henderson , Jeff Law , Joseph Myers , Joel Sherrill , Sebastian Huber Subject: Re: [PATCH v3 3/3] or1k: gcc: initial support for openrisc Message-ID: <20181030124918.GC2843@lianli.shorne-pla.net> References: <20181027043702.18414-1-shorne@gmail.com> <20181027043702.18414-4-shorne@gmail.com> <20181028025730.GH5766@gate.crashing.org> <20181028214723.GD1761@lianli.shorne-pla.net> <20181028225447.GK5766@gate.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181028225447.GK5766@gate.crashing.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg01904.txt.bz2 Hello, On Sun, Oct 28, 2018 at 05:54:47PM -0500, Segher Boessenkool wrote: > Hi! > > On Mon, Oct 29, 2018 at 06:47:23AM +0900, Stafford Horne wrote: > > On Sat, Oct 27, 2018 at 09:57:30PM -0500, Segher Boessenkool wrote: > > > > +/* Helper for defining INITIAL_ELIMINATION_OFFSET. > > > > + We allow the following eliminiations: > > > > + FP -> HARD_FP or SP > > > > + AP -> HARD_FP or SP > > > > + > > > > + HFP and AP are the same which is handled below. */ > > > > + > > > > +HOST_WIDE_INT > > > > +or1k_initial_elimination_offset (int from, int to) > > > > > > You could calculate this as some_offset (from) - some_offset (to) with > > > some_offset a simple helper function. That gives you all possible > > > eliminations :-) > > > > > > (Each offset is very cheap to compute in your case, so that's not a problem). > > > > Right, Do you mean something like the following? I think it would work, but I > > am not sure it make the code easier to read. Do you think there would be much > > benefits supporting all possible eliminations? > > Yes, like that. It also easily can handle the other combos (those with > STACK_POINTER), and it is easier if you have to switch FRAME_GROWS_DOWNWARD > ("false" is better on some args, but "true" is required for ssp). > > Your code is fine as-is of course. Just to be clear, when you say 'as-is' did you mean the original v3 patch? Or are you referring to followup patch I posted with the some_offset (from) - some_offset (to) logic. -Stafford