[fpc-devel] Aligned dynamic arrays

Anthony Walter sysrpl at gmail.com
Sat Mar 30 23:02:43 CET 2019


On a related note, since a lot of the discussion here seems related to
vector types, I seem to recall someone recently published an mmx,
sse1/2/3/4, simd set of routines related to vector operations. I don't use
much asm other than just being familiar with the basics of ia32 from long
ago, but I do know there have been many enhancements for the instruction
sets I mentioned which specifically greatly increase both the speed and
parallelism of vector operation, including their combination with matrix
math manipulation and vector transforms. I also know that the people in the
mono project enhanced their compiler with special simd vector optimizations:

https://www.mono-project.com/news/2016/12/20/system-numeric-vectors/

Having said that, might it be possible if we could incorporate official
vector and matrix type and optimizations with the compiler? I think
everyone would benefit from officially supported types of this nature that
could have more eyes on them to ensure their operations are best optimized
for the various types of computers and architectures free pascal supports.
I can think of quite a few operations that would benefit from everyone
contributing either their own ideas of the best optimizations or reporting
problems or suggestions.

Here is what I would suggest as a start. Use 4 component float (single and
perhaps additionally double precision) vectors (X, Y, Z, W), 4x4 matrix
type to match.

For vectors we need these operations:
add, subtract, multiply, divide, normalize, transpose

For matrix types we need:
identity, scale, rotate, translate, sheer, multiply (matrix * matrix),
transform (vector * matrix), transpose, invert

That's just a start, but these operations ought to have official simd
support IMO

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20190330/9905a720/attachment.html>


More information about the fpc-devel mailing list