[fpc-devel] SIMD support / SSE

Jonas Maebe jonas.maebe at elis.ugent.be
Sun Mar 14 23:12:56 CET 2010

On 14 Mar 2010, at 16:13, Ivo Steinmann wrote:

> type
>  TVector = packed record
>    x, y, z, w: single;
>  end;
> 1. parameters are passed by reference, instead of xmm0 and xmm1 registers

Note that there are two separate issues here:
a) on non-win64 platforms, the x86-64 ABI is currently not implemented correctly in the compiler for small records with floating point fields (I'm working on fixing that, but it's hard to deal with function results in an efficient way under all circumstances): they should be passed and returned via sse registers but are current passed/returned via integer registers
b) the x86-64 ABI defines different ways for how a record as the above and an "_m128" (= 128 bit vector) have to be passed (the record above has to be passed in two sse registers, and an _m128 has to be passed in one sse register). So the compiler needs a special internal representation for vectors and records (and arrays, because arrays are always passed by reference in the x86-64 ABI)


More information about the fpc-devel mailing list