Instruction
VDBPSADBW
Sums absolute differences of 4-byte groups of the two sources into 16-bit results, after an immediate shuffles the second within each 128-bit lane.
- Extensions
- Forms
- 6 (6 EVEX)
- Data
- Intel XED v2026.08.23
VDBPSADBW computes sums of absolute differences of four unsigned bytes, four sums per quadword, each in a word. It works in two steps, in each 128-bit lane:
- The second source is shuffled: imm8 picks, two bits per position, which of the lane’s four doublewords goes where, as PSHUFD does.
- In each quadword, the low doubleword of the first source is compared with the shuffled bytes at offsets 0 to 3 and 1 to 4, giving words 0 and 1, and the high doubleword with the bytes at offsets 2 to 5 and 3 to 6, giving words 2 and 3.
A sum is at most 1020, so nothing saturates: in the cases recorded on Zen 5, bytes of FFh against zeros gave 03FCh in every word, and 80h against 7Fh gave 4.
MPSADBW in every lane
The shuffle makes it more general than MPSADBW, which compares one block with eight windows that each start a byte further on. VDBPSADBW does the same for every lane when the block is in all four doublewords of the first source and imm8 is 94h: the shuffle then lines up the lane’s doublewords 0, 1, 1 and 2, so that the eight words are the SADs at offsets 0 to 7. A ZMM register thus holds 32 such sums, against MPSADBW’s eight; VMPSADBW gets to 16 with AVX2 and to 32 only with AVX10.2. Other immediates give other offsets, and different doublewords in the first source compare two blocks at once.
Masking
Unlike VPSADBW, it takes a write mask, one bit per word, with merging or zeroing. The mask covers the destination only: a memory source is read in full whatever the mask, and a page fault on it is not suppressed for masked-off words: its exception class, E4NF, is one of those the SDM lists without fault suppression.
It is part of AVX512BW, so -march=x86-64-v4 enables it, and AVX10.1.
A C loop of eight sliding 4-byte SADs does not become VDBPSADBW in
GCC 14 or Clang 23 at -O2 with that target; the
intrinsics _mm512_dbsad_epu8 and kin give it in both, with _mask_
and _maskz_ variants for the two kinds of masking.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VDBPSADBW xmm {k}{z}, xmm, xmm, imm8
VDBPSADBW_XMMu16_MASKmskw_XMMu8_XMMu8_IMM8_AVX512 | EVEX.128.66.0F3A.W0 42 /r ib | AVX10.1 or AVX512BW + AVX512VL |
VDBPSADBW xmm {k}{z}, xmm, m128, imm8
VDBPSADBW_XMMu16_MASKmskw_XMMu8_MEMu8_IMM8_AVX512 | EVEX.128.66.0F3A.W0 42 /r ib | AVX10.1 or AVX512BW + AVX512VL |
VDBPSADBW ymm {k}{z}, ymm, ymm, imm8
VDBPSADBW_YMMu16_MASKmskw_YMMu8_YMMu8_IMM8_AVX512 | EVEX.256.66.0F3A.W0 42 /r ib | AVX10.1 or AVX512BW + AVX512VL |
VDBPSADBW ymm {k}{z}, ymm, m256, imm8
VDBPSADBW_YMMu16_MASKmskw_YMMu8_MEMu8_IMM8_AVX512 | EVEX.256.66.0F3A.W0 42 /r ib | AVX10.1 or AVX512BW + AVX512VL |
VDBPSADBW zmm {k}{z}, zmm, zmm, imm8
VDBPSADBW_ZMMu16_MASKmskw_ZMMu8_ZMMu8_IMM8_AVX512 | EVEX.512.66.0F3A.W0 42 /r ib | AVX10.1 or AVX512BW |
VDBPSADBW zmm {k}{z}, zmm, m512, imm8
VDBPSADBW_ZMMu16_MASKmskw_ZMMu8_MEMu8_IMM8_AVX512 | EVEX.512.66.0F3A.W0 42 /r ib | AVX10.1 or AVX512BW |
Latency and throughput
| Model | xmm {k}{z}, xmm, xmm, imm8no maskymm {k}{z}, ymm, ymm, imm8no mask | xmm {k}{z}, xmm, xmm, imm8with a mask, zeroingymm {k}{z}, ymm, ymm, imm8with a mask, zeroing | xmm {k}{z}, xmm, m128, imm8no mask | xmm {k}{z}, xmm, m128, imm8with a mask, zeroing | ymm {k}{z}, ymm, m256, imm8no mask | ymm {k}{z}, ymm, m256, imm8with a mask, zeroing | zmm {k}{z}, zmm, zmm, imm8no mask | zmm {k}{z}, zmm, zmm, imm8with a mask, zeroing | zmm {k}{z}, zmm, m512, imm8no mask | zmm {k}{z}, zmm, m512, imm8with a mask, zeroing |
|---|---|---|---|---|---|---|---|---|---|---|
| Skylake-SP, Ice Lake | 3 / 1p5 | 3 / 1p5 | 9 / 1p5 | 9 / 1p5 | 10 / 1p5 | 10 / 1p5 | 3 / 1p5 | 3 / 1p5 | 10 / 1p5 | 10 / 1p5 |
| Sapphire Rapids | 3 / 1p5 | 5 / 1p5 | 10 / 1p5 | 13 / 1p5 | 11 / 1p5 | 13 / 1p5 | 3 / 1p5 | 5 / 1p5 | 11 / 1p5 | 13 / 1p5 |
| Zen 4 | 3 / 0.51FP0 FP1 FP2 FP3 | 3 / 0.51FP0 FP1 FP2 FP3 | 10 / 0.5FP0 FP1 FP2 FP3 | 10 / 0.5FP0 FP1 FP2 FP3 | 10 / 0.5FP0 FP1 FP2 FP3 | 10 / 0.5FP0 FP1 FP2 FP3 | 4 / 1FP0 FP1 FP2 FP3 | 4 / 1FP0 FP1 FP2 FP3 | 11 / 1FP0 FP1 FP2 FP3 | 11 / 1FP0 FP1 FP2 FP3 |
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.
Example: imm8 = 0x72 (0111 0010 in binary): t holds doublewords 1, 3, 0, 2 of xmm3, from doubleword 3 down. The sources are drawn in doublewords, with a tick between the bytes of t; each bar under t is a window, joined to the word it makes. The ymm and zmm forms repeat this in each 128-bit lane, with the same imm8. The forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.
With imm8 = 0x72, result word i is the sum of the absolute differences between the four bytes of xmm2 from byte 8(i/4)+4((i%4)/2) and those of t from byte 8(i/4)+i%4, 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.
t = 0 # src3, its doublewords
for i in range(VL // 32): # shuffled in each lane
c = imm8 >> 2 * (i % 4) & 3
t |= src3.d[i - i % 4 + c] << 32 * i
for i in range(VL // 16): # word i, of quadword i // 4:
a = 8 * (i // 4) + 4 * (i % 4 // 2) # 4 bytes of zmm2
b = 8 * (i // 4) + i % 4 # and of t
if k1[i]: # 1 without a write mask
s = 0
for j in range(4):
x = t >> 8 * (b + j) & 0xFF
s += abs(zmm2.b[a + j] - x)
zmm1.w[i] = s
elif zeroing:
zmm1.w[i] = 0
# else: zmm1.w[i] keeps its value
# src3 is read whatever the mask: a fault in it is not suppressed
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 14 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VDBPSADBW xmm {k}{z}, xmm, xmm/m128, imm8 VDBPSADBW ymm {k}{z}, ymm, ymm/m256, imm8 VDBPSADBW zmm {k}{z}, zmm, zmm/m512, imm8 | ||
xmm, ymm, zmm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm, ymm, zmm | explicit | read |
xmm/m128, ymm/m256, zmm/m512 | explicit | read |
imm8 | explicit | read |
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.
- All forms
AVX512-E4NF
Attributes
What else XED records about the forms. How to read.
- All forms
- write masking
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VDBPSADBW, 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.
| Intrinsic | Compiles to |
|---|---|
_mm_dbsad_epu8
__m128i _mm_dbsad_epu8(__m128i A, __m128i B, const int imm) |
|
_mm_mask_dbsad_epu8
__m128i _mm_mask_dbsad_epu8(__m128i W, __mmask8 U, __m128i A, __m128i B, const int imm) |
|
_mm_maskz_dbsad_epu8
__m128i _mm_maskz_dbsad_epu8(__mmask8 U, __m128i A, __m128i B, const int imm) |
|
_mm256_dbsad_epu8
__m256i _mm256_dbsad_epu8(__m256i A, __m256i B, const int imm) |
|
_mm256_mask_dbsad_epu8
__m256i _mm256_mask_dbsad_epu8(__m256i W, __mmask16 U, __m256i A, __m256i B, const int imm) |
|
_mm256_maskz_dbsad_epu8
__m256i _mm256_maskz_dbsad_epu8(__mmask16 U, __m256i A, __m256i B, const int imm) |
|
_mm512_dbsad_epu8
__m512i _mm512_dbsad_epu8(__m512i A, __m512i B, const int imm) |
|
_mm512_mask_dbsad_epu8
__m512i _mm512_mask_dbsad_epu8(__m512i W, __mmask32 U, __m512i A, __m512i B, const int imm) |
|
_mm512_maskz_dbsad_epu8
__m512i _mm512_maskz_dbsad_epu8(__mmask32 U, __m512i A, __m512i B, const int imm) |
|
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.
| ISA set | CPUID | Processors |
|---|---|---|
AVX512BW_128 | AVX10.1 or AVX512BW + AVX512VL | Cannon Lake, Ice Lake (client), Tiger Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Zen 4, Zen 5, Zen 6 |
AVX512BW_256 | Same as AVX512BW_128 | Same as AVX512BW_128 |
AVX512BW_512 | AVX10.1 or AVX512BW | Same as AVX512BW_128 |
More AVX10.1 instructions
- VCVTTPS2QQ
- VCVTTPS2UDQ
- VCVTTPS2UQQ
- VCVTTSD2SI
- VCVTTSD2USI
- VCVTTSH2SI
- VCVTTSH2USI
- VCVTTSS2SI
- VCVTTSS2USI
- VCVTUDQ2PD
- VCVTUDQ2PH
- VCVTUDQ2PS
- VCVTUQQ2PD
- VCVTUQQ2PH
- VCVTUQQ2PS
- VCVTUSI2SD
- VCVTUSI2SH
- VCVTUSI2SS
- VCVTUW2PH
- VCVTW2PH
- VDIVPD
- VDIVPH
- VDIVPS
- VDIVSD
- VDIVSH
- VDIVSS
- VDPBF16PS
- VEXPANDPD
- VEXPANDPS
- VEXTRACTF32X4
- VEXTRACTF32X8
- VEXTRACTF64X2
- VEXTRACTF64X4
- VEXTRACTI32X4
- VEXTRACTI32X8
- VEXTRACTI64X2
- VEXTRACTI64X4
- VEXTRACTPS
- VFCMADDCPH
- VFCMADDCSH
Sources
- Intel XED v2026.08.23 (commit
0bcb6237345c): forms, encodings, operands, flags, exception classes, attributes, ISA sets, CPUID bits and chip model. - The CPU data of x86-64.net: Zen 3 to Zen 6, from GCC’s
-marchfeature sets and AMD’s Processor Programming References, which the page of each processor cites. - 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. - LLVM 23.1.2's x86 scheduling models (commit
85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them. - Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2C, page 5-154 (VDBPSADBW)
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.