From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 695 invoked by alias); 29 Oct 2002 23:10:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 670 invoked from network); 29 Oct 2002 23:10:42 -0000 Received: from unknown (HELO mail-out1.apple.com) (17.254.0.52) by sources.redhat.com with SMTP; 29 Oct 2002 23:10:42 -0000 Received: from mailgate1.apple.com (A17-128-100-225.apple.com [17.128.100.225]) by mail-out1.apple.com (8.11.3/8.11.3) with ESMTP id g9TNAgw17387 for ; Tue, 29 Oct 2002 15:10:42 -0800 (PST) Received: from scv3.apple.com (scv3.apple.com) by mailgate1.apple.com (Content Technologies SMTPRS 4.2.5) with ESMTP id ; Tue, 29 Oct 2002 15:10:27 -0800 Received: from apple.com (johada5.apple.com [17.201.20.185]) by scv3.apple.com (8.11.3/8.11.3) with ESMTP id g9TNAfK18204; Tue, 29 Oct 2002 15:10:41 -0800 (PST) Date: Tue, 29 Oct 2002 15:10:00 -0000 Subject: Re: Patch: fix SPEC regressions Content-Type: text/plain; charset=US-ASCII; format=flowed Mime-Version: 1.0 (Apple Message framework v546) Cc: Dale Johannesen , gcc-patches@gcc.gnu.org To: Richard Henderson From: Dale Johannesen In-Reply-To: <20021029183821.GB3036@redhat.com> Message-Id: <986ACCAA-EB93-11D6-B8DA-000393D76DAA@apple.com> Content-Transfer-Encoding: 7bit X-SW-Source: 2002-10/txt/msg01815.txt.bz2 On Tuesday, October 29, 2002, at 10:38 AM, Richard Henderson wrote: > On Tue, Oct 29, 2002 at 09:40:32AM -0800, Dale Johannesen wrote: >> Sure, I left it this way to make reading it easier. Not that's >> it's easy anyway. > > Err, but why? Why are we computing it this way? Ah, that's a different question. I deliberately didn't explain, in the hope that somebody would derive it independently, thus giving us more assurance we've finally gotten this right. However: We have a loop running from 'initial' to 'final' with increment 'abs_inc', and we're going to make 'unroll_number' copies of it. Typically the number of iterations of the original loop will not be exactly divisible by unroll_number, and in that case we'll need to add an extra iteration of the unrolled loop which is only partially executed. As I said already, preconditioning is expected to (and does) increment 'initial' appropriately if any preiterations were done, so we don't have to worry about that. Also, we assume that a runtime check for zero iterations was generated elsewhere if needed, so we don't have to do anything special for that. Note that 'final' is the expected value of the index after the loop; for the common C form of loop for(i=0; i= abs_inc or for 15..24 in the example. That is, the bottom abs_inc values of the t1 'final' values do not require a second iteration, the rest do. As you point out this simplifies to (abs(final-initial) + abs_inc*unroll_number - 1) / t1