I see many instruction with shorthand such as "_mm_and_si128". I want to know what does the "mm" mean.
See What are the names and meanings of the intrinsic vector element types, like epi64x or pi32? for the element types.
The _mm_
function naming very likely stands for MMX or Multi Media, or the mm0-7
register naming in assembly. Intel starting this naming scheme for C intrinsics with the first SIMD extension they introduced for x86, MMX, which used 64-bit vectors (in registers mm0-7, or the C intrinsic type __m64
).
Officially, and apparently as a legal defense that lets them trademark MMX, it's not an initialism for something longer. But unofficially it's widely thought of as Multi-Media eXtensions.
SSE2 added 128-bit versions of those integer-SIMD instructions, using the XMM0-7 registers (XMM0-15 in 64-bit mode) introduced with SSE1, which mostly added single-precision floating point in those registers, and some new integer instructions on MMX registers. (SSE2 also added scalar and packed-double in XMM regs.) See the tag wiki, https://stackoverflow.com/tags/sse/info, for more history.
Intel continued their naming pattern, like _mm_add_epi8
as the SSE2 128-bit version of MMX _mm_add_pi8
, not changing the intro to _xmm_add
or anything like that. As discussed in What are the names and meanings of the intrinsic vector element types, like epi64x or pi32?, the e
for Extended is what indicates that it's a a vector wider than 64-bit of packed i8 or u8 or whatever.
The __m64
/ __m128i
type names don't seem to stand for anything, but the similar naming to _mm_
and _mm256
function names is clearly for association.