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

IMC returning ints

5 views
Skip to first unread message

Steve Fink

unread,
Jan 19, 2004, 8:58:43 PM1/19/04
to perl6-i...@perl.org
I did a cvs update, and it looks like imcc doesn't properly return
integers anymore from nonprototyped routines. Or maybe it never did,
and the switchover from nonprototype being the default to prototyped
is what triggered it (because I had to add some explicit
non_prototyped declarations, although I suspect they are incorrect.)

Test patch is attached, test case is:

.pcc_sub _main
$P0 = newsub _L_closure2
$I0 = 17
.pcc_begin non_prototyped
.arg $I0
.pcc_call $P0
L_after_call7:
.result $I1
.pcc_end
after_call:
print "returned "
print $I1
print "\n"
end
.end

.pcc_sub _L_closure2 non_prototyped
.param int value
.pcc_begin_return
.return value
.pcc_end_return
.end

intreturn.patch

Leopold Toetsch

unread,
Jan 22, 2004, 4:28:32 AM1/22/04
to Steve Fink, perl6-i...@perl.org
Steve Fink <st...@fink.com> wrote:

> I did a cvs update, and it looks like imcc doesn't properly return
> integers anymore from nonprototyped routines.

I don't even know if this is allowed. But anyway, if the call is non
prototyped, native types should go into P3. So you have the overhead of
PMC creation anyway plus the overhead of the array access.

And mainly the return convention are still broken.

leo

Dan Sugalski

unread,
Jan 22, 2004, 1:29:07 PM1/22/04
to l...@toetsch.at, Steve Fink, perl6-i...@perl.org

I thought those were fixed. There's no difference between calling and
return conventions -- a return is just a call to the return
continuation with parameters, the same way that a call is, well, a
call to the (uninstantiated) sub continuation with parameters.

I'll go thump pdd03.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
d...@sidhe.org have teddy bears and even
teddy bears get drunk

Leopold Toetsch

unread,
Jan 22, 2004, 4:33:56 PM1/22/04
to Dan Sugalski, perl6-i...@perl.org
Dan Sugalski <d...@sidhe.org> wrote:
> At 10:28 AM +0100 1/22/04, Leopold Toetsch wrote:

>>And mainly the return convention are still broken.

> I thought those were fixed.

Not yet.

> ... There's no difference between calling and
> return conventions

To be done.

leo

Dan Sugalski

unread,
Jan 23, 2004, 9:29:11 AM1/23/04
to l...@toetsch.at, perl6-i...@perl.org
At 10:33 PM +0100 1/22/04, Leopold Toetsch wrote:
>Dan Sugalski <d...@sidhe.org> wrote:
>> At 10:28 AM +0100 1/22/04, Leopold Toetsch wrote:
>
>>>And mainly the return convention are still broken.
>
>> I thought those were fixed.
>
>Not yet.

I looked--PDD 03 is fixed, and has been for quite a while.

> > ... There's no difference between calling and
>> return conventions
>
>To be done.

That needs to get dealt with soon, then, though I see from recent
behaviour changes that IMCC is getting closer to implementing the
calling conventions.

0 new messages