Re: [fpc-devel] Vectorization

2018-02-07 Thread J. Gareth Moreton
Hi John, I am on the mailing list.  I don't actually have write access to the SVN repository, so I can only submit patches for review and testing, especially as Florian has his own plans in the works. Currently, vectorcall only really benefits assembly language programmers because the

Re: [fpc-devel] Vectorization

2018-02-07 Thread John Lee
Hi Kit/Gareth Thanks for this work - I've been following all your changes to win64. Can't say I understand all of the vector ones. Be good to commit to trunk asap - tho' gather your are waiting for some Florian mods. Just few qs - maybe these could be clarified in comments/example/tests 1) How

Re: [fpc-devel] Vectorization

2018-02-07 Thread Adriaan van Os
J. Gareth Moreton wrote: Hi everyone, After a lot of work, I have implemented 'vectorcall' into Win64, and made a patch for Lazarus to recognise the keyword in the IDE and highlight it accordingly. Thanks ! Adriaan van Os ___ fpc-devel maillist

Re: [fpc-devel] Vectorization

2017-12-23 Thread Sven Barth via fpc-devel
Am 23.12.2017 11:01 schrieb "Adriaan van Os" : J. Gareth Moreton wrote: > Hey Adriaan, > > I dare ask - did the patch help out your issue at all? I did supply it to > Florian as well, although he has his own work in progress for > vectorization, so whether my code is

Re: [fpc-devel] Vectorization

2017-12-23 Thread Adriaan van Os
J. Gareth Moreton wrote: Hey Adriaan, I dare ask - did the patch help out your issue at all? I did supply it to Florian as well, although he has his own work in progress for vectorization, so whether my code is compatible or not waits to be seen. Didn't get to it yet. Svn needs fpc 3.0.4 to

Re: [fpc-devel] Vectorization

2017-12-22 Thread J. Gareth Moreton
Hey Adriaan, I dare ask - did the patch help out your issue at all? I did supply it to Florian as well, although he has his own work in progress for vectorization, so whether my code is compatible or not waits to be seen. Gareth aka. Kit On Thu 14/12/17 20:29 , "J. Gareth Moreton"

Re: [fpc-devel] Vectorization

2017-12-14 Thread J. Gareth Moreton
https://bugs.freepascal.org/view.php?id=27870 I've made a patch that hopefully fixes this bug, as well as provide some future expansion for vectorization. There are a few new internal sizes such as "OS_MF128" that serve to ensure the most optimal move command is used (out of MOVAPS, MOVAPD

Re: [fpc-devel] Vectorization

2017-12-12 Thread J. Gareth Moreton
Thanks for the extra information - that should help. Indeed, the SEE routines are very advanced, but the thing here is that for a Pascal programmer, the produced machine code should be completely transparent to them, and things like byte alignment for things that are not explicitly vectors,

Re: [fpc-devel] Vectorization

2017-12-12 Thread Adriaan van Os
J. Gareth Moreton wrote: I created a Wiki page to plan things out: http://wiki.lazarus.freepascal.org/Vectorization Note that Intel compilers can optimize for different processor architectures (and different vector size), as follows

Re: [fpc-devel] Vectorization

2017-12-12 Thread Adriaan van Os
J. Gareth Moreton wrote: - There is no desire to include MOVUPS instructions because, while they will work for unaligned memory, are much slower than MOVAPS, but MOVAPS will cause a segmentation fault if the memory is not aligned. Memory should be aligned when using vector code. And

Re: [fpc-devel] Vectorization

2017-12-12 Thread Adriaan van Os
J. Gareth Moreton wrote: I created a Wiki page to plan things out: http://wiki.lazarus.freepascal.org/Vectorization As a side bar, note what Intel writes about Optimization in the Intel Math Kernel Library Developer Reference

Re: [fpc-devel] Vectorization

2017-12-11 Thread Michael Schnell
On 10.12.2017 20:01, J. Gareth Moreton wrote: Starting at the 4th command, it looks back to find a match in the 1st command, What about loops (such as using arrays of n elements as obvious Vectors). Supposedly, here some higher level optimization would be necessary. -Michael

Re: [fpc-devel] Vectorization

2017-12-11 Thread J. Gareth Moreton
Okay, sit back everyone - this is a long read! I'm starting with the problem as listed in https://bugs.freepascal.org/view.php?id=27870 with the source code provided, although with {$codealign varmin=16} and {$codealign localmin=16} at the top. I'm running the latest version of the

