Re: [LLVMdev] Win64 calling convention

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [LLVMdev] Win64 calling convention

NAKAMURA Takumi
Good evening, Jay.


2011/1/12 Jay Cornwall <[hidden email]>:

>  Hi,
>
>  I've encountered a problem invoking LLVM-generated x86_64 code on
>  Windows from MSVC-compiled code. There seems to be disagreement between
>  the two compilers over the calling convention for passing a 12 or 16
>  byte structure by value. e.g.
>
>  struct aggregate { int a; int b; int c; int d; };
>  int test(aggregate byVal) { ... }
>
>  LLVM chooses to pass byVal with a and b packed into rcx and c and d
>  packed into rdx. MSVC (8 here) instead passes a reference to the
>  structure in rcx. My reading of the System V ABI spec is unclear,
>  although Microsoft already deviate in their choice of fastcall registers
>  so perhaps it is irrelevant.

I guess it might be a clang's issue.
ToT clang does not know Win64 calling conversion and it seems you saw
"amd64-like" cc.

>  Should I file a bug for this?

You may file one though I have patches for it.
I will post patches for clang soon.


...Takumi

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev