[Vm-dev] VM endianness

Guillermo Polito guillermopolito at gmail.com
Fri Apr 3 08:40:58 UTC 2015


So, following with this discussion ^^

This is the latest version we are using.

f := Float new: 2.
f at: 2 put: 1. "store the least significant word of the float with 1; on
big endian machines this is the second word"
Bitmap adoptInstance: f.
^ f first = 1 ifTrue: [#little] ifFalse: [#big]

works, because both Float and Bitmap are compact. I just state it because
to use another variable word class we should make it compact too.

Thanks,
Guille

El vie., 20 de mar. de 2015 a la(s) 11:11 a. m., Esteban Lorenzano <
estebanlm at gmail.com> escribió:

>
>
> > On 20 Mar 2015, at 09:42, Eliot Miranda <eliot.miranda at gmail.com> wrote:
> >
> >
> >
> >
> > On Mar 19, 2015, at 8:17 AM, Bert Freudenberg <bert at freudenbergs.de>
> wrote:
> >
> >>
> >>> On 18.03.2015, at 20:49, Stefan Marr <smalltalk at stefan-marr.de> wrote:
> >>>
> >>>
> >>> Hi:
> >>>
> >>>> On 18 Mar 2015, at 20:17, tim Rowledge <tim at rowledge.org> wrote:
> >>>>
> >>>> On 18-03-2015, at 12:10 PM, Eliot Miranda <eliot.miranda at gmail.com>
> wrote:
> >>>>>
> >>>>> At least it doesn't use BitBlt.  Its got much less dependencies than
> the existing code and is much simpler.  Isn't that worth something?
> >>>>
> >>>> No need to use Bitmap if that’s a real problem - make a trivial class
> that is ArrayedCollection variableWordSubclass:#EndianTestThing and use
> that.
> >>>
> >>> Shouldn’t the VM should abstract from such things? Why is there a need
> for this knowledge on the application side?
> >>>
> >>> I guess, it is needed for low-level hacking at the language level?
> >>
> >> +1
> >>
> >> This is only needed if you work around the VM, like when you use FFI.
> So IMHO the FFI plugin should support that primitive. Or maybe it does?
> Doesn't it provide special bytearray accessors?
> >
> > Yes.  Given FFI primitives its easy to construct a test out of
> longAt:put: and byteAt:.  I didn't state it earlier cuz the prims aren't in
> the base VM.
>
> in the pharo vm, they are.
>
> Esteban
>
> >
> >>
> >> - Bert -
> >>
> >>
> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20150403/1b70329a/attachment.htm


More information about the Vm-dev mailing list