[fpc-devel] Vectorization

J. Gareth Moreton gareth at moreton-family.com
Tue Dec 12 16:28:27 CET 2017


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, like a static array of Singles, should not cause random and potentially hard-to-find 
crashes.  In this situation, the compiler should automatically put said variables on a 16-byte boundary in 
the stack.

For variables external to the procedure, one might have to use an unaligned move unless explicit byte 
alignment is available and the compiler can be sure of a variable's byte alignment.  For this I proposed the 
"align ##" modifier for type declarations, and this would allow the equivalent of __m128 to be cleanly 
defined, for example, although this hasn't been approved yet.

With things like loop unrolling and optimisation as well, this will likely be a long-term area of research 
on my part.

Kit


On Tue 12/12/17 10:21 , "Adriaan van Os" adriaan at microbizz.nl sent:
> 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 
> 
> <https://software.intel.com/en-us/articles/performance-tools-for
> -software-developers-intel-compiler-options-for-sse-generation-and-processo
> r-specific-optimizations>
> 
> 
> Intel high-performance libraries use runtime-dispatching, e.g. for IPP
> 
> <https://software.intel.com/en-us/node/722780>
> 
> 
> Regards,
> 
> 
> 
> Adriaan van Os
> 
> 
> 
> 
> 




More information about the fpc-devel mailing list