MMX instructions are a set of 64-bit SIMD integer instructions.
There are 8
MMX registers; they are the floating point registers, just renamed. For this reason, mixing
MMX instrucions and
floating point instructions is
verbotten. When the first MMX instruction of a sequence is executed, the floating point
state is saved. After a sequence of MMX instructions, the
EMMS instruction restores the floating point state.
The MMX instruction set can be divided into:
- pack and unpack instructions:
PUNPCKLDQ, PUNPCKLWD, PUNPCKLBW,
PUNPCKHDQ, PUNPCKHWD, PUNPCKHBW,
and
PACKSSWB, PACKSSDW, PACKUSWB
- Shift instructions:
PSLLQ, PSLLD, PSLLW,
PSRLQ, PSRLD, PSRLW,
PSRAD, PSRAW
- Move instructions:
MOVQ and MOVD.
- Addition and subraction operands:
PADDB, PADDW, PADDD,
PADDUSB, PADDUSW,
PADDSSB, PADDSSW,
and
PSUBB, PSUBW, PSUBD,
PSUBUSB, PSUBUSW,
PSUBSSB, PSUBSSW
- Multiplication instructions:
PMADDWD, PMULHW, PMULLW
- Comparison instructions:
PCMPEQB, PCMPEQW, PCMPEQD,
and
PCMPGTB, PCMPGTW, PCMPGTD
- Logical operation instructions:
PAND, PANDN, POR, PXOR
- EMMS is in a category of its own
Intel claims that the MMX instruction set consists of fifty-seven instructions. This is true on the machine level; but that counts moves to memory and moves to registers as different.