[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] CogVM source as per VMMaker.oscog-eem.2502 (f954a91)

Eliot Miranda eliot.miranda at gmail.com
Sun Jan 6 22:19:47 UTC 2019


Hi Ken,

On Sun, Jan 6, 2019 at 1:57 PM Ken.Dickey <Ken.Dickey at whidbey.com> wrote:

> ..
> > > v8 is a completely different instruction set and you can't (to the
> best of
> > > my knowledge!) swap between v7 & v8.
> ..
> > > The stack VM does appear to work ok on v8 systems like chromebooks.
> We'll
> > > need to handle both v7 & v8 just as x86 & x64.
>
> I am running 64bit Spur stack VM on aarch64 Chromebook Plus,
> AML-S905X/LePotato, and backtesting on RasPi3, none of which have 32bit
> libs installed.
>
> There are a fair number of differences between v7 and v8.  E.g. in v8 no
> thumb, can't access SP or PC directly, different register sets, ..
>
> > Currently the FFI tests don't test callbacks.  According to Ken's code
> for
> > the ThreadedFFIARM64Plugin the ARMv8 C ABI uses 8 integer register
> > parameters whereas ARMv7/6/5/4 uses 4.  So that changes the signature for
> > thunkEntry on ARMv8.  We won't see the effects of this unless we have a
> > callback test with more than 4 arguments.  We really need two tests that
> > call callbacks with no arguments, a few integer, float or double
> arguments,
> > large numbers of integer, float or double argument, and then calls with
> > alternating integer, float and double arguments.
>
> FYI, I am still in confusion w.r.t. getting VMMaker generated FFI code to
> do the proper thing on ARMv8/aarch64.
>
> Basically, I am in a cycle of writing some ST code in
> ThreadedARM64FFIPlugin, running FFI unit tests (typically in Cuis -- seem
> basically same as Squeak), and checking  outputs and stepping through with
> gdb.  A slow slog for me.
>
> At this point I feel I need to take a step back and get a better/fuller
> understanding of ThreadedFFICalloutState usage
> (ThreadedFFIPlugin>>ffiCallOutTo:SpecOnStack:in) marshaling and interaction
> with type/representation access via IA32ABIPlugin.
>

I have promised to write this up and will do so once I have some time.  But
I'm curious.  What reference documentation are you using for the v8 ABI?
Can you post a link please?


> Also FYI, I have been running
>  [VMMaker generateSqueakSpurStack64VM] valueSupplyingAnswer: false.
>   VMMaker generateVMPlugins.
>

For the FFI plugin is is quicker to open a VMMakerTool, set up its fields
correctly, drag the relevant plugin from the left-hand list to the
right-hand list and use "generate plugin" from the menu in the right-hand
list.  This is at the end of the Source Generation  Workspace:

"To generate plugins open a VMMakerTool, drag and drop the plugins you want
to build across to the External Plugins list, select each plugin and choose
'generate plugin' from the pop-up menu."
VMMakerTool openInWorld

In the several attempts I have made, I have been unable to determine the
> proper usage of VMMakerTool to get a working VM corresponding with the
> above.  The list of plugins available does not seem to match
> internal/external plugin lists; 64bit gets unchecked during builds, etc.  I
> have not spent much time with this and don't know if this is expected to
> work for ARM codegen.
>

The generated plugins.int/plugins.ext are just noise.  Use hand-edited ones
in the build directory.  Ignore the generated ones.  They're a historical
accident.

> Doug added a few tests when getting ThreadedFFIARMPlugin working.  This
> > source hasn't made it back into sqFFITestFuncs.c.  This code could really
> > do with some love.  Someone willing to add a few tests, including some
> > callback tests.  I'm happy to write tip a description of the FFI
> > architecture if someone will volunteer to write those tests :-)
>
> As with other things, I am not really the best person to do this, but will
> certainly need more tests for the aarch64 FFI.
>
> Note also, that I do not run Windows or MacOS [just Linux], so my test
> environment is limited.  I can run RasPi3 in 33bit mode (Raspian/Linix) but
> am basically running aarch64/Linux.
>

That should be fine.  Pi3 is no slouch.

_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20190106/f8839b43/attachment.html>


More information about the Vm-dev mailing list