[Vm-dev] [OpenSmalltalk/opensmalltalk-vm] passing struct by value does not respect x86_64 SysV ABI (#443)

Nicolas Cellier notifications at github.com
Sat Jan 25 08:04:05 UTC 2020


Follow up: for returning struct by value, we use a fake SixteenByteReturn struct {sqInt a; sqInt b;}
Unfortunately, this only works for fields returned via integer registers ($RAX ...) not via float registers ($XMM0 ...)

We would need 4 different return cases sqInt-sqInt sqInt-double double-sqInt  double-double

For passing struct by value, I just corrected a bug in VMMaker slang about floatType & doubleType check of struct members. But it ain't gonna work in all cases.
https://source.squeak.org/VMMaker/VMMaker.oscog-nice.2677.diff

I will also push more FFI tests for some tricky cases.

I have prototyped a method that enumerate the fields and re-compute the alignment, but it does not sound good, this job/information is already done at image side...

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/443#issuecomment-578386514
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20200125/22904a37/attachment.html>


More information about the Vm-dev mailing list