Instruction
VPSRLDQ
Shifts each 128-bit lane right by a number of bytes given by an immediate.
VPSRLDQ shifts bytes right by an immediate count, filling with zeros: the VEX and EVEX form of PSRLDQ, whose page covers the byte shift and its uses. The new forms write a separate destination and clear it above the vector length; VEX.128 needs AVX, VEX.256 AVX2, and the EVEX forms AVX512BW (with AVX512VL below 512 bits, or AVX10.1), which add the 512-bit width and a source in memory at any alignment, without a write mask or a broadcast.
Each lane on its own
As for VPSLLDQ, each 128-bit lane shifts separately,
and the zeros come in at the top of every lane. On Zen 5, the recorded
vpsrldq ymm0, ymmword ptr [mem], 0xf brought byte 15 of each lane,
3Ah and EAh, down to its byte 0 and cleared the rest, and
vpsrldq zmm5, zmm5, 0x8 gave every lane its own high quadword in the
low half. Counts above 15 clear each lane: vpsrldq xmm7, xmm11, 0x10
and vpsrldq ymm8, ymm15, 0x80 cleared their whole ZMM destinations.
In compiled code
Since a ymm shift cannot bring the upper lane down, a reduction first
folds the halves with VEXTRACTI128 (or VEXTRACTI64X4 and VEXTRACTI32X4
from zmm), and only the last 128 bits go through VPSRLDQ. In our
builds at -O2 over fixed-size arrays, GCC 14 ends a sum of int32_t
with VPSRLDQ by 8 and by 4, each followed by VPADDD, and the maximum of
uint8_t with four steps, by 8, 4, 2 and 1 bytes, each followed by
VPMAXUB, with -march=x86-64-v3 and x86-64-v4
alike. Clang 23 avoids it there: it uses VPSHUFD for
the sums, and for the bytes it inverts them and finishes with
VPSRLW by 8, VPMINUB and
VPHMINPOSUW. _mm256_bsrli_epi128
compiles to it in both.
AMD’s latency spreadsheet for Zen 5 gives the VEX row and the EVEX row the same figures: one macro-op on pipes FP1 and FP2, a latency of 2 cycles and two per cycle.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VPSRLDQ xmm, xmm, imm8
VPSRLDQ_XMMdq_XMMdq_IMMb | VEX.128.66.0F.WIG 73 /3 ib | AVX |
VPSRLDQ ymm, ymm, imm8
VPSRLDQ_YMMqq_YMMqq_IMMb | VEX.256.66.0F.WIG 73 /3 ib | AVX2 |
VPSRLDQ xmm, xmm, imm8
VPSRLDQ_XMMu8_XMMu8_IMM8_AVX512 | EVEX.128.66.0F.WIG 73 /3 ib | AVX10.1 or AVX512BW + AVX512VL |
VPSRLDQ xmm, m128, imm8
VPSRLDQ_XMMu8_MEMu8_IMM8_AVX512 | EVEX.128.66.0F.WIG 73 /3 ib | AVX10.1 or AVX512BW + AVX512VL |
VPSRLDQ ymm, ymm, imm8
VPSRLDQ_YMMu8_YMMu8_IMM8_AVX512 | EVEX.256.66.0F.WIG 73 /3 ib | AVX10.1 or AVX512BW + AVX512VL |
VPSRLDQ ymm, m256, imm8
VPSRLDQ_YMMu8_MEMu8_IMM8_AVX512 | EVEX.256.66.0F.WIG 73 /3 ib | AVX10.1 or AVX512BW + AVX512VL |
VPSRLDQ zmm, zmm, imm8
VPSRLDQ_ZMMu8_ZMMu8_IMM8_AVX512 | EVEX.512.66.0F.WIG 73 /3 ib | AVX10.1 or AVX512BW |
VPSRLDQ zmm, m512, imm8
VPSRLDQ_ZMMu8_MEMu8_IMM8_AVX512 | EVEX.512.66.0F.WIG 73 /3 ib | AVX10.1 or AVX512BW |
Latency and throughput
| Model | xmm, xmm, imm8ymm, ymm, imm8 | ymm, ymm, imm8 | xmm, xmm, imm8 | xmm, m128, imm8 | ymm, m256, imm8 | zmm, zmm, imm8 | zmm, m512, imm8 |
|---|---|---|---|---|---|---|---|
| Sandy Bridge | 1 / 0.5p15 | ||||||
| Haswell, Broadwell, Skylake | 1 / 1p5 | 1 / 1p5 | |||||
| Skylake-SP | 1 / 1p5 | 1 / 1p5 | 1 / 1p5 | 7 / 1p5 | 8 / 1p5 | 1 / 1p5 | 8 / 1p5 |
| Ice Lake | 1 / 0.5p15 | 1 / 0.5p15 | 1 / 0.5p15 | 7 / 0.5p15 | 8 / 0.5p15 | 1 / 1p5 | 8 / 1p5 |
| Alder Lake | 1 / 0.5p15 | 1 / 0.5p15 | |||||
| Sapphire Rapids | 1 / 0.5p15 | 1 / 0.5p15 | 1 / 0.5p15 | 8 / 0.5p15 | 9 / 0.5p15 | 1 / 1p5 | 9 / 1p5 |
| Lunar Lake | 1 / 0.5V2 V3 | 1 / 0.5V2 V3 | |||||
| Piledriver | 2 / 1FPU1 FPXBR | ||||||
| Zen | 1 / 0.5FPU1 FPU2 | 1 / 1FPU1 FPU2 | |||||
| Zen 2 | 1 / 0.5FPU1 FPU2 | 1 / 0.5FPU1 FPU2 | |||||
| Zen 3 | 1 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | |||||
| Zen 4 | 2 / 11FP0 FP1 | 2 / 1FP0 FP1 | 1 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 2 / 1FP0 FP1 | 8 / 1FP1 FP2 |
| Jaguar | 1 / 0.5FPU0 FPU1 VALU0 VALU1 | ||||||
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 = 3. The ymm and zmm forms repeat this in each 128-bit lane.
With imm8 = 3, result bytes 15 to 0: 0, 0, 0, a15, a14, a13, a12, a11, a10, a9, a8, a7, a6, a5, a4, a3.
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):
if i % 16 + imm8 < 16:
zmm1.b[i] = src2.b[i + imm8]
else:
zmm1.b[i] = 0
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 8 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VPSRLDQ xmm, xmm/m128, imm8 VPSRLDQ ymm, ymm/m256, imm8 VPSRLDQ zmm, zmm/m512, imm8 | ||
xmm, ymm, zmm | explicit | write |
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.
- VEX forms
avx-type-7- EVEX forms
AVX512-E4NF
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VPSRLDQ, 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_bsrli_si128
__m128i _mm_bsrli_si128(__m128i a, const int imm) |
|
_mm_srli_si128
__m128i _mm_srli_si128(__m128i a, const int imm) |
|
_mm256_bsrli_epi128
__m256i _mm256_bsrli_epi128(__m256i a, const int imm) |
|
_mm256_srli_si256
__m256i _mm256_srli_si256(__m256i a, const int imm) |
|
_mm512_bsrli_epi128
__m512i _mm512_bsrli_epi128(__m512i a, 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.
More AVX instructions
- VPMULHW
- VPMULLD
- VPMULLW
- VPMULUDQ
- VPOR
- VPSADBW
- VPSHUFB
- VPSHUFD
- VPSHUFHW
- VPSHUFLW
- VPSIGNB
- VPSIGND
- VPSIGNW
- VPSLLD
- VPSLLDQ
- VPSLLQ
- VPSLLW
- VPSRAD
- VPSRAW
- VPSRLD
- VPSRLQ
- VPSRLW
- VPSUBB
- VPSUBD
- VPSUBQ
- VPSUBSB
- VPSUBSW
- VPSUBUSB
- VPSUBUSW
- VPSUBW
- VPTEST
- VPUNPCKHBW
- VPUNPCKHDQ
- VPUNPCKHQDQ
- VPUNPCKHWD
- VPUNPCKLBW
- VPUNPCKLDQ
- VPUNPCKLQDQ
- VPUNPCKLWD
- VPXOR
More AVX2 instructions
- VPMULUDQ
- VPOR
- VPSADBW
- VPSHUFB
- VPSHUFD
- VPSHUFHW
- VPSHUFLW
- VPSIGNB
- VPSIGND
- VPSIGNW
- VPSLLD
- VPSLLDQ
- VPSLLQ
- VPSLLVD
- VPSLLVQ
- VPSLLW
- VPSRAD
- VPSRAVD
- VPSRAW
- VPSRLD
- VPSRLQ
- VPSRLVD
- VPSRLVQ
- VPSRLW
- VPSUBB
- VPSUBD
- VPSUBQ
- VPSUBSB
- VPSUBSW
- VPSUBUSB
- VPSUBUSW
- VPSUBW
- VPUNPCKHBW
- VPUNPCKHDQ
- VPUNPCKHQDQ
- VPUNPCKHWD
- VPUNPCKLBW
- VPUNPCKLDQ
- VPUNPCKLQDQ
- VPUNPCKLWD
More AVX10.1 instructions
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 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2B, page 4-465 (PSRLDQ)
- Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 1 (253665-093, September 2026)
- Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 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.