public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
* new do-count rtl
@ 2009-08-26 16:45 Doug Evans
  2009-08-27 21:35 ` Doug Evans
  0 siblings, 1 reply; 5+ messages in thread
From: Doug Evans @ 2009-08-26 16:45 UTC (permalink / raw)
  To: cgen

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.

?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new do-count rtl
  2009-08-26 16:45 new do-count rtl Doug Evans
@ 2009-08-27 21:35 ` Doug Evans
  2009-08-28  1:59   ` Dave Korn
  2009-08-28  6:31   ` Doug Evans
  0 siblings, 2 replies; 5+ messages in thread
From: Doug Evans @ 2009-08-27 21:35 UTC (permalink / raw)
  To: cgen

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.

2009-08-27  Doug Evans  <dje@sebabeach.org>

        Add do-count rtl function.
        * rtl-c.scm (s-do-count): New function.
        (do-count): New rtl handler.
        * rtl-traverse.scm (-rtx-traverse-iteration): New function.
        (-rtx-make-traverser-table): Add ITERATION.
        * rtl.scm (rtx-env-make-iteration-locals): New function.
        * rtx-funcs.scm (do-count): New rtl function.
        * cpu/play.cpu: Add do-count-test insn.
        * doc/rtl.texi: Add docs on do-count.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new do-count rtl
  2009-08-27 21:35 ` Doug Evans
@ 2009-08-28  1:59   ` Dave Korn
  2009-08-28  2:37     ` Doug Evans
  2009-08-28  6:31   ` Doug Evans
  1 sibling, 1 reply; 5+ messages in thread
From: Dave Korn @ 2009-08-28  1:59 UTC (permalink / raw)
  To: Doug Evans; +Cc: cgen

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new do-count rtl
  2009-08-28  1:59   ` Dave Korn
@ 2009-08-28  2:37     ` Doug Evans
  0 siblings, 0 replies; 5+ messages in thread
From: Doug Evans @ 2009-08-28  2:37 UTC (permalink / raw)
  To: Dave Korn; +Cc: cgen

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: new do-count rtl
  2009-08-27 21:35 ` Doug Evans
  2009-08-28  1:59   ` Dave Korn
@ 2009-08-28  6:31   ` Doug Evans
  1 sibling, 0 replies; 5+ messages in thread
From: Doug Evans @ 2009-08-28  6:31 UTC (permalink / raw)
  To: cgen

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.
>
> 2009-08-27  Doug Evans  <dje@sebabeach.org>
>
>        Add do-count rtl function.
>        * rtl-c.scm (s-do-count): New function.
>        (do-count): New rtl handler.
>        * rtl-traverse.scm (-rtx-traverse-iteration): New function.
>        (-rtx-make-traverser-table): Add ITERATION.
>        * rtl.scm (rtx-env-make-iteration-locals): New function.
>        * rtx-funcs.scm (do-count): New rtl function.
>        * cpu/play.cpu: Add do-count-test insn.
>        * doc/rtl.texi: Add docs on do-count.
>

fyi,
I updated the patch to support an rtl expression for the number of 
iterations, and swapped the iteration-var and number-of-iterations 
parameters (felt more consistent with sequence/parallel).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-28  6:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-26 16:45 new do-count rtl Doug Evans
2009-08-27 21:35 ` Doug Evans
2009-08-28  1:59   ` Dave Korn
2009-08-28  2:37     ` Doug Evans
2009-08-28  6:31   ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).