Re: [fpc-devel] vmul commutative optimization?

2019-11-17 Thread Florian Klämpfl
Am 17.11.19 um 16:46 schrieb Marco van de Voort: Op 2019-11-17 om 15:49 schreef Florian Klämpfl: This was an easy one :) Fixed in r43509 Thanks, here is an harder one: https://bugs.freepascal.org/view.php?id=36324 (  :-) ) Yes, FPC cannot keep record elements in registers. I have a

Re: [fpc-devel] vmul commutative optimization?

2019-11-17 Thread Marco van de Voort
Op 2019-11-17 om 15:49 schreef Florian Klämpfl: This was an easy one :) Fixed in r43509 Thanks, here is an harder one: https://bugs.freepascal.org/view.php?id=36324 (  :-) ) ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] vmul commutative optimization?

2019-11-17 Thread Florian Klämpfl
Am 12.11.19 um 13:22 schrieb Marco van de Voort: I compiled some bits with avx, and noticed that when you do asingle:=someconstant*othersingle; then that generates something like     vmovss    TC_$FFTS_$$_C31(%rip),%xmm2     vmulss    %xmm0,%xmm2,%xmm0 while if you do

Re: [fpc-devel] vmul commutative optimization?

2019-11-15 Thread J. Gareth Moreton
I'll double check that one with _m64 and a Homogeneous Float Aggregate. That sounds like a bug. I'll do some reading up on the documentation too. Gareth aka. Kit ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] vmul commutative optimization?

2019-11-15 Thread Marco van de Voort
Op 14/11/2019 om 01:14 schreef J. Gareth Moreton: I guess that means testing with VS? Testing with Visual Studio or even GCC under Windows is a good idea if you want to be sure how particular record types are transferred.  The example given in that article has two fields of type __m128,

Re: [fpc-devel] vmul commutative optimization?

2019-11-13 Thread J. Gareth Moreton
On 13/11/2019 16:03, Marco van de Voort wrote: Op 2019-11-12 om 20:46 schreef J. Gareth Moreton: The Microsoft ABI is a bit restrictive when it comes to record types; as described here , "Structs and unions of

Re: [fpc-devel] vmul commutative optimization?

2019-11-13 Thread Marco van de Voort
Op 2019-11-12 om 20:46 schreef J. Gareth Moreton: The Microsoft ABI is a bit restrictive when it comes to record types; as described here , "Structs and unions of size 8, 16, 32, or 64 bits, and __m64 types,

Re: [fpc-devel] vmul commutative optimization?

2019-11-12 Thread J. Gareth Moreton
The Microsoft ABI is a bit restrictive when it comes to record types; as described here , "Structs and unions of size 8, 16, 32, or 64 bits, and __m64 types, are passed as if they were integers of the same size."

Re: [fpc-devel] vmul commutative optimization?

2019-11-12 Thread Marco van de Voort
Op 12/11/2019 om 16:08 schreef J. Gareth Moreton: It's true.  With VMULSS, only the first parameter (third parameter under Intel notation) can be an address (source: Intel(R) 64 and IA-32 Architectures Software Development Manual, Volume 2B, Page 4-154). I'll see if I can work in that

Re: [fpc-devel] vmul commutative optimization?

2019-11-12 Thread J. Gareth Moreton
It's true.  With VMULSS, only the first parameter (third parameter under Intel notation) can be an address (source: Intel(R) 64 and IA-32 Architectures Software Development Manual, Volume 2B, Page 4-154). I'll see if I can work in that optimisation for the commutative operations (+ and *) at