14
\$\begingroup\$

In the past, I've used Visual Studio with the DirectX XNA math library. Now, I'm using the GNU compiler collection. Can anyone advise a SIMD math library with a good documentation?

\$\endgroup\$

6 Answers 6

15
\$\begingroup\$

You can also do it "yourself" using the SSE (Streaming SIMD Extensions) instructions and the intrinsics ( *mmintrin.h files ) of your compiler/proc.


Tutorials

Here is an example of how to use SSE instructions with assembly:
http://neilkemp.us/src/sse_tutorial/sse_tutorial.html

And here is a tutorial on how to use SSE instructions with intrinsics:
http://www.codeproject.com/KB/recipes/sseintro.aspx

A practical guide to using SSE SIMD with C++:
http://sci.tuomastonteri.fi/programming/sse/printable


Useful informations

Intel C++ Intrinsics reference (useful to get the list of instructions):
http://cache-www.intel.com/cd/00/00/34/76/347603_347603.pdf

SSE & SSE2 Intrinsic support for the enhanced instruction sets supported by Intel and AMD processors (useful to all kinds of informations relative to SSE and SIMD):
http://msdn.microsoft.com/en-us/library/y0dh78ez%28v=vs.71%29.aspx

Overall instructions list and informations about SSE, SSE2, SSE3, SSSE3, SSE4, 3DNow etc (different versions of SSE for different proc architecture):
http://softpixel.com/~cwright/programming/simd/sse.php


If you prefer a linear algebra framework I eared about Eigen:
http://eigen.tuxfamily.org/
http://eigen.tuxfamily.org/index.php?title=FAQ#Vectorization (about SIMD support)

And finally if you need more answers about C++ SIMD Frameworks, here is a StackOverflow link. (C++ SSE SIMD framework) :
https://stackoverflow.com/questions/4953121/c-sse-simd-framework

\$\endgroup\$
3
  • \$\begingroup\$ Thank you, but I have not time to do so much routine. \$\endgroup\$
    – itun
    Commented May 23, 2011 at 1:17
  • \$\begingroup\$ Maybe next time, it's not that hard that it looks like ;). However I added few links at the bottom that might help. \$\endgroup\$
    – Valkea
    Commented May 23, 2011 at 1:38
  • \$\begingroup\$ Neat answer. SIMD math is fun. I remember days when i was using SSE for accelerating raytracing. But why to play little toy, if we have GPGPU now :) \$\endgroup\$
    – Notabene
    Commented May 23, 2011 at 9:21
3
\$\begingroup\$

Both of these vector/matrix-libs have optimized SSE2 code, Sony also has an Altivec for PowerPC compile switch:

  1. Sony's vectormath SSE2 and Altivec

  2. Bullet's Linearmath SSE2

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Both links are dead. \$\endgroup\$
    – vexe
    Commented Sep 19, 2017 at 5:09
1
\$\begingroup\$

by a little seraching i think you can use bullet's math library, bullet itself is an opensource physics engine and it seems to have a powerfull math library beside it. here is a shortcut to download link http://sourceforge.net/projects/bullet/files/SIMD%20and%20amp_%20Vector%20Math%20library/simd%20math%201.02%20and%20vector%20math%201.01/simdvectormath.tgz/download

\$\endgroup\$
3
  • \$\begingroup\$ I saw it, but how to compile it I did not understand \$\endgroup\$
    – itun
    Commented May 22, 2011 at 23:38
  • 3
    \$\begingroup\$ Rather than just dumping a download link, perhaps a link to the actual website with the documentation, wiki, and API reference might be more helpful. bulletphysics.org \$\endgroup\$
    – Bob Somers
    Commented May 22, 2011 at 23:47
  • \$\begingroup\$ @Bob i just wanted to express that download link since it just takes some time find simdvectormath specific file in bullet files \$\endgroup\$
    – Ali1S232
    Commented May 23, 2011 at 7:08
1
\$\begingroup\$

It is not here yet. But there will be a boost.simd library (hopefully). Take look at this presentation (given last week at boostcon)

https://github.com/boostcon/2011_presentations/blob/master/thu/simd.pdf

\$\endgroup\$
0
\$\begingroup\$

AMD has the open source SSEPlus project, although I have never used it so I can't comment on its quality or applicability.

\$\endgroup\$
0
\$\begingroup\$

While not exactly focused on using SIMD, I find glm to be a very good general-purpose math library when it comes to games. It doesn't support arbitrary matrices and the like, but it has streamlined features to be used with 3D graphics and it has features to enable SSE as well as some faster implementations of common algorithms.

While it is specifically designed to be used with OpenGL, I have found it to be very useful for a variety of tasks. It heavily uses operator overloading which makes it very easy to use and maintain the code that uses it.

It is based on the OpenGL GLSL language, which has very solid documentation, and any differences are well documented too.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .