Extensions
Forms
10 (4 VEX, 6 EVEX)
Data
Intel XED v2026.08.23

VMPSADBW is the VEX form of SSE4.1’s MPSADBW, whose page covers the eight sliding sums of absolute differences and their use in motion estimation. The VEX encoding takes a separate destination, reads memory at any alignment and clears the register above the vector length; VEX.128 needs AVX and VEX.256 AVX2.

Two lanes, two controls

The ymm form repeats the operation in each 128-bit lane, and each lane has its own fields in the immediate: bits 2:0 steer the low lane, as in the xmm form, and bits 5:3 the high lane, so only bits 7:6 are ignored. On Zen 5, the recorded vmpsadbw ymm8, ymm15, ymm0, 0x2c took the high lane’s block from its doubleword 1, as bits 4:3 = 01b select, and its windows from byte 4, as bit 5 selects. With zeros in that block and bytes 00h to 0Fh in the high lane of YMM15, words 8 to 15 came out as 16h, 1Ah and so on up to 32h, the plain byte sum of each window.

AVX10.2 adds EVEX forms at all three widths, with a write mask per word and a different prefix (F3 rather than 66); the 512-bit form gives its upper two lanes the controls of the lower two. Zen 5 has no AVX10.2, so the probe left them unrun.

In compiled code

In our builds at -O2, _mm_mpsadbw_epu8 and _mm256_mpsadbw_epu8 compile to VMPSADBW in GCC 14 and Clang 23 with -march=x86-64-v3 and x86-64-v4. Clang 23 also accepts -mavx10.2 and compiles _mm512_mpsadbw_epu8 and its masked form to the EVEX zmm form; GCC 14 has no such option. The eight sums written as two loops over fixed-size global arrays are vectorized differently: Clang widens the windows with VPMOVZXBW and takes each difference as VPMAXUW minus VPMINUW, and neither compiler emits VMPSADBW.

AMD’s latency spreadsheet for Zen 5 gives every VEX row a latency of 5 cycles: four macro-ops and one every two cycles for the xmm register form, six and one every three with memory, three and four for the ymm register and memory forms, one every two cycles.

Forms

Every encoding of VMPSADBW that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
VMPSADBW xmm, xmm, m128, imm8 VMPSADBW_XMMdq_XMMdq_MEMdq_IMMbVEX.128.66.0F3A.WIG 42 /r ibAVX
VMPSADBW xmm, xmm, xmm, imm8 VMPSADBW_XMMdq_XMMdq_XMMdq_IMMbVEX.128.66.0F3A.WIG 42 /r ibAVX
VMPSADBW ymm, ymm, m256, imm8 VMPSADBW_YMMqq_YMMqq_MEMqq_IMMbVEX.256.66.0F3A.WIG 42 /r ibAVX2
VMPSADBW ymm, ymm, ymm, imm8 VMPSADBW_YMMqq_YMMqq_YMMqq_IMMbVEX.256.66.0F3A.WIG 42 /r ibAVX2
VMPSADBW xmm {k}{z}, xmm, xmm, imm8 VMPSADBW_XMMu16_MASKmskw_XMMu8_XMMu8_IMM8_AVX512EVEX.128.F3.0F3A.W0 42 /r ibAVX10.2
VMPSADBW xmm {k}{z}, xmm, m128, imm8 VMPSADBW_XMMu16_MASKmskw_XMMu8_MEMu8_IMM8_AVX512EVEX.128.F3.0F3A.W0 42 /r ibAVX10.2
VMPSADBW ymm {k}{z}, ymm, ymm, imm8 VMPSADBW_YMMu16_MASKmskw_YMMu8_YMMu8_IMM8_AVX512EVEX.256.F3.0F3A.W0 42 /r ibAVX10.2
VMPSADBW ymm {k}{z}, ymm, m256, imm8 VMPSADBW_YMMu16_MASKmskw_YMMu8_MEMu8_IMM8_AVX512EVEX.256.F3.0F3A.W0 42 /r ibAVX10.2
VMPSADBW zmm {k}{z}, zmm, zmm, imm8 VMPSADBW_ZMMu16_MASKmskw_ZMMu8_ZMMu8_IMM8_AVX512EVEX.512.F3.0F3A.W0 42 /r ibAVX10.2
VMPSADBW zmm {k}{z}, zmm, m512, imm8 VMPSADBW_ZMMu16_MASKmskw_ZMMu8_MEMu8_IMM8_AVX512EVEX.512.F3.0F3A.W0 42 /r ibAVX10.2

Latency and throughput

