Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Q: MMD and non PMC value (was: keyed vtables and mmd)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 26 - 33 of 33 - Collapse all  -  Translate all to Translated (View all originals) < Older 
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Leopold Toetsch  
View profile  
 More options May 1 2004, 2:49 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Sat, 1 May 2004 08:49:23 +0200
Local: Sat, May 1 2004 2:49 am
Subject: Q: MMD and non PMC value (was: keyed vtables and mmd)

Dan Sugalski <d...@sidhe.org> wrote:
> ... And... we
> move *all* the operator functions out of the vtable and into the MMD
> system. All of it.

This *all* includes vtable functions like add_int() or add_float() too,
I presume. For these we have left argument dispatch only. But what is
the right argument? A PerlInt, TclInt, PyInt (or ..Float)? Or is it
assumed to be the same as the left argument type?

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "MMD syntax in PMCs (was: keyed vtables and mmd)" by Leopold Toetsch
Leopold Toetsch  
View profile  
 More options May 1 2004, 9:03 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Sat, 1 May 2004 15:03:58 +0200
Local: Sat, May 1 2004 9:03 am
Subject: MMD syntax in PMCs (was: keyed vtables and mmd)

Dan Sugalski <d...@sidhe.org> wrote:
> ... We rework the current pmc
> processor to take the entries that are getting tossed and
> automatically add them to the MMD tables on PMC load instead.

I've now implemented MMD for PerlInt's bitwise_xor as a test case. Syntax
looks like this:

    void bitwise_xor (PMC* value, PMC* dest) {
MMD_PerlInt: {
        VTABLE_set_integer_native(INTERP, dest,
            PMC_int_val(SELF) ^ PMC_int_val(value));
             }
MMD_DEFAULT: {
        VTABLE_set_integer_native(INTERP, dest,
            PMC_int_val(SELF) ^
            VTABLE_get_integer(INTERP, value));
             }
    }

This creates two functions:

    Parrot_PerlInt_bitwise_xor()
    Parrot_PerlInt_bitwise_xor_PerlInt()

with the body parts from above and these initializer code snippet:

        { MMD_BXOR, enum_class_PerlInt, 0,
                    (funcptr_t) Parrot_PerlInt_bitwise_xor },
        { MMD_BXOR, enum_class_PerlInt, enum_class_PerlInt,
                    (funcptr_t) Parrot_PerlInt_bitwise_xor_PerlInt }

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "MMD performance" by Leopold Toetsch
Leopold Toetsch  
View profile  
 More options May 1 2004, 12:36 pm
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Sat, 1 May 2004 18:36:59 +0200
Local: Sat, May 1 2004 12:36 pm
Subject: Re: MMD performance

Leopold Toetsch <l...@toetsch.at> wrote:

[ another MMD performance compare ]

Just an update. Last benchmark still called MMD via the vtable. Here is
now a compare of calling MMD from the run loop:

$ parrot -C mmd-bench.imc
vtbl add  PerlInt PerlInt 1.072931
vtbl add  PerlInt Integer 1.085116
MMD  bxor PerlInt PerlInt 0.849723
MMD  bxor PerlInt Integer 0.989387

$ parrot -j mmd-bench.imc
vtbl add  PerlInt PerlInt 0.685505
vtbl add  PerlInt Integer 0.692237
MMD  bxor PerlInt PerlInt 0.628078
MMD  bxor PerlInt Integer 0.790955

JITed vtable add calls directly into the vtable, while the MMD <bxor> is
still a function that calls mmd_dispatch.

Compiled with -O3, 5 Meg operations on Athlon 800.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Q: MMD and non PMC value" by Leopold Toetsch
Leopold Toetsch  
View profile  
 More options May 7 2004, 6:54 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Fri, 7 May 2004 12:54:47 +0200
Local: Fri, May 7 2004 6:54 am
Subject: [RESENT] Q: MMD and non PMC value

Leopold Toetsch <l...@toetsch.at> wrote:
> Dan Sugalski <d...@sidhe.org> wrote:
>> ... And... we
>> move *all* the operator functions out of the vtable and into the MMD
>> system. All of it.
> This *all* includes vtable functions like add_int() or add_float() too,
> I presume. For these we have left argument dispatch only. But what is
> the right argument? A PerlInt, TclInt, PyInt (or ..Float)? Or is it
> assumed to be the same as the left argument type?

