Instruction
VPSRLD
Shifts doublewords right logically by one count from a register or an immediate.
VPSRLD shifts each doubleword right by one shared count, filling with
zeros: the VEX and EVEX form of PSRLD, with the
operands, widths, masking and broadcast that
VPSLLD’s page describes. The count is still read
whole, from an immediate or the low quadword of an XMM register or of
memory, and anything above 31 clears the element. Zen 5’s recorded
cases show it: vpsrld xmm8, xmm15, xmm0, whose count quadword was
0000000100000001h, cleared every element, where its low doubleword
alone would have meant a shift by 1; vpsrld ymm4, ymm4, 0x3f cleared
all eight; and vpsrld zmm17{k3}, dword bcst [mem], 0x1f turned the
broadcast FFFFFFFFh into 1 in the ten elements k3 selects, keeping the
other six. The XMM cases zeroed bits 511:128 of the destination.
In compiled code
In our builds at -O2 with -march=x86-64-v3, over uint32_t arrays:
- Unsigned to float. AVX2 still converts only signed doublewords.
For
(float)b[i], GCC 14 splits each element with a VPAND of FFFFh and VPSRLD by 16, converts both halves with VCVTDQ2PS and joins them in one VFMADD132PS by 65536.0. With-march=x86-64-v4, GCC 14 and Clang 23 use AVX-512’s VCVTUDQ2PS instead. - Narrowing. Storing
b[i] >> 16asuint16_tis VPSRLD and VPACKUSDW in both, which packs within each 128-bit lane, so GCC reorders the quadwords with VPERMQ and Clang packs the two halves after VEXTRACTI128. At-v4, Clang stores the shifted words with VPMOVDW, and GCC gathers them with VPERMT2W. - A count in a variable.
b[i] >> nmoves n in with VMOVD for VPSRLD in GCC; Clang broadcasts it for VPSRLVD.
AMD’s latency spreadsheet for Zen 5 gives the EVEX immediate form one cycle on pipes FP2 and FP3 and the count from a register two cycles on FP0 and FP1, the figure its one row for the VEX forms gives them all.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VPSRLD xmm, xmm, m128
VPSRLD_XMMdq_XMMdq_MEMdq | VEX.128.66.0F.WIG D2 /r | AVX |
VPSRLD xmm, xmm, xmm
VPSRLD_XMMdq_XMMdq_XMMdq | VEX.128.66.0F.WIG D2 /r | AVX |
VPSRLD xmm, xmm, imm8
VPSRLD_XMMdq_XMMdq_IMMb | VEX.128.66.0F.WIG 72 /2 ib | AVX |
VPSRLD ymm, ymm, m128
VPSRLD_YMMqq_YMMqq_MEMdq | VEX.256.66.0F.WIG D2 /r | AVX2 |
VPSRLD ymm, ymm, xmm
VPSRLD_YMMqq_YMMqq_XMMq | VEX.256.66.0F.WIG D2 /r | AVX2 |
VPSRLD ymm, ymm, imm8
VPSRLD_YMMqq_YMMqq_IMMb | VEX.256.66.0F.WIG 72 /2 ib | AVX2 |
VPSRLD zmm {k}{z}, zmm, xmm
VPSRLD_ZMMu32_MASKmskw_ZMMu32_XMMu32_AVX512 | EVEX.512.66.0F.W0 D2 /r | AVX10.1 or AVX512F |
VPSRLD zmm {k}{z}, zmm, m128
VPSRLD_ZMMu32_MASKmskw_ZMMu32_MEMu32_AVX512 | EVEX.512.66.0F.W0 D2 /r | AVX10.1 or AVX512F |
VPSRLD zmm {k}{z}, zmm, imm8
VPSRLD_ZMMu32_MASKmskw_ZMMu32_IMM8_AVX512 | EVEX.512.66.0F.W0 72 /2 ib | AVX10.1 or AVX512F |
VPSRLD zmm {k}{z}, m512/m32bcst, imm8
VPSRLD_ZMMu32_MASKmskw_MEMu32_IMM8_AVX512 | EVEX.512.66.0F.W0 72 /2 ib | AVX10.1 or AVX512F |
VPSRLD xmm {k}{z}, xmm, imm8
VPSRLD_XMMu32_MASKmskw_XMMu32_IMM8_AVX512 | EVEX.128.66.0F.W0 72 /2 ib | AVX10.1 or AVX512F + AVX512VL |
VPSRLD xmm {k}{z}, m128/m32bcst, imm8
VPSRLD_XMMu32_MASKmskw_MEMu32_IMM8_AVX512 | EVEX.128.66.0F.W0 72 /2 ib | AVX10.1 or AVX512F + AVX512VL |
VPSRLD xmm {k}{z}, xmm, xmm
VPSRLD_XMMu32_MASKmskw_XMMu32_XMMu32_AVX512 | EVEX.128.66.0F.W0 D2 /r | AVX10.1 or AVX512F + AVX512VL |
VPSRLD xmm {k}{z}, xmm, m128
VPSRLD_XMMu32_MASKmskw_XMMu32_MEMu32_AVX512 | EVEX.128.66.0F.W0 D2 /r | AVX10.1 or AVX512F + AVX512VL |
VPSRLD ymm {k}{z}, ymm, imm8
VPSRLD_YMMu32_MASKmskw_YMMu32_IMM8_AVX512 | EVEX.256.66.0F.W0 72 /2 ib | AVX10.1 or AVX512F + AVX512VL |
VPSRLD ymm {k}{z}, m256/m32bcst, imm8
VPSRLD_YMMu32_MASKmskw_MEMu32_IMM8_AVX512 | EVEX.256.66.0F.W0 72 /2 ib | AVX10.1 or AVX512F + AVX512VL |
VPSRLD ymm {k}{z}, ymm, xmm
VPSRLD_YMMu32_MASKmskw_YMMu32_XMMu32_AVX512 | EVEX.256.66.0F.W0 D2 /r | AVX10.1 or AVX512F + AVX512VL |
VPSRLD ymm {k}{z}, ymm, m128
VPSRLD_YMMu32_MASKmskw_YMMu32_MEMu32_AVX512 | EVEX.256.66.0F.W0 D2 /r | AVX10.1 or AVX512F + AVX512VL |
Latency and throughput
| Model | xmm, xmm, m128xmm {k}{z}, xmm, m128 | xmm, xmm, xmmxmm {k}{z}, xmm, xmm | xmm, xmm, imm8 | ymm, ymm, m128ymm {k}{z}, m256/m32bcst, imm8ymm {k}{z}, ymm, m128 | ymm, ymm, xmmymm {k}{z}, ymm, xmm | ymm, ymm, imm8 | zmm {k}{z}, zmm, xmm | zmm {k}{z}, zmm, m128zmm {k}{z}, m512/m32bcst, imm8 | zmm {k}{z}, zmm, imm8 | xmm {k}{z}, xmm, imm8ymm {k}{z}, ymm, imm8 | xmm {k}{z}, m128/m32bcst, imm8 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| Sandy Bridge | 8 / 1p015 | 2 / 1p015 | 1 / 1p0 | ||||||||
| Haswell | 8 / 1p0 | 2 / 1p05 | 1 / 1p0 | 8 / 1p0 | 4 / 1p05 | 1 / 1p0 | |||||
| Broadwell | 7 / 1p0 | 2 / 1p05 | 1 / 1p0 | 7 / 1p0 | 4 / 1p05 | 1 / 1p0 | |||||
| Skylake | 7 / 0.5p01 | 2 / 1p015 | 1 / 0.5p01 | 8 / 0.5p01 | 4 / 1p015 | 1 / 0.5p01 | |||||
| Skylake-SP | 7 / 0.5p01 | 2 / 1p015 | 1 / 0.5p01 | 8 / 0.5p01 | 4 / 1p015 | 1 / 0.5p01 | 4 / 1p05 | 8 / 1p0 | 1 / 1p0 | 1 / 0.5p01 | 7 / 0.5p01 |
| Ice Lake | 7 / 0.5p01 | 2 / 0.67p015 | 1 / 0.5p01 | 8 / 0.5p01 | 4 / 1p015 | 1 / 0.5p01 | 4 / 1p05 | 8 / 1p0 | 1 / 1p0 | 1 / 0.5p01 | 7 / 0.5p01 |
| Alder Lake | 8 / 0.5p01 | 2 / 0.67p015 | 1 / 0.5p01 | 9 / 0.5p01 | 4 / 1p015 | 1 / 0.5p01 | |||||
| Sapphire Rapids | 8 / 0.5p01 | 2 / 0.67p015 | 1 / 0.5p01 | 9 / 0.5p01 | 4 / 1p015 | 1 / 0.5p01 | 4 / 1p05 | 9 / 1p0 | 1 / 1p0 | 1 / 0.5p01 | 8 / 0.5p01 |
| Lunar Lake | 8 / 0.5V0 V1 | 2 / 0.5V0 V1 V2 V3 | 1 / 0.5V0 V1 | 9 / 2.33V0 V1 | 4 / 0.5V0 V1 V2 V3 | 1 / 0.5V0 V1 | |||||
| Piledriver | 8 / 1.5FPU1 FPXBR | 3 / 1FPU1 FPXBR | 2 / 1FPU1 FPXBR | ||||||||
| Zen | 8 / 1FPU2 | 1 / 1FPU2 | 1 / 1FPU2 | 8 / 2FPU2 | 1 / 2FPU2 | 1 / 2FPU2 | |||||
| Zen 2 | 8 / 1FPU2 | 1 / 1FPU2 | 1 / 1FPU2 | 8 / 1FPU2 | 1 / 1FPU2 | 1 / 1FPU2 | |||||
| Zen 3 | 8 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | 1 / 0.5FP1 FP2 | |||||
| Zen 4 | 9 / 1FP1 FP2 | 2 / 11FP0 FP1 | 1 / 0.5FP1 FP2 | 8 / 0.5FP1 FP2 | 2 / 12FP0 FP1 | 1 / 0.5FP1 FP2 | 2 / 1FP0 FP1 | 8 / 1FP1 FP2 | 1 / 0.5FP0 FP1 | 1 / 0.5FP0 FP1 | 8 / 0.5FP1 FP2 |
| Jaguar | 7 / 1FPU0 FPU1 VALU0 VALU1 | 2 / 0.5FPU0 FPU1 VALU0 VALU1 | 2 / 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.
VPSRLD xmm, xmm, xmm/m128 VPSRLD ymm, ymm, xmm/m128 VPSRLD xmm {k}{z}, xmm, xmm/m128 VPSRLD ymm {k}{z}, ymm, xmm/m128 VPSRLD zmm {k}{z}, zmm, xmm/m128Every doubleword works alike: 4, 8 and 16 doublewords in the xmm, ymm and zmm forms. The EVEX forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.
Result doubleword i comes from doubleword i of xmm2 and the count in xmm3. Result doublewords 3 to 0: r3, unchanged (bit 2 of k1 is 0), r1, r0.
VPSRLD xmm, xmm, imm8 VPSRLD ymm, ymm, imm8 VPSRLD xmm {k}{z}, xmm/m128/m32bcst, imm8 VPSRLD ymm {k}{z}, ymm/m256/m32bcst, imm8 VPSRLD zmm {k}{z}, zmm/m512/m32bcst, imm8Every doubleword works alike: 4, 8 and 16 doublewords in the xmm, ymm and zmm forms. The EVEX forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}. With m32bcst, one doubleword from memory stands for every element of the last source.
Result doubleword i comes from doubleword i of xmm2. Result doublewords 3 to 0: r3, unchanged (bit 2 of k1 is 0), r1, r0.
Operation
What the forms do, in pseudocode that our tests run against results recorded on real processors. How to read.
VPSRLD xmm, xmm, xmm/m128 VPSRLD ymm, ymm, xmm/m128 VPSRLD xmm {k}{z}, xmm, xmm/m128 VPSRLD ymm {k}{z}, ymm, xmm/m128 VPSRLD zmm {k}{z}, zmm, xmm/m128count = src3.q[0]
for i in range(VL // 32):
if k1[i]: # 1 without a write mask
zmm1.d[i] = zmm2.d[i] >> count
elif zeroing:
zmm1.d[i] = 0
# else: zmm1.d[i] keeps its value
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 10 cases.
VPSRLD xmm, xmm, imm8 VPSRLD ymm, ymm, imm8 VPSRLD xmm {k}{z}, xmm/m128/m32bcst, imm8 VPSRLD ymm {k}{z}, ymm/m256/m32bcst, imm8 VPSRLD zmm {k}{z}, zmm/m512/m32bcst, imm8for i in range(VL // 32):
if k1[i]: # 1 without a write mask
zmm1.d[i] = src2.d[i] >> imm8
elif zeroing:
zmm1.d[i] = 0
# else: zmm1.d[i] keeps its value
# m32bcst: src2.d[i] is the m32 for every i
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 8 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VPSRLD xmm, xmm, xmm/m128 VPSRLD ymm, ymm, xmm/m128 | ||
xmm, ymm | explicit | write |
xmm, ymm | explicit | read |
xmm/m128 | explicit | read |
VPSRLD xmm, xmm, imm8 VPSRLD ymm, ymm, imm8 | ||
xmm, ymm | explicit | write |
xmm, ymm | explicit | read |
imm8 | explicit | read |
VPSRLD xmm {k}{z}, xmm, xmm/m128 VPSRLD ymm {k}{z}, ymm, xmm/m128 VPSRLD zmm {k}{z}, zmm, xmm/m128 | ||
xmm, ymm, zmm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm, ymm, zmm | explicit | read |
xmm/m128 | explicit | read |
VPSRLD xmm {k}{z}, xmm/m128/m32bcst, imm8 VPSRLD ymm {k}{z}, ymm/m256/m32bcst, imm8 VPSRLD zmm {k}{z}, zmm/m512/m32bcst, imm8 | ||
xmm, ymm, zmm | explicit | write (masked) |
{k} | explicit | read (write mask) |
xmm/m128/m32bcst, ymm/m256/m32bcst, zmm/m512/m32bcst | 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.
VPSRLD xmm, xmm, xmm/m128VPSRLD xmm, xmm, imm8VPSRLD ymm, ymm, imm8avx-type-7VPSRLD ymm, ymm, xmm/m128avx-type-4VPSRLD xmm {k}{z}, xmm, xmm/m128VPSRLD ymm {k}{z}, ymm, xmm/m128VPSRLD zmm {k}{z}, zmm, xmm/m128AVX512-E4NFVPSRLD xmm {k}{z}, xmm/m128/m32bcst, imm8VPSRLD ymm {k}{z}, ymm/m256/m32bcst, imm8VPSRLD zmm {k}{z}, zmm/m512/m32bcst, imm8AVX512-E4
Attributes
What else XED records about the forms. How to read.
- EVEX forms
- write masking
VPSRLD xmm {k}{z}, m128/m32bcst, imm8VPSRLD ymm {k}{z}, m256/m32bcst, imm8VPSRLD zmm {k}{z}, m512/m32bcst, imm8- embedded broadcast (tuple Full); memory fault suppression
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VPSRLD, 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_srl_epi32
__m128i _mm_srl_epi32(__m128i __a, __m128i __count) |
|
_mm_srli_epi32
__m128i _mm_srli_epi32(__m128i __a, int __count) |
|
_mm_mask_srl_epi32
__m128i _mm_mask_srl_epi32(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) |
|
_mm_mask_srli_epi32
__m128i _mm_mask_srli_epi32(__m128i __W, __mmask8 __U, __m128i __A, unsigned int __B) |
|
_mm_maskz_srl_epi32
__m128i _mm_maskz_srl_epi32(__mmask8 __U, __m128i __A, __m128i __B) |
|
_mm_maskz_srli_epi32
__m128i _mm_maskz_srli_epi32(__mmask8 __U, __m128i __A, unsigned int __B) |
|
_mm256_srl_epi32
__m256i _mm256_srl_epi32(__m256i __a, __m128i __count) |
|
_mm256_srli_epi32
__m256i _mm256_srli_epi32(__m256i __a, int __count) |
|
_mm256_mask_srl_epi32
__m256i _mm256_mask_srl_epi32(__m256i __W, __mmask8 __U, __m256i __A, __m128i __B) |
|
_mm256_mask_srli_epi32
__m256i _mm256_mask_srli_epi32(__m256i __W, __mmask8 __U, __m256i __A, unsigned int __B) |
|
_mm256_maskz_srl_epi32
__m256i _mm256_maskz_srl_epi32(__mmask8 __U, __m256i __A, __m128i __B) |
|
_mm256_maskz_srli_epi32
__m256i _mm256_maskz_srli_epi32(__mmask8 __U, __m256i __A, unsigned int __B) |
|
_mm512_srl_epi32
__m512i _mm512_srl_epi32(__m512i __A, __m128i __B) |
|
_mm512_srli_epi32
__m512i _mm512_srli_epi32(__m512i __A, unsigned int __B) |
|
_mm512_mask_srl_epi32
__m512i _mm512_mask_srl_epi32(__m512i __W, __mmask16 __U, __m512i __A, __m128i __B) |
|
_mm512_mask_srli_epi32
__m512i _mm512_mask_srli_epi32(__m512i __W, __mmask16 __U, __m512i __A, unsigned int __B) |
|
_mm512_maskz_srl_epi32
__m512i _mm512_maskz_srl_epi32(__mmask16 __U, __m512i __A, __m128i __B) |
|
_mm512_maskz_srli_epi32
__m512i _mm512_maskz_srli_epi32(__mmask16 __U, __m512i __A, unsigned int __B) |
|
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
- VPMULHUW
- VPMULHW
- VPMULLD
- VPMULLW
- VPMULUDQ
- VPOR
- VPSADBW
- VPSHUFB
- VPSHUFD
- VPSHUFHW
- VPSHUFLW
- VPSIGNB
- VPSIGND
- VPSIGNW
- VPSLLD
- VPSLLDQ
- VPSLLQ
- VPSLLW
- VPSRAD
- VPSRAW
- VPSRLDQ
- VPSRLQ
- VPSRLW
- VPSUBB
- VPSUBD
- VPSUBQ
- VPSUBSB
- VPSUBSW
- VPSUBUSB
- VPSUBUSW
- VPSUBW
- VPTEST
- VPUNPCKHBW
- VPUNPCKHDQ
- VPUNPCKHQDQ
- VPUNPCKHWD
- VPUNPCKLBW
- VPUNPCKLDQ
- VPUNPCKLQDQ
- VPUNPCKLWD
More AVX2 instructions
- VPMULLW
- VPMULUDQ
- VPOR
- VPSADBW
- VPSHUFB
- VPSHUFD
- VPSHUFHW
- VPSHUFLW
- VPSIGNB
- VPSIGND
- VPSIGNW
- VPSLLD
- VPSLLDQ
- VPSLLQ
- VPSLLVD
- VPSLLVQ
- VPSLLW
- VPSRAD
- VPSRAVD
- VPSRAW
- VPSRLDQ
- VPSRLQ
- VPSRLVD
- VPSRLVQ
- VPSRLW
- VPSUBB
- VPSUBD
- VPSUBQ
- VPSUBSB
- VPSUBSW
- VPSUBUSB
- VPSUBUSW
- VPSUBW
- VPUNPCKHBW
- VPUNPCKHDQ
- VPUNPCKHQDQ
- VPUNPCKHWD
- VPUNPCKLBW
- VPUNPCKLDQ
- VPUNPCKLQDQ
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-467 (PSRLW/
PSRLD/ PSRLQ) - 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.