What the scheduling models of LLVM 23.1.2 give for each form, not measurements: latency / reciprocal throughput in cycles, the ports under them. A row is a model, or models that agree; a dash, a form that its processors lack. Memory forms: latency from the address, ports without the load and store units. Which processors each model covers.
Modelxmm, xmm, m128, imm8xmm, xmm, xmm, imm8
ymm, ymm, ymm, imm8
ymm, ymm, m256, imm8
Sandy Bridge13 / 1p0157 / 1p015
Haswell13 / 2p057 / 2p0514 / 2p05
Broadwell12 / 2p057 / 2p0513 / 2p05
Skylake, Skylake-SP10 / 2p54 / 2p511 / 2p5
Ice Lake10 / 1p154 / 1p1511 / 1p15
Alder Lake, Sapphire Rapids11 / 1p154 / 1p1512 / 1p15
Lunar Lake11 / 1V2 V34 / 1V2 V312 / 1V2 V3
Piledriver14 / 4FPMMA FPU08 / 4FPMMA FPU0
Zen, Zen 2100 / 0.25100 / 0.25100 / 0.25
Zen 3, Zen 411 / 2FP0 FP1 FP2 FP34 / 2FP0 FP1 FP2 FP311 / 2FP0 FP1 FP2 FP3
Jaguar8 / 2FPU0 VIMUL3 / 2FPU0 VIMUL

Data flow

Where the elements of the sources go, element 0 on the right; results that depend on a control value are drawn for an example. How to read.

Sums of absolute differences over sliding windows: word i of the result adds up the absolute differences between bytes p + i to p + i + 3 of xmm2 (a window, a byte further on for each word) and the four bytes of a block of xmm3; imm8[2] puts p at byte 0 or 4, and imm8[1:0] picks the block's doubleword.
VMPSADBW with imm8 = 0x06With imm8 = 0x06, result word i is the sum of the absolute differences between bytes 4+i to 7+i of xmm2 and bytes 8 to 11 of xmm3, byte by byte. Result words 7 to 0: r7, unchanged (bit 6 of k1 is 0), r5, r4, r3, r2, r1, r0.0123xmm2a11111110k1r0r1r2r3r4r5r7xmm10132xmm3or m128b

Example: imm8 = 0x06: the windows from byte 4, the block doubleword 2. The sources are drawn in doublewords, with a tick between bytes; each bar under xmm2 is a window, joined to the word it makes. The ymm and zmm forms do the same in each 128-bit lane, with imm8[5:3] for lanes 1 and 3. The EVEX forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.

With imm8 = 0x06, result word i is the sum of the absolute differences between bytes 4+i to 7+i of xmm2 and bytes 8 to 11 of xmm3, byte by byte. Result words 7 to 0: r7, unchanged (bit 6 of k1 is 0), r5, r4, r3, r2, r1, r0.

Operation

What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.