leo

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Sugalski  
View profile  
 More options May 7 2004, 12:36 pm
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Fri, 7 May 2004 12:36:08 -0400
Local: Fri, May 7 2004 12:36 pm
Subject: Re: [RESENT] Q: MMD and non PMC value
At 12:54 PM +0200 5/7/04, Leopold Toetsch wrote:

>Leopold Toetsch <l...@toetsch.at> wrote:
>>  Dan Sugalski <d...@sidhe.org> wrote:

>>>  ... And... we
>>>  move *all* the operator functions out of the vtable and into the MMD
>>>  system. All of it.

>>  This *all* includes vtable functions like add_int() or add_float() too,
>>  I presume. For these we have left argument dispatch only. But what is
>>  the right argument? A PerlInt, TclInt, PyInt (or ..Float)? Or is it
>  > assumed to be the same as the left argument type?

The three options are promotion to PMC, leaving these in the vtable,
or having a mmd-variant for them.

I'm up for the mmd-variant version. We just have a one-dimensional
table for PMC/int, PMC/float, and PMC/string functions and have the
ops directly dispatch to it. Seems simpler than stuffing the
functions into the base MMD table too.
--
                                         Dan

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 8 2004, 6:43 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Sat, 8 May 2004 12:43:53 +0200
Local: Sat, May 8 2004 6:43 am
Subject: Re: [RESENT] Q: MMD and non PMC value

Dan Sugalski <d...@sidhe.org> wrote:
> I'm up for the mmd-variant version. We just have a one-dimensional
> table for PMC/int, PMC/float, and PMC/string functions and have the
> ops directly dispatch to it. Seems simpler than stuffing the
> functions into the base MMD table too.

We currently have left type only dispatch as a default for a
non-existent right type, this is in type slot 0.

What about this:
- assign fix class enums (we need that anyway for PBC consistency)
- assign class enums 1..3 to utility PMCs like Env that don't do MMD
- use these 3 type slots in the one and only MMD table for int, float,
  string

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Sugalski  
View profile  
 More options May 8 2004, 4:15 pm
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Sat, 8 May 2004 16:15:15 -0400
Local: Sat, May 8 2004 4:15 pm
Subject: Re: [RESENT] Q: MMD and non PMC value
At 12:43 PM +0200 5/8/04, Leopold Toetsch wrote:

>Dan Sugalski <d...@sidhe.org> wrote:

>>  I'm up for the mmd-variant version. We just have a one-dimensional
>>  table for PMC/int, PMC/float, and PMC/string functions and have the
>>  ops directly dispatch to it. Seems simpler than stuffing the
>>  functions into the base MMD table too.

>We currently have left type only dispatch as a default for a
>non-existent right type, this is in type slot 0.

>What about this:
>- assign fix class enums (we need that anyway for PBC consistency)
>- assign class enums 1..3 to utility PMCs like Env that don't do MMD
>- use these 3 type slots in the one and only MMD table for int, float,
>   string

I'm mildly hesitant to have three special columns in the table (and
I'm not 100% sure someone won't do something really bizarre with Env)
but this seems OK. The one downside to it is that it potentially
anchors the rows a bit more than we might otherwise want--it's
possible to save a lot of space if each row in the MMD table has a
starting number and length prepended, so that the row for type 87
would be 5 words long if it only had entries for types 66, 67, and
68. (That paper I posted a link to a while back describes some of
this stuff)

OTOH that's all implementation detail, so lets go ahead and do it.
--
                                         Dan

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Leopold Toetsch  
View profile  
 More options May 10 2004, 3:14 am
Newsgroups: perl.perl6.internals
From: l...@toetsch.at (Leopold Toetsch)
Date: Mon, 10 May 2004 09:14:04 +0200
Local: Mon, May 10 2004 3:14 am
Subject: Re: [RESENT] Q: MMD and non PMC value

Leopold Toetsch <l...@toetsch.at> wrote:

[rubbish:]

> - assign class enums 1..3 to utility PMCs like Env that don't do MMD
> - use these 3 type slots in the one and only MMD table for int, float,
>   string

We have to extend the function range of the table. Using
type slots for functions is just nonsense.

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages < Older 
« Back to Discussions « Newer topic     Older topic »