IT lexicon › Programming › vectorcall

vectorcall

Programming På svenska → Updated: 2026-11-05

Microsoft's calling convention from Visual Studio 2013 that passes SIMD values and small vector aggregates in vector registers instead of through memory.

The default Windows x64 convention treats an __m128 like any other struct: the caller spills it to memory and passes a pointer. For maths libraries calling tiny vector functions millions of times, that was a pointless round trip. __vectorcall puts vector arguments straight into xmm0–xmm5 and returns them in registers.

The real novelty was homogeneous vector aggregates, or HVAs: a struct of up to four identical vectors, say a 4×4 matrix of __m128, travels in four registers rather than via the stack. The convention exists for both x86 and x64, and Clang supports it for compatibility. Linux never needed an equivalent, because the System V ABI passed vectors in registers from day one.

← Back to the lexicon