Instruction
VPMULTISHIFTQB
For each byte of the result, takes 8 bits from the matching quadword of the second source at a bit offset given by a control byte of the first.
- Extensions
- Forms
- 6 (6 EVEX)
- Data
- Intel XED v2026.08.23
VPMULTISHIFTQB extracts unaligned bytes from quadwords: each byte of
the result is the 8 bits of a quadword of the second source that start
at the bit that the matching byte of the first source names. Byte i
takes its bits from quadword i / 8, so the eight control bytes of each
quadword can cut eight fields out of it at eight independent offsets,
overlapping or not. It came with AVX512_VBMI alongside
VPERMB, and the intrinsic is
_mm512_multishift_epi64_epi8(control, data).
Offsets that wrap
Only the low 6 bits of a control byte count, and the 8 bits wrap around the quadword: the byte is the quadword rotated right by the offset, as ROR would, cut to its low 8 bits. In a case recorded on Zen 5 with the quadword 0123456789ABCDEFh, the control 3Eh gave BCh, whose two low bits came from bits 63 and 62 and the other six from bits 5 to 0, and the control C1h gave F7h, the bits from bit 1 up. A field of fewer than 8 bits needs an AND afterwards: the bits above it come along.
The data quadwords are the operand that may be in memory, with broadcast of one quadword to all. The forms belong to exception class E4NF, without fault suppression: every byte of the data operand is read whatever the write mask says, so a mask cannot keep a load from faulting past the end of a buffer.
Unpacking bit fields
Intel’s optimization manual decompresses an array of 5-bit values this way (Section 17.17.3, Example 17-28): VPERMB copies each group of five input bytes into its own quadword, VPMULTISHIFTQB with the offsets 0, 5, 10, … 35 cuts eight fields out of each, and VPANDQ with 1Fh in every byte clears the bits above the field, 64 values per iteration. The manual reports 26 times the speed of the scalar loop of shifts and masks.
GCC 14 and Clang 23 do not form it from shifts and masks in C; it comes from the intrinsics.
AMD’s Zen 5 guide lists VPMULTISHIFTQB as one macro-op with a latency of 3 cycles on every register width.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VPMULTISHIFTQB xmm {k}{z}, xmm, xmm
VPMULTISHIFTQB_XMMu8_MASKmskw_XMMu8_XMMu64_AVX512 | EVEX.128.66.0F38.W1 83 /r | AVX10.1 or AVX512VBMI + AVX512VL |
VPMULTISHIFTQB xmm {k}{z}, xmm, m128/m64bcst
VPMULTISHIFTQB_XMMu8_MASKmskw_XMMu8_MEMu64_AVX512 | EVEX.128.66.0F38.W1 83 /r | AVX10.1 or AVX512VBMI + AVX512VL |
VPMULTISHIFTQB ymm {k}{z}, ymm, ymm
VPMULTISHIFTQB_YMMu8_MASKmskw_YMMu8_YMMu64_AVX512 | EVEX.256.66.0F38.W1 83 /r | AVX10.1 or AVX512VBMI + AVX512VL |
VPMULTISHIFTQB ymm {k}{z}, ymm, m256/m64bcst
VPMULTISHIFTQB_YMMu8_MASKmskw_YMMu8_MEMu64_AVX512 | EVEX.256.66.0F38.W1 83 /r | AVX10.1 or AVX512VBMI + AVX512VL |
VPMULTISHIFTQB zmm {k}{z}, zmm, zmm
VPMULTISHIFTQB_ZMMu8_MASKmskw_ZMMu8_ZMMu64_AVX512 | EVEX.512.66.0F38.W1 83 /r | AVX10.1 or AVX512VBMI |
VPMULTISHIFTQB zmm {k}{z}, zmm, m512/m64bcst
VPMULTISHIFTQB_ZMMu8_MASKmskw_ZMMu8_MEMu64_AVX512 | EVEX.512.66.0F38.W1 83 /r | AVX10.1 or AVX512VBMI |
Latency and throughput
| Model | xmm {k}{z}, xmm, xmmno maskymm {k}{z}, ymm, ymmno mask | xmm {k}{z}, xmm, xmmwith a mask, zeroingymm {k}{z}, ymm, ymmwith a mask, zeroing | xmm {k}{z}, xmm, m128/m64bcstno mask, broadcast | xmm {k}{z}, xmm, m128/m64bcstwith a mask, zeroing | ymm {k}{z}, ymm, m256/m64bcstno mask, broadcast | ymm {k}{z}, ymm, m256/m64bcstwith a mask, zeroing | zmm {k}{z}, zmm, zmmno mask | zmm {k}{z}, zmm, zmmwith a mask, zeroing | zmm {k}{z}, zmm, m512/m64bcstno mask, broadcast | zmm {k}{z}, zmm, m512/m64bcstwith a mask, zeroing |
|---|---|---|---|---|---|---|---|---|---|---|
| Ice Lake | 1 / 0.5p01 | 1 / 0.5p01 | 7 / 0.5p01 | 7 / 0.5p01 | 8 / 0.5p01 | 8 / 0.5p01 | 1 / 1p0 | 1 / 1p0 | 8 / 1p0 | 8 / 1p0 |
| Sapphire Rapids | 3 / 1p5 | 5 / 1p5 | 10 / 1p5 | 13 / 1p5 | 11 / 1p5 | 13 / 1p5 | 3 / 1p5 | 5 / 1p5 | 11 / 1p5 | 13 / 1p5 |
| Zen 4 | 1 / 0.251FP0 FP1 FP2 FP3 | 1 / 0.251FP0 FP1 FP2 FP3 | 8 / 0.5FP0 FP1 FP2 FP3 | 8 / 0.5FP0 FP1 FP2 FP3 | 8 / 0.5FP0 FP1 FP2 FP3 | 8 / 0.5FP0 FP1 FP2 FP3 | 1 / 0.52FP0 FP1 FP2 FP3 | 1 / 0.52FP0 FP1 FP2 FP3 | 8 / 0.5FP0 FP1 FP2 FP3 | 8 / 0.5FP0 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 control bytes in zmm2 (element 0 on the right), as numbers. Shown for quadword 0 of zmm3 and zmm2, with a tick between bits; every quadword works alike, its bytes picking from it. Each bar is the 8 bits a byte takes; one that runs past bit 63 goes on from bit 0. The forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}. With m64bcst, one quadword from memory stands for every element of zmm3.
With the example control bytes, result byte i is bits c+7 to c of quadword 0 of zmm3, modulo 64, c being its control byte. Result bytes 7 to 0: 3:60, unchanged (bit 6 of k1 is 0), 47:40, 31:24, 41:34, 26:19, 15:8, 11:4.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
for i in range(VL // 8): # byte i, of quadword i // 8
x = src3.q[i // 8]
c = zmm2.b[i] & 63 # the bit it starts at
if k1[i]: # 1 without a write mask
zmm1.b[i] = ror(x, c, 64) & 0xFF
elif zeroing:
zmm1.b[i] = 0
# else: zmm1.b[i] keeps its value
# src3 is read whatever the mask: a fault in it is not suppressed
# m64bcst: src3.q[i] is the m64 for every i
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 14 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VPMULTISHIFTQB xmm {k}{z}, xmm, xmm/m128/m64bcst VPMULTISHIFTQB ymm {k}{z}, ymm, ymm/m256/m64bcst VPMULTISHIFTQB zmm {k}{z}, zmm, zmm/m512/m64bcst | ||
xmm, ymm, zmm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm, ymm, zmm | explicit | read |
xmm/m128/m64bcst, ymm/m256/m64bcst, zmm/m512/m64bcst | 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
- Memory forms
- embedded broadcast (tuple Full)
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VPMULTISHIFTQB, 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_multishift_epi64_epi8
__m128i _mm_multishift_epi64_epi8(__m128i __X, __m128i __Y) |
|
_mm_mask_multishift_epi64_epi8
__m128i _mm_mask_multishift_epi64_epi8(__m128i __W, __mmask16 __M, __m128i __X, __m128i __Y) |
|
_mm_maskz_multishift_epi64_epi8
__m128i _mm_maskz_multishift_epi64_epi8(__mmask16 __M, __m128i __X, __m128i __Y) |
|
_mm256_multishift_epi64_epi8
__m256i _mm256_multishift_epi64_epi8(__m256i __X, __m256i __Y) |
|
_mm256_mask_multishift_epi64_epi8
__m256i _mm256_mask_multishift_epi64_epi8(__m256i __W, __mmask32 __M, __m256i __X, __m256i __Y) |
|
_mm256_maskz_multishift_epi64_epi8
__m256i _mm256_maskz_multishift_epi64_epi8(__mmask32 __M, __m256i __X, __m256i __Y) |
|
_mm512_multishift_epi64_epi8
__m512i _mm512_multishift_epi64_epi8(__m512i __X, __m512i __Y) |
|
_mm512_mask_multishift_epi64_epi8
__m512i _mm512_mask_multishift_epi64_epi8(__m512i __W, __mmask64 __M, __m512i __X, __m512i __Y) |
|
_mm512_maskz_multishift_epi64_epi8
__m512i _mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y) |
|
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 |
|---|---|---|
AVX512_VBMI_128 | AVX10.1 or AVX512VBMI + AVX512VL | Cannon Lake, Ice Lake (client), Tiger Lake, Nova Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Zen 4, Zen 5, Zen 6 |
AVX512_VBMI_256 | Same as AVX512_VBMI_128 | Same as AVX512_VBMI_128 |
AVX512_VBMI_512 | AVX10.1 or AVX512VBMI | Same as AVX512_VBMI_128 |
More AVX10.1 instructions
- VPMOVUSDW
- VPMOVUSQB
- VPMOVUSQD
- VPMOVUSQW
- VPMOVUSWB
- VPMOVW2M
- VPMOVWB
- VPMOVZXBD
- VPMOVZXBQ
- VPMOVZXBW
- VPMOVZXDQ
- VPMOVZXWD
- VPMOVZXWQ
- VPMULDQ
- VPMULHRSW
- VPMULHUW
- VPMULHW
- VPMULLD
- VPMULLQ
- VPMULLW
- VPMULUDQ
- VPOPCNTB
- VPOPCNTD
- VPOPCNTQ
- VPOPCNTW
- VPORD
- VPORQ
- VPROLD
- VPROLQ
- VPROLVD
- VPROLVQ
- VPRORD
- VPRORQ
- VPRORVD
- VPRORVQ
- VPSADBW
- VPSCATTERDD
- VPSCATTERDQ
- VPSCATTERQD
- VPSCATTERQQ
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-604 (VPMULTISHIFTQB)
- Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)
- 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.