[squeak-dev] Re: [Vm-dev] New Cog VMs available...

David T. Lewis lewis at mail.msen.com
Thu Jul 3 01:48:07 UTC 2014


On Thu, Jul 03, 2014 at 02:40:20AM +0200, Nicolas Cellier wrote:
>  
> 2014-07-03 2:14 GMT+02:00 David T. Lewis <lewis at mail.msen.com>:
> 
> >
> > On Thu, Jul 03, 2014 at 12:39:31AM +0200, Nicolas Cellier wrote:
> > >
> > > 2014-07-03 0:18 GMT+02:00 Eliot Miranda <eliot.miranda at gmail.com>:
> > > >
> > > > On Wed, Jul 2, 2014 at 2:51 PM, Nicolas Cellier <
> > > > nicolas.cellier.aka.nice at gmail.com> wrote:
> > > >>
> > > >> 2014-07-02 23:32 GMT+02:00 Frank Shearar <frank.shearar at gmail.com>:
> > > >>
> > > >> On 2 July 2014 22:19, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> > > >>> >
> > > >>> > On Wed, Jul 2, 2014 at 1:45 PM, Frank Shearar <
> > frank.shearar at gmail.com wrote:
> > > >>> >>
> > > >>> >> On 1 July 2014 18:03, Eliot Miranda <eliot.miranda at gmail.com>
> > wrote:
> > > >>> >> >
> > > >>> >> > at http://www.mirandabanda.org/files/Cog/VM/VM.r3024/.
> > > >>> >>
> > > >>> >> CI updated accordingly! For Spur:
> > > >>> >> http://build.squeak.org/job/SqueakTrunkOnSpur/29/console
> > > >>> >
> > > >>> > and I'm working on the large integer failures right now.  that
> > should
> > > >>> fix
> > > >>> > most of the errors.
> > > >>>
> > > >>> Excellent! That will end the streak of red in the SqueakTrunk build
> > > >>> history.
> > > >>>
> > > >>> Thanks!
> > > >>>
> > > >> I've got a working solution ready for large int plugin.
> > > >> digitDiv and montgomery are broken due to the same bug // 256...
> > > >> I can publish if you want.
> > > >>
> > > >
> > > > Forgive me but I went ahead and fixed it.  I just figured out that I
> > could
> > > > have the code generator output asserts at every divide by a power of
> > two to
> > > > check that the results agreed with signed shifts and hence easily
> > caught
> > > > all the places where there was a bug.  I've also realised that I can
> > have
> > > > the code generator output #if #else #endif code for remapOop:in: and
> > so not
> > > > incur any overhead in Spur, which doesn't GC during primitives.
> > > >
> > > No matter, I'll publish later because it is a good cleanup...
> > > Most of the divides are unsigned and OK (like // 8 and \\ 8 for counting
> > > number of bytes/bits in a shift)
> > > Only 3 places were broken: sub, div, and montgomery mul.
> >
> > Nicolas,
> >
> > Please do publish it when you are able.
> >
> > Thanks,
> > Dave
> >
> >
> I'm stuck. It's while writing snapshot.bin.
> I should alter the snapshot...
> 
> My comment message would have been:
> 
> 'Fix horribly broken LargeIntegersPlugin (// 256 was used in place of
> signedBitShift:-8 at 3 places, sub, div and montgomery mul)
> Revise left and right bit shifts implementation (simplify)
> Use a bit more uniform naming: instead of the random zoo (cCore cBytes
> cDigit...) it will be digits (they happen to be bytes currently, but that
> may change).
> Use unsigned arithmetic everywhere we can because it is well defined by C
> standards (less undefined behavior or implementation defined behavior
> compared to signed arithmetic) and because that''s what we really need:
> indeed, large int are represented as sign-magnitude and we operate on
> magnitudes, not two complement.'
> 
> The changes are attached for COG, but the plugin should be essentially the
> same on classical VMMaker.

Thanks Nicolas,

I filed this in to my image and compiled 64-bit VMs for 32-bit and 64-bit images.
There were no problems or warnings in the compile. KernelTests-Numbers are green
for the 32-bit image, and there are no new failures for the 64-bit image (at
present, there are five failures).

I am not looking closely at the changes, but given that this addresses the
"// 256" problem, your update looks good to me.

Dave



More information about the Vm-dev mailing list