Assign primitive number 20 to primitiveRemLargeIntegers? (was: The Trunk: Kernel-nice.725.mcz)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Assign primitive number 20 to primitiveRemLargeIntegers? (was: The Trunk: Kernel-nice.725.mcz)

David T. Lewis
On Tue, Jan 01, 2013 at 03:47:54PM +0000, [hidden email] wrote:

> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-nice.725.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-nice.725
> Author: nice
> Time: 1 January 2013, 4:47:30.911 pm
> UUID: 52a4994f-63bc-4f71-9f8f-6f2fad460bde
> Ancestors: Kernel-nice.724
>
> Fast-up large integer modulo operations (\\ and rem:)
>
> Implementation notes:
> Quotient and remainder are computed in a single LargeIntegersPlugin primitive (see digitDiv:neg:) so it's faster to just use it.
> For LargeInteger with 64 bits or less, LargeInteger primitives (31 32 33) are faster than the plugin (especially in COG) so try them first.
> This results in a 2x speed up of modulo operations in 4.2.5 VM (whatever bit length), and a 2x speed up in COG VM for bit length > 64.
> There is a penalty of 15% in COG for #rem: when bit length <= 64 because there is no primitiveRem...
> Well, I added primitiveRem and it is in both VM branches, but it has no primitive number assigned.
> If we assign a primitive number (20 ?) we can expect a 5x speed up for rem and bitLength <= 64.

Should we assign primitive number 20 to primitiveRemLargeIntegers? It is in
the range of numbered primitives allocated for large integer prims, and is
currently unused in both the interpreter VM and Cog.

I can't think of any reason not to do this, so someone please speak up if
it might cause problems.

Eliot, is this ok for Cog and Newspeak etc?

Dave


Reply | Threaded
Open this post in threaded view
|

Re: Assign primitive number 20 to primitiveRemLargeIntegers? (was: The Trunk: Kernel-nice.725.mcz)

Eliot Miranda-2
Hi David,


On Tue, Jan 1, 2013 at 12:24 PM, David T. Lewis <[hidden email]> wrote:
On Tue, Jan 01, 2013 at 03:47:54PM +0000, [hidden email] wrote:
> Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> http://source.squeak.org/trunk/Kernel-nice.725.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-nice.725
> Author: nice
> Time: 1 January 2013, 4:47:30.911 pm
> UUID: 52a4994f-63bc-4f71-9f8f-6f2fad460bde
> Ancestors: Kernel-nice.724
>
> Fast-up large integer modulo operations (\\ and rem:)
>
> Implementation notes:
> Quotient and remainder are computed in a single LargeIntegersPlugin primitive (see digitDiv:neg:) so it's faster to just use it.
> For LargeInteger with 64 bits or less, LargeInteger primitives (31 32 33) are faster than the plugin (especially in COG) so try them first.
> This results in a 2x speed up of modulo operations in 4.2.5 VM (whatever bit length), and a 2x speed up in COG VM for bit length > 64.
> There is a penalty of 15% in COG for #rem: when bit length <= 64 because there is no primitiveRem...
> Well, I added primitiveRem and it is in both VM branches, but it has no primitive number assigned.
> If we assign a primitive number (20 ?) we can expect a 5x speed up for rem and bitLength <= 64.

Should we assign primitive number 20 to primitiveRemLargeIntegers? It is in
the range of numbered primitives allocated for large integer prims, and is
currently unused in both the interpreter VM and Cog.

I can't think of any reason not to do this, so someone please speak up if
it might cause problems.

Eliot, is this ok for Cog and Newspeak etc?

Fine by me.  20 isn't even used in Smalltalk-80 V2, and isn't by VisualWorks.  Seems ideal.
--
best,
Eliot


Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Assign primitive number 20 to primitiveRemLargeIntegers? (was: The Trunk: Kernel-nice.725.mcz)

David T. Lewis
In reply to this post by David T. Lewis
On Tue, Jan 01, 2013 at 03:24:35PM -0500, David T. Lewis wrote:

>  
> On Tue, Jan 01, 2013 at 03:47:54PM +0000, [hidden email] wrote:
> > Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> > http://source.squeak.org/trunk/Kernel-nice.725.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Kernel-nice.725
> > Author: nice
> > Time: 1 January 2013, 4:47:30.911 pm
> > UUID: 52a4994f-63bc-4f71-9f8f-6f2fad460bde
> > Ancestors: Kernel-nice.724
> >
> > Fast-up large integer modulo operations (\\ and rem:)
> >
> > Implementation notes:
> > Quotient and remainder are computed in a single LargeIntegersPlugin primitive (see digitDiv:neg:) so it's faster to just use it.
> > For LargeInteger with 64 bits or less, LargeInteger primitives (31 32 33) are faster than the plugin (especially in COG) so try them first.
> > This results in a 2x speed up of modulo operations in 4.2.5 VM (whatever bit length), and a 2x speed up in COG VM for bit length > 64.
> > There is a penalty of 15% in COG for #rem: when bit length <= 64 because there is no primitiveRem...
> > Well, I added primitiveRem and it is in both VM branches, but it has no primitive number assigned.
> > If we assign a primitive number (20 ?) we can expect a 5x speed up for rem and bitLength <= 64.
>
> Should we assign primitive number 20 to primitiveRemLargeIntegers? It is in
> the range of numbered primitives allocated for large integer prims, and is
> currently unused in both the interpreter VM and Cog.
>
> I can't think of any reason not to do this, so someone please speak up if
> it might cause problems.

I added primitiveRemLargeIntegers as primitive 20 in VMMaker, so this will
be available in future builds of the interpreter VM.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: [Vm-dev] Assign primitive number 20 to primitiveRemLargeIntegers? (was: The Trunk: Kernel-nice.725.mcz)

Eliot Miranda-2
ditto in the Cog branch.


On Sat, Jan 5, 2013 at 7:23 AM, David T. Lewis <[hidden email]> wrote:
On Tue, Jan 01, 2013 at 03:24:35PM -0500, David T. Lewis wrote:
>
> On Tue, Jan 01, 2013 at 03:47:54PM +0000, [hidden email] wrote:
> > Nicolas Cellier uploaded a new version of Kernel to project The Trunk:
> > http://source.squeak.org/trunk/Kernel-nice.725.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Kernel-nice.725
> > Author: nice
> > Time: 1 January 2013, 4:47:30.911 pm
> > UUID: 52a4994f-63bc-4f71-9f8f-6f2fad460bde
> > Ancestors: Kernel-nice.724
> >
> > Fast-up large integer modulo operations (\\ and rem:)
> >
> > Implementation notes:
> > Quotient and remainder are computed in a single LargeIntegersPlugin primitive (see digitDiv:neg:) so it's faster to just use it.
> > For LargeInteger with 64 bits or less, LargeInteger primitives (31 32 33) are faster than the plugin (especially in COG) so try them first.
> > This results in a 2x speed up of modulo operations in 4.2.5 VM (whatever bit length), and a 2x speed up in COG VM for bit length > 64.
> > There is a penalty of 15% in COG for #rem: when bit length <= 64 because there is no primitiveRem...
> > Well, I added primitiveRem and it is in both VM branches, but it has no primitive number assigned.
> > If we assign a primitive number (20 ?) we can expect a 5x speed up for rem and bitLength <= 64.
>
> Should we assign primitive number 20 to primitiveRemLargeIntegers? It is in
> the range of numbered primitives allocated for large integer prims, and is
> currently unused in both the interpreter VM and Cog.
>
> I can't think of any reason not to do this, so someone please speak up if
> it might cause problems.

I added primitiveRemLargeIntegers as primitive 20 in VMMaker, so this will
be available in future builds of the interpreter VM.

Dave





--
best,
Eliot