[LLVMdev] Win64 Calling Convention problem

Anton Korobeynikov anton at korobeynikov.info
Thu Dec 3 10:57:38 PST 2009


> When compiling this module with llc (Intel assembler syntax) I get the
> following code. As you can see, the float4 argument is not passed to
> the noise-function by pointer. Instead, noise is treated as if it
> expected four individual floats as arguments, which are passed in the
> registers XMM0-XMM3.
That's correct behaviour. ABI under question is C/C++ ABI and it is a frontend
responsibility to lower stuff like struct-by-value into ABI-compliant IR.

So, in short - you need to pass pointer to the struct in your IR.

With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University

More information about the llvm-dev mailing list