[LLVMdev] Win64 Calling Convention problem

Stephan Reiter stephan.reiter at gmail.com
Fri Dec 4 07:32:18 PST 2009


Ahoi Anton,

> We do support one "exception" though for win64 - __m128 vectors. This
> was done since they are
> native types and thus do not get changed by type legalizer. I have no
> idea why MS decided not to
> pass then in registers... This is silly...

Hmm, maybe I can explain this: The Microsoft docs state that for
unprototyped functions floating-point values need to be passed as
double precision in both the floating-point registers (XMMn) and the
integer registers (RCX, etc.). That obviously doesn't work for SSE
vectors because they don't fit into the integer registers. So, there's
only pass-by-reference of the first four vectors, which they might
have generalized to all functions (even with complete signatures) for
consistency. Still weird though ...

> Sounds like pretty sane approach :)
... which I just modified to *not* massage SSE vectors, as you
mentioned that LLVM would take care of this. :-)

Have a great weekend and thanks for your help,
Stephan



More information about the llvm-dev mailing list