RFC: SIMD vectors in FFI by gnzlbg · Pull Request #2574 · rust-lang/rfcs (original) (raw)
Are architecture-specific vector types always passed in the vector registers in C ABIs or is that an x86-ism?
How vector types are passed depends on the ABI used. One could define an x86 ABI that doesn't pass vectors in registers, and in fact, the "Rust ABI" is such an ABI since it currently passes vectors by memory on x86.
FWIW this RFC does not propose always using vector registers on C FFI. Instead, it proposes passing them to C using the ABI of the target, whatever that might be. For doing that correctly, we do need to know whether the type being passed to C is a vector type, its element type, and length, because in most widely used platform ABIs those things will determine which vector register to use.