Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl #38627] [TODO] fill Parrot_register_move() with code

1 view
Skip to first unread message

Leopold Toetsch

unread,
Feb 24, 2006, 3:32:26 PM2/24/06
to bugs-bi...@rt.perl.org
# New Ticket Created by Leopold Toetsch
# Please include the string: [perl #38627]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=38627 >


Here is a simple job for a C programmer with some math/algorithmical
brain:

fill the function body of Parrot_register_move() (src/utils.c 633 ff).
The desired functionality is hopefully documented enough.

If there is some code, we can use this e.g. for tailcalls and inside
JIT.

.sub foo
.param int I0
.param int I1
foo@0: # label inserted with -Oc
...

.return foo(I1, I0) # problem with -Oc
.end

Recursive tailcall optimization will convert above code into a loop,
but it'll fail as registers will be clobbered during move:

set I0, I1
set I1, I0 # <--- problem
branch foo@0

Thanks,
leo

Leopold Toetsch

unread,
Feb 25, 2006, 8:06:02 AM2/25/06
to perl6-i...@perl.org, bugs-bi...@netlabs.develooper.com
Leopold Toetsch (via RT) wrote:

> fill the function body of Parrot_register_move() (src/utils.c 633 ff).

Parrot is now using this function [1] for recursive tailcalls. There are
2 new tests in t/compilers/imcc/imcpasm/optc.t.

Implementations can therefore be tested easily now.

[1] just a broken one to one move

Takers still welcome,
leo

Karl Forner

unread,
Feb 28, 2006, 7:26:28 PM2/28/06
to Leopold Toetsch, perl6-i...@perl.org


Probably a naive question : in which branch is Parrot using this function ?
Because I got the main one (svn co https://svn.perl.org/parrot/trunk parrot)
and this function does not seem to be called when running the
t/compilers/imcc/imcpasm/opt.t (using perl t/harness
t/compilers/imcc/imcpasm/opt.t) : I put some printf/fprintf(stderr) debugs
and can see nothing.

Moreover what I don't understand is that if the current implementation is
broken,
why are the tests successful ?

> Thanks
Karl

Leopold Toetsch

unread,
Mar 4, 2006, 11:51:20 AM3/4/06
to Karl Forner, perl6-i...@perl.org

On Mar 1, 2006, at 1:26, Karl Forner wrote:

>
>
> On 2/25/06, Leopold Toetsch <l...@toetsch.at> wrote:
>>
>> > fill the function body of Parrot_register_move() (src/utils.c 633
>> ff).
>>
>> Parrot is now using this function [1] for recursive tailcalls. There
>> are
>> 2 new tests in t/compilers/imcc/imcpasm/optc.t.

^^^^

>
> Probably a naive question : in which branch is Parrot using this
> function ?
> Because I got the main one (svn co https://svn.perl.org/parrot/trunk
> parrot)
> and this function does not seem to be called when running the
> t/compilers/imcc/imcpasm/opt.t (using perl t/harness
> t/compilers/imcc/imcpasm/opt.t) : I put some printf/fprintf(stderr)
> debugs and can see nothing.

The answer to both is above: opt*c*.t is testing 'parrot -Oc', which
enables recursive tailcall optimization. Running the test with
t/harness doesn't show the failing test, because it is a TODO test.
But:
$ perl -Ilib t/compilers/imcc/imcpasm/optc.t
shows the error.

> Thanks
> Karl

leo

0 new messages