Is there any good C/C++ tutorials or examples for learning Intel SSE and AVX instructions?
I found few on Microsoft MSDN and Intel sites, but it would be great to understand it from the basics..
Is there any good C/C++ tutorials or examples for learning Intel SSE and AVX instructions?
I found few on Microsoft MSDN and Intel sites, but it would be great to understand it from the basics..
For the visually inclined SIMD programmer, Stefano Tommesani's site is the best introduction to x86 SIMD programming.
http://www.tommesani.com/index.php/simd/46-sse-arithmetic.html
The diagrams are only provided for MMX and SSE2, but once a learner gets proficient with SSE2, it is relatively easy to move on and read the formal specifications.
Intel IA-32 Instructions beginning with A to M
Intel IA-32 Instructions beginning with N to Z
In addition, it is important for Intel SIMD programmers to know the minimum required architecture for instructions that are outside the SSE2 generation.
Browsing by generations on Wikipedia:
Searching for a given Intel SIMD mnemonic on a single page (via a text search):
There is some good stuff on Apple's developer site, e.g. SSE Performance Programming.
There is a nice introduction here
Also if you have Microsoft DirectX SDK installed, the source from xnamath has lot of vector/matrix operations using sse intrinsics (check in the sdk include folder, xnamath.h, xnamathconvert.inl, xnamathmatrix.inl ...)
You might find it useful to look at examples of how SIMD can be applied to some common algorithms. At Games Developer Conference 2011, there was an Intel talk called "Hotspots, FLOPS, and uOps: To-the-Metal CPU Optimization" that attempts to demonstrate SIMD for algorithms common in games. The talk refers to some Intel sample code that shows how AVX can be applied to cloth calculations.