new do-count rtl

Doug Evans dje@sebabeach.org
Fri Aug 28 02:37:00 GMT 2009


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.]



More information about the Cgen mailing list