From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 409 invoked by alias); 28 Aug 2009 02:37:53 -0000 Received: (qmail 401 invoked by uid 22791); 28 Aug 2009 02:37:52 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_00,DNS_FROM_RFC_BOGUSMX X-Spam-Check-By: sourceware.org Received: from sebabeach.org (HELO sebabeach.org) (64.165.110.50) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Aug 2009 02:37:45 +0000 Received: from sspiff.sspiff.org (seba.sebabeach.org [10.8.159.10]) by sebabeach.org (Postfix) with ESMTP id 1203A6E3D0; Thu, 27 Aug 2009 19:37:44 -0700 (PDT) Message-ID: <4A9742F7.8090503@sebabeach.org> Date: Fri, 28 Aug 2009 02:37:00 -0000 From: Doug Evans User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: Dave Korn CC: cgen@sourceware.org Subject: Re: new do-count rtl References: <4A95669B.8050900@sebabeach.org> <4A96FC2B.8010605@sebabeach.org> <4A973D3A.3010703@gmail.com> In-Reply-To: <4A973D3A.3010703@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org X-SW-Source: 2009-q3/txt/msg00081.txt.bz2 Dave Korn wrote: > Doug Evans wrote: > >> Doug Evans wrote: >> >>> Hi. >>> >>> What do folks think of adding a new rtl for iterating a specified >>> number of times. >>> >>> Something like >>> >>> (do-count nr-times iter-var expr1 [expr2 ...]) >>> >>> For now the result would always be void, and iter-var would always >>> have mode INT. >>> The set of expressions is performed nr-times times and iter-var has >>> values 0 ... nr-times - 1. >>> >>> ? >>> >>> >> Checked in. >> > > I don't speak scheme or guile, but I'm learning, so forgive me in advance if > this is a dumb question: Does this differ from using a .map on an .iota when > generating a parameter to an rtl s-expr? > > cheers, > DaveK > > If one knows the number of iterations in advance, yes, they're essentially equivalent. do-count means less rtl, which can be useful, but that's it. [As it turns out I need to be able to make the number of iterations an expression, and not just a constant.]