[LLVMdev] Win64 Calling Convention problem
stephan.reiter at gmail.com
Thu Dec 3 12:33:41 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.
I don't know. I feel reluctant to generate different IRs for Win32 and
Since the C calling convention is the default for LLVM functions, I
thought that it would map to *the* Win64 calling convention (since
cdecl, fastcall and stdcall are all the same) when a 64-bit build was
used. This is quite confusing ...
More information about the llvm-dev