Single Instruction Multiple Data (SIMD)

SIMD instructions in C++ refer to specialized CPU instructions that perform the same operation on multiple data points simultaneously.

These are often used for tasks like vector and matrix operations, image processing, and other computational-intensive jobs. They are supported via intrinsics or assembly language.

I ran into this while trying to make Eigen matrices as constexpr, and saw this stackoverflow thread as to why it wasn’t possible: https://stackoverflow.com/questions/49096618/does-there-exist-information-relating-to-eigenmatrix-constexpr-constructor

Really mastered this at Tesla.

Summary of different vector registers for different SIMD sets:

ArchitectureSIMD SetVector RegistersRegister Size
x86/x86-64MMXMM0 - MM764-bit
x86/x86-64SSEXMM0 - XMM15128-bit
x86/x86-64AVXYMM0 - YMM31256-bit
x86/x86-64AVX-512ZMM0 - ZMM31512-bit
ARMNEONQ0 - Q31 (also D0 - D31)128-bit
ARMSVEZ0 - Z31 (scalable)Variable
RISC-VRVVv0 - v31Variable (128-bit to 2048+ bits)
PowerPCAltiVecv0 - v31128-bit
PowerPCVSXvs0 - vs63128-bit
SPARCVISf0 - f3164-bit (used in SIMD pairs)