<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Ken,</div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jan 6, 2019 at 1:57 PM Ken.Dickey <<a href="mailto:Ken.Dickey@whidbey.com">Ken.Dickey@whidbey.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">..<br>
> > v8 is a completely different instruction set and you can't (to the best of<br>
> > my knowledge!) swap between v7 & v8. <br>
..<br>
> > The stack VM does appear to work ok on v8 systems like chromebooks. We'll<br>
> > need to handle both v7 & v8 just as x86 & x64.<br>
<br>
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. <br>
<br>
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, ..<br>
<br>
> Currently the FFI tests don't test callbacks.  According to Ken's code for<br>
> the ThreadedFFIARM64Plugin the ARMv8 C ABI uses 8 integer register<br>
> parameters whereas ARMv7/6/5/4 uses 4.  So that changes the signature for<br>
> thunkEntry on ARMv8.  We won't see the effects of this unless we have a<br>
> callback test with more than 4 arguments.  We really need two tests that<br>
> call callbacks with no arguments, a few integer, float or double arguments,<br>
> large numbers of integer, float or double argument, and then calls with<br>
> alternating integer, float and double arguments.<br>
<br>
FYI, I am still in confusion w.r.t. getting VMMaker generated FFI code to do the proper thing on ARMv8/aarch64.  <br>
<br>
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.<br>
<br>
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.<br></blockquote><div><br></div><div>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?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Also FYI, I have been running<br>
 [VMMaker generateSqueakSpurStack64VM] valueSupplyingAnswer: false.<br>
  VMMaker generateVMPlugins.<br></blockquote><div><br></div><div>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:</div><div><br></div><div><div>"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."</div><div>VMMakerTool openInWorld</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">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.<br></blockquote><div><br></div><div>The generated <a href="http://plugins.int/plugins.ext">plugins.int/plugins.ext</a> are just noise.  Use hand-edited ones in the build directory.  Ignore the generated ones.  They're a historical accident.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">> Doug added a few tests when getting ThreadedFFIARMPlugin working.  This<br>
> source hasn't made it back into sqFFITestFuncs.c.  This code could really<br>
> do with some love.  Someone willing to add a few tests, including some<br>
> callback tests.  I'm happy to write tip a description of the FFI<br>
> architecture if someone will volunteer to write those tests :-)<br>
<br>
As with other things, I am not really the best person to do this, but will certainly need more tests for the aarch64 FFI. <br>
<br>
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.<br></blockquote><div><br></div><div>That should be fine.  Pi3 is no slouch.</div><div><br></div></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>