[OpenSmalltalk/opensmalltalk-vm] ThreadedFFIPlugin ffiReturnStruct:ofType:in: can be refactored. (#517)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] ThreadedFFIPlugin ffiReturnStruct:ofType:in: can be refactored. (#517)

David T Lewis
 

Currently some implementations of ffiReturnStruct:ofType:in: have knowledge about whether structs are returned in registers or not (a nice recent improvement by Nicolas Cellier). However, it would be better if this information was pulled out into the caller. Then there would be a single ffiReturnStruct:ofType:in: that would be passed a painter. The pointer should be something like
self structResultPointerFor: calloutState and: ...

In fixing the ARMv8 ThreadedFFIPlugin for the case of Homogenous Float Arrays it was necessary to have two separate invocations of ffiReturnStruct:ofType:in:, one for the float return and one for a normal struct return which may be returned in integer registers or through memory. On ARMv8 a struct can be returned through memory, in integer registers or in floating-point registers. So putting the logic in ffiReturnStruct:ofType:in: isn't as good as putting the logic in the caller ffiCalloutTo:SpecOnStack:in:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/517", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/517", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>