Re: [fpc-devel] Vectorization

2017-12-11 Thread J. Gareth Moreton
I created a Wiki page to plan things out: http://wiki.lazarus.freepascal.org/Vectorization It's a stub currently. Kit On Mon 11/12/17 20:34 , "J. Gareth Moreton" gar...@moreton-family.com sent: > P.S. For design ideas and patches that need collaboration, is the Wiki > usually the way of going

Re: [fpc-devel] Vectorization

2017-12-11 Thread J. Gareth Moreton
P.S. For design ideas and patches that need collaboration, is the Wiki usually the way of going about it? Kit ___ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Re: [fpc-devel] Vectorization

2017-12-11 Thread J. Gareth Moreton
I might need to set up a Wiki page of some kind containing a design spec, because even fixing that bug will require some extra features. Case in point: - There is no desire to include MOVUPS instructions because, while they will work for unaligned memory, are much slower than MOVAPS, but

Re: [fpc-devel] Vectorization

2017-12-11 Thread Adriaan van Os
J. Gareth Moreton wrote: I guess fixing that might be a good starting point. There's also the issue of memory alignment causing crashes. I (and others I think) would much welcome the fix. WIth regard to memory aligment, you would have to test what is already fixed in the current (svn)

Re: [fpc-devel] Vectorization

2017-12-11 Thread J. Gareth Moreton
I guess fixing that might be a good starting point. There's also the issue of memory alignment causing crashes. Kit On Mon 11/12/17 12:19 , mar...@stack.nl (Marco van de Voort) sent: > In our previous episode, Adriaan van Os said: > > > > Since I'm masochistic in my desire to > understand

Re: [fpc-devel] Vectorization

2017-12-11 Thread Marco van de Voort
In our previous episode, Adriaan van Os said: > > Since I'm masochistic in my desire to understand and improve the Free > > Pascal Compiler, I would like to add > > some vectorisation support in its optimisation cycle, since that is one > > thing that many other compilers > > attempt to do

Re: [fpc-devel] Vectorization

2017-12-11 Thread Adriaan van Os
J. Gareth Moreton wrote: Hi everyone, Since I'm masochistic in my desire to understand and improve the Free Pascal Compiler, I would like to add some vectorisation support in its optimisation cycle, since that is one thing that many other compilers attempt to do these days. But before I

Re: [fpc-devel] Vectorization

2017-12-11 Thread Sven Barth via fpc-devel
Am 10.12.2017 20:01 schrieb "J. Gareth Moreton" : The idea I had currently (this is without looking at any previous theory) was to use a kind of sliding window, similar to how ZIP and other LZ77-based algorithms work when compressing repeating strings, to look backwards

Re: [fpc-devel] Vectorization

2017-12-10 Thread J. Gareth Moreton
The idea I had currently (this is without looking at any previous theory) was to use a kind of sliding window, similar to how ZIP and other LZ77-based algorithms work when compressing repeating strings, to look backwards in the current block for a matching command and then scan forward. If

Re: [fpc-devel] Vectorization

2017-12-10 Thread Florian Klämpfl
Am 10.12.2017 um 02:29 schrieb J. Gareth Moreton: > Hi everyone, > > Since I'm masochistic in my desire to understand and improve the Free Pascal > Compiler, I would like to add > some vectorisation support in its optimisation cycle, since that is one thing > that many other compilers >

Re: [fpc-devel] Vectorization

2017-12-10 Thread Florian Klämpfl
Am 10.12.2017 um 14:03 schrieb Marco van de Voort: > In our previous episode, J. Gareth Moreton said: >> Since I'm masochistic in my desire to understand and improve the Free Pascal >> Compiler, I would like to add >> some vectorisation support in its optimisation cycle, since that is one >>

Re: [fpc-devel] Vectorization

2017-12-10 Thread Marco van de Voort
In our previous episode, J. Gareth Moreton said: > Since I'm masochistic in my desire to understand and improve the Free Pascal > Compiler, I would like to add > some vectorisation support in its optimisation cycle, since that is one thing > that many other compilers > attempt to do these

[fpc-devel] Vectorization

2017-12-09 Thread J. Gareth Moreton
Hi everyone, Since I'm masochistic in my desire to understand and improve the Free Pascal Compiler, I would like to add some vectorisation support in its optimisation cycle, since that is one thing that many other compilers attempt to do these days. But before I begin, does FPC support any