Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSVC cannot send function parameters of 16byte alignment on x86

I'm using MSVC to use some SSE intrinsics. In order to support this I aligned some of my data at a 16byte boundary. However, now that I compile for x86 instead of x64, MSVC insists that it is illegal for me to align a function parameter to 16bytes. But if that's true then how can anyone ever send SSE data types as function parameters?

So how can I send 16byte aligned parameters in a function?

like image 859
Puppy Avatar asked Oct 08 '22 21:10

Puppy


1 Answers

if that's true then how can anyone ever send SSE data types as function parameters?

You can't. :) Under Microsoft's ABI, you have to pass it by reference or pointer.

One workaround may be to use the fastcall calling convention which, apparently, passes the first few SSE arguments in XMM registers.

like image 163
jalf Avatar answered Oct 12 '22 10:10

jalf