Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Intel SSE and AVX Examples and Tutorials [closed]

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..

like image 829
veda Avatar asked Nov 27 '12 04:11

veda


People also ask

What is SSE and AVX?

SSE (streaming SIMD extensions) and AVX (advanced vector extensions) are SIMD (single instruction multiple data streams) instruction sets supported by recent CPUs manufactured in Intel and AMD. This SIMD programming allows parallel processing by multiple cores in a single CPU.

What is Intel SSE?

SSE is a process or technology that enables single instruction multiple data. Older processors only process a single data element per instruction. SSE enables the instruction to handle multiple data elements.

When was AVX2 introduced?

AVX2 (also known as Haswell New Instructions) expands most integer commands to 256 bits and introduces new instructions. They were first supported by Intel with the Haswell processor, which shipped in 2013.

What are AVX intrinsics?

AVX provides intrinsic functions that combine one or more values into a 256-bit vector. Table 2 lists their names and provides a description of each. There are similar intrinsics that initialize 128-bit vectors, but those are provided by SSE, not AVX.


1 Answers

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

http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf

Intel IA-32 Instructions beginning with N to Z

http://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2b-manual.pdf


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:

  • http://en.wikipedia.org/wiki/SSE3
  • http://en.wikipedia.org/wiki/SSSE3
  • http://en.wikipedia.org/wiki/SSE4.1#SSE4.1
  • http://en.wikipedia.org/wiki/SSE4.2#SSE4.2

Searching for a given Intel SIMD mnemonic on a single page (via a text search):

  • http://en.wikipedia.org/wiki/X86_instruction_listings

like image 141
rwong Avatar answered Oct 03 '22 00:10

rwong