ferros icon indicating copy to clipboard operation
ferros copied to clipboard

calling convention tests

Open pittma opened this issue 5 years ago • 1 comments

We learned in debugging for #28, that without extern "C", Rust does not abide the aarch32 calling convention but instead, puts the parameters on the stack and a pointer to them in r0. With that in mind, consider one of the subtleties of aarch64's calling convention: If a "composite type" is greater or equal to 16 bytes (2 words) in size, then it shall go into the stack and a pointer to it into x0, otherwise, it can go into x0 and x1. Without extern "C", does Rust follow these rules? Or does it always do the pointer-into-the-stack method?

pittma avatar Jul 09 '19 21:07 pittma

Without extern "C", does Rust follow these rules? Or does it always do the pointer-into-the-stack method?

Whatever it happens to do, it's intentionally undefined, so we can't rely on it.

mullr avatar Aug 15 '19 00:08 mullr