Re: [fpc-devel] Problems with MM types (__m128 etc).

2022-04-08 Thread Jonas Maebe via fpc-devel
On 08/04/2022 20:31, J. Gareth Moreton via fpc-devel wrote: That might explain a few things.  The problem is that under vectorcall and the System V ABI (the default x86_64 calling convention for Linux), vector types are supposed to be fully supported, like an aligned array of 4 Singles should b

Re: [fpc-devel] Problems with MM types (__m128 etc).

2022-04-08 Thread J. Gareth Moreton via fpc-devel
On 08/04/2022 19:19, Jonas Maebe via fpc-devel wrote: On 08/04/2022 19:57, J. Gareth Moreton via fpc-devel wrote: It looks like support for writing to arrays that are wholly stored in registers is a little limited and buggy Modifying individual elements of arrays stored in registers has never

Re: [fpc-devel] Problems with MM types (__m128 etc).

2022-04-08 Thread Jonas Maebe via fpc-devel
On 08/04/2022 19:57, J. Gareth Moreton via fpc-devel wrote: It looks like support for writing to arrays that are wholly stored in registers is a little limited and buggy Modifying individual elements of arrays stored in registers has never been enabled nor supported in the compiler. That is wh

Re: [fpc-devel] Problems with MM types (__m128 etc).

2022-04-08 Thread J. Gareth Moreton via fpc-devel
Also I just raised an internal error on the trunk: program m128test; type   UnalignedArray = array[0..1] of Double; function Test3(V1, V2: UnalignedArray): UnalignedArray; vectorcall; begin   Test3[1] := V1[1] + V2[1]; end; begin end. Compiler fails with "m128.pp(7,1) Fatal: Internal error 20

Re: [fpc-devel] Problems with MM types (__m128 etc).

2022-04-08 Thread J. Gareth Moreton via fpc-devel
It looks like support for writing to arrays that are wholly stored in registers is a little limited and buggy - while it writes to temporary memory when modifying an individual element, the compiler sometimes doesn't write back the final result into the original register.  I'm seeing if I can f