VEX forms
for l in range(VL // 128):       # each 128-bit lane
    c = imm8 >> 3 * l            # lane 1: imm8[5:3]
    p = 16 * l + 4 * (c >> 2 & 1)  # the windows of ymm2
    q = 16 * l + 4 * (c & 3)       # the block of src3
    for i in range(8):
        s = 0
        for j in range(4):
            x = ymm2.b[p + i + j]
            s += abs(x - src3.b[q + j])
        ymm1.w[8 * l + i] = s
# imm8[7:6] are ignored, and imm8[5:3] by the xmm forms
# ymm1 is zeroed from bit VL up

Run on AMD Zen 5 (EPYC 9645): 8 cases.

EVEX forms
for l in range(VL // 128):       # each 128-bit lane
    c = imm8 >> 3 * (l % 2)      # lanes 1, 3: imm8[5:3]
    p = 16 * l + 4 * (c >> 2 & 1)  # the windows of zmm2
    q = 16 * l + 4 * (c & 3)       # the block of src3
    for i in range(8):
        s = 0
        for j in range(4):
            x = zmm2.b[p + i + j]
            s += abs(x - src3.b[q + j])
        if k1[8 * l + i]:        # 1 without a write mask
            zmm1.w[8 * l + i] = s
        elif zeroing:
            zmm1.w[8 * l + i] = 0
        # else: the word keeps its value
# imm8[7:6] are ignored
# src3 is read whatever the mask: a fault in it is not
# suppressed
# zmm1 is zeroed from bit VL up

Not run on a processor: none of these processors has AVX10.2.

Operands

What each form reads and writes, as Intel XED records it: the operands of its syntax, in order, and the implicit ones that the syntax does not name. How to read.
OperandKindAction
VMPSADBW xmm, xmm, xmm/m128, imm8 VMPSADBW ymm, ymm, ymm/m256, imm8
xmm, ymmexplicitwrite
xmm, ymmexplicitread
xmm/m128, ymm/m256explicitread
imm8explicitread
VMPSADBW xmm {k}{z}, xmm, xmm/m128, imm8 VMPSADBW ymm {k}{z}, ymm, ymm/m256, imm8 VMPSADBW zmm {k}{z}, zmm, zmm/m512, imm8
xmm, ymm, zmmexplicitwrite (masked)
{k}explicitread (write mask)
xmm, ymm, zmmexplicitread
xmm/m128, ymm/m256, zmm/m512explicitread
imm8explicitread

Flags

None: XED records no flag that the forms test or change.

Exceptions

The exception class is XED's name for the set of exception conditions that a form follows. How to read.

VEX forms
avx-type-4
EVEX forms
AVX512-E4NF

Attributes

What else XED records about the forms. How to read.

EVEX forms
write masking

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to VMPSADBW, each with the form it compiles to and the Clang options it needs. The forms come from compiling every intrinsic and decoding the result with Intel XED; all intrinsics A–Z explains the method.

IntrinsicCompiles to
_mm_mpsadbw_epu8 __m128i _mm_mpsadbw_epu8(__m128i X, __m128i Y, const int M)

VMPSADBW xmm, xmm, xmm, imm8 VEX.128 -mavxwith AVX enabled

_mm_mask_mpsadbw_epu8 __m128i _mm_mask_mpsadbw_epu8(__m128i W, __mmask8 U, __m128i A, __m128i B, const int imm)

VMPSADBW xmm {k}, xmm, xmm, imm8 EVEX.128 -mavx10.2

_mm_maskz_mpsadbw_epu8 __m128i _mm_maskz_mpsadbw_epu8(__mmask8 U, __m128i A, __m128i B, const int imm)

VMPSADBW xmm {k}{z}, xmm, xmm, imm8 EVEX.128 -mavx10.2

_mm256_mpsadbw_epu8 __m256i _mm256_mpsadbw_epu8(__m256i X, __m256i Y, const int M)

VMPSADBW ymm, ymm, ymm, imm8 VEX.256 -mavx2

_mm256_mask_mpsadbw_epu8 __m256i _mm256_mask_mpsadbw_epu8(__m256i W, __mmask16 U, __m256i A, __m256i B, const int imm)

VMPSADBW ymm {k}, ymm, ymm, imm8 EVEX.256 -mavx10.2

_mm256_maskz_mpsadbw_epu8 __m256i _mm256_maskz_mpsadbw_epu8(__mmask16 U, __m256i A, __m256i B, const int imm)

VMPSADBW ymm {k}{z}, ymm, ymm, imm8 EVEX.256 -mavx10.2

_mm512_mpsadbw_epu8 __m512i _mm512_mpsadbw_epu8(__m512i A, __m512i B, const int imm)

VMPSADBW zmm, zmm, zmm, imm8 EVEX.512 -mavx10.2

_mm512_mask_mpsadbw_epu8 __m512i _mm512_mask_mpsadbw_epu8(__m512i W, __mmask32 U, __m512i A, __m512i B, const int imm)

VMPSADBW zmm {k}, zmm, zmm, imm8 EVEX.512 -mavx10.2

_mm512_maskz_mpsadbw_epu8 __m512i _mm512_maskz_mpsadbw_epu8(__mmask32 U, __m512i A, __m512i B, const int imm)

VMPSADBW zmm {k}{z}, zmm, zmm, imm8 EVEX.512 -mavx10.2

CPUID and processors

Each form belongs to an XED ISA set. A form can be used when the processor reports every CPUID bit of one of its ISA set's alternatives.

CPUID requirements and processors of the XED ISA sets above. Alternatives are separated by “or”; processors follow XED’s chip model, whose AMD processors end with Zen 2, and the CPU data of this site for Zen 3 to Zen 6.

More AVX instructions

All 253 AVX instructions

More AVX2 instructions

All 138 AVX2 instructions

More AVX10.2 instructions

All 96 AVX10.2 instructions

Sources

  1. Intel XED v2026.08.23 (commit 0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model.
  2. The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s -march feature sets and AMD’s Processor Programming References, which the page of each processor cites.
  3. Clang's x86 intrinsic headers, LLVM 23.1.2 (commit 85ac56026243): the intrinsics, their signatures and doc comments, and the Clang of that release, which compiled each of them.
  4. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  5. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-132 (MPSADBW)
  6. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
  7. Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
  8. Software Optimization Guide for the AMD Zen5 Microarchitecture (58455, rev. 1.00, August 2024), Wayback Machine copy of AMD's ZIP

The tables are derived from Intel XED, Copyright Intel Corporation, licensed under the Apache License 2.0; x86-64.net converted and reformatted them. The intrinsics and their signatures come from Clang and the timings from LLVM's scheduling models, both part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.