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