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

2022-04-06 Thread J. Gareth Moreton via fpc-devel
That's fair.  Looks like I'm going to have to explore and experiment a lot more to see if I can 'unbreak' some things.  What was meant to be a simple alignment fix has kind of ballooned into much more. Gareth aka. Kit On 06/04/2022 22:00, Jonas Maebe via fpc-devel wrote: On 06/04/2022 22:58,

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

2022-04-06 Thread Jonas Maebe via fpc-devel
On 06/04/2022 22:58, J. Gareth Moreton via fpc-devel wrote: On 06/04/2022 21:16, Jonas Maebe via fpc-devel wrote: On 06/04/2022 19:20, J. Gareth Moreton via fpc-devel wrote: I recently made a merge request that initally just fixed the incorrect memory alignment for __m128 and similar types, bu

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

2022-04-06 Thread J. Gareth Moreton via fpc-devel
I used it because it was easy to hot-swap the constructor in the definition of __m128 and the like, and it was a quick and convenient way to ensure the alignment was correct. Gareth aka. Kit On 06/04/2022 21:16, Jonas Maebe via fpc-devel wrote: On 06/04/2022 19:20, J. Gareth Moreton via fpc-d

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

2022-04-06 Thread Jonas Maebe via fpc-devel
On 06/04/2022 19:20, J. Gareth Moreton via fpc-devel wrote: I recently made a merge request that initally just fixed the incorrect memory alignment for __m128 and similar types, but doing so revealed a whole plethora of other bugs.  First, when I fixed it, __m128 etc were no longer recognised a

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

2022-04-06 Thread J. Gareth Moreton via fpc-devel
Pascal simply is a strongly typed language. Vector intrinsics are no reason to weaken this. Thus you need to declare operator overloads that hide the nitty, gritty details of assigning a TVector4 to a __m128, e.g.: type   TVector4 = packed record     X, Y, Z, W: Single;     class operator := (c

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

2022-04-06 Thread Sven Barth via fpc-devel
Am 06.04.2022 um 20:32 schrieb J. Gareth Moreton via fpc-devel: Another problem... I've tried to declare an ADDPD intrinsic as follows: function x86_addpd(r0, r1: __m128d): __m128d; [INTERNPROC: fpc_in_x86_addpd]; I thought using __m128d instead of __m128 was fairly logical since ADDPD works

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

2022-04-06 Thread J. Gareth Moreton via fpc-devel
Another problem... I've tried to declare an ADDPD intrinsic as follows: function x86_addpd(r0, r1: __m128d): __m128d; [INTERNPROC: fpc_in_x86_addpd]; I thought using __m128d instead of __m128 was fairly logical since ADDPD works with Doubles, not Singles, but this can cause problems.  For ex

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

2022-04-06 Thread J. Gareth Moreton via fpc-devel
Hi everyone, I recently made a merge request that initally just fixed the incorrect memory alignment for __m128 and similar types, but doing so revealed a whole plethora of other bugs.  First, when I fixed it, __m128 etc were no longer recognised as a valid SIMD or aggregate type due to the wr