Comment 44 for bug 313202

Revision history for this message
Rongcui Dong (rongcuid) wrote :

I have added preliminary pass-by-value struct for ARM64. Currently I've only tested passing struct as the first argument. There also seems to be some inefficient stack allocation, and the code can use a lot of refactoring.

This patch adds:

* Passing a struct aligned to 8-bytes by value as first argument
** Works for small structs (copied to registers) and large structs (copied to stack, then pass pointer)
* Test cases for the above

Major changes:

* In `aliencomp.lisp`, `%alien-funcall`, I added one additional return value, `preprocess-tns`, which contain functions which are called _before_ any arguments are copied. This is necessary due to ARM64 calling convention's Stage B, where arguments may be copied to memory and replaced by a pointer.

This change will not affect existing backends, but it is still in a common code path. If there's a better option, let me know!