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

VPERMD takes doublewords from anywhere in a vector: element i of the result is the element of the table operand that element i of the index operand numbers. AVX2 added it, with VPERMPS for singles, as a way to move doublewords freely across the two 128-bit halves of a YMM register, which VPSHUFD and VPSHUFB cannot do. Only the low three bits of each index count (four in the 512-bit form), so an index wraps around; unlike PSHUFB’s selectors, none writes zero. There is no 128-bit form; within one XMM register, VPERMILPS with an index vector or VPSHUFB does the job.

The order of the operands is a trap. In Intel’s syntax VPERMD ymm1, ymm2, ymm3/m256 takes the indices from ymm2 and the table from ymm3 or memory. The AVX2 intrinsic _mm256_permutevar8x32_epi32(table, indices) names them the other way round, while the AVX-512 intrinsics such as _mm512_permutexvar_epi32(indices, table) follow the instruction.

Typical uses:

  • Fixed lane-crossing rearrangements with a constant index vector: reversing eight elements, rotating them, or interleaving the halves of a register.
  • Left-packing. To keep only the elements that passed a comparison, code turns the comparison into an 8-bit mask, loads an index vector for that mask from a table of 256, and lets VPERMD move the chosen elements to the front. AVX-512 does this in one step with VPCOMPRESSD.
  • Two tables. VPERMI2D and VPERMT2D of AVX-512 choose from the doublewords of two registers; Intel’s optimization manual notes that the first overwrites the index register and the second the first table.

The EVEX forms add masking and registers 16 to 31. GCC 14 at -O2 emits VPERMD for both intrinsics, while Clang 23 chooses between VPERMD and VPERMPS by the instructions around it, so integer code compiled with Clang may show VPERMPS.

In the optimization guide

What the optimization guide says about VPERMD, a line per claim. Each links to the claim in the guide, with its sources and where they differ.

Vectors

  • Shuffles and lane crossing: Lane-crossing permutes such as VPERMD take longer than in-lane shuffles such as VPSHUFB, and LLVM treats them as slow on Zen. sources differ

Crestmont and Gracemont

Golden Cove and Raptor Cove

Ice Lake to Rocket Lake

  • Vectors and AVX-512: Ice Lake adds an in-lane shuffle unit on port 1, while lane-crossing shuffles such as VPERMD stay on port 5.

Skylake to Cooper Lake

  • Vectors on all parts: Shuffles and permutes run on port 5 only, one a cycle; those that move data between 128-bit lanes, such as VPERMD, take three cycles.

Zen 2

  • Vectors and floating point: AMD’s spreadsheet makes the AVX2 permutes that cross the 128-bit lanes, VPERMD, vpermps, vpermq and vpermpd, microcoded, while vperm2f128 is one macro-op of three cycles on pipe 2. sources differ

Forms

Every encoding of VPERMD that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
VPERMD ymm, ymm, m256 VPERMD_YMMqq_YMMqq_MEMqqVEX.256.66.0F38.W0 36 /rAVX2
VPERMD ymm, ymm, ymm VPERMD_YMMqq_YMMqq_YMMqqVEX.256.66.0F38.W0 36 /rAVX2
VPERMD zmm {k}{z}, zmm, zmm VPERMD_ZMMu32_MASKmskw_ZMMu32_ZMMu32_AVX512EVEX.512.66.0F38.W0 36 /rAVX10.1 or AVX512F
VPERMD zmm {k}{z}, zmm, m512/m32bcst VPERMD_ZMMu32_MASKmskw_ZMMu32_MEMu32_AVX512EVEX.512.66.0F38.W0 36 /rAVX10.1 or AVX512F
VPERMD ymm {k}{z}, ymm, ymm VPERMD_YMMu32_MASKmskw_YMMu32_YMMu32_AVX512EVEX.256.66.0F38.W0 36 /rAVX10.1 or AVX512F + AVX512VL
VPERMD ymm {k}{z}, ymm, m256/m32bcst VPERMD_YMMu32_MASKmskw_YMMu32_MEMu32_AVX512EVEX.256.66.0F38.W0 36 /rAVX10.1 or AVX512F + AVX512VL

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.
Modelymm, ymm, m256ymm, ymm, ymmzmm {k}{z}, zmm, zmmzmm {k}{z}, zmm, m512/m32bcst
ymm {k}{z}, ymm, m256/m32bcst
ymm {k}{z}, ymm, ymm
Haswell, Skylake10 / 1p53 / 1p5
Broadwell9 / 1p53 / 1p5
Skylake-SP, Ice Lake10 / 1p53 / 1p53 / 1p510 / 1p53 / 1p5
Alder Lake11 / 1p53 / 1p5
Sapphire Rapids11 / 1p53 / 1p53 / 1p511 / 1p53 / 1p5
Lunar Lake10 / 2.33V2 V33 / 0.5V2 V3
Zen9 / 1FPU1 FPU22 / 1FPU1 FPU2
Zen 29 / 0.5FPU1 FPU22 / 0.5FPU1 FPU2
Zen 312 / 2FP15 / 1FP1
Zen 411 / 1FP14 / 1FP15 / 1FP1 FP28 / 0.5FP1 FP24 / 11FP1 FP2
  1. Zen 4 model: AMD's spreadsheets give reciprocal throughput 0.5 for Zen 4 and Zen 5 (AMD 57647, row 2227; AMD 58455, row 569).

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.

Permute by index: each doubleword of the result is the doubleword of the table zmm3 that the index in the same place of zmm2 numbers, across the whole register.
VPERMD with an example index vectorWith the example indices, result doublewords 15 to 0: b8, unchanged (bit 14 of k1 is 0), b7, b10, b1, b5, b12, b5, b15, b2, b9, b6, b14, b0, b11, b3.0123567891011121314154zmm3or m512b1111111111111110k1b3b11b0b14b6b9b2b15b5b12b5b1b10b7b8zmm13110146921551251107138zmm2index

Example index vector in zmm2 (element 0 on the right); only its low 4 bits count. Shown for the zmm form; the ymm form works the same on 8 doublewords. The EVEX forms write under a mask: where its bit is 0, the element keeps its old value, or zeroes it with {z}.

With the example indices, result doublewords 15 to 0: b8, unchanged (bit 14 of k1 is 0), b7, b10, b1, b5, b12, b5, b15, b2, b9, b6, b14, b0, b11, b3.

Operation

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

n = VL // 32   # 8 in ymm, 16 in zmm
for i in range(n):
    if k1[i]:  # 1 without a write mask
        zmm1.d[i] = src3.d[zmm2.d[i] % n]
    elif zeroing:
        zmm1.d[i] = 0
    # else: zmm1.d[i] keeps its value
# m32bcst: src3.d[i] is the m32 for every i
# zmm1 is zeroed from bit VL up

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

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
VPERMD ymm, ymm, ymm/m256
ymmexplicitwrite
ymmexplicitread
ymm/m256explicitread
VPERMD ymm {k}{z}, ymm, ymm/m256/m32bcst VPERMD zmm {k}{z}, zmm, zmm/m512/m32bcst
ymm, zmmexplicitwrite (masked)
{k}explicitread (write mask)
ymm, zmmexplicitread
ymm/m256/m32bcst, zmm/m512/m32bcstexplicitread

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
EVEX memory forms
embedded broadcast (tuple Full)

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to VPERMD, 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
_mm256_permutevar8x32_epi32 __m256i _mm256_permutevar8x32_epi32(__m256i __a, __m256i __b)

VPERMD ymm, ymm, ymm VEX.256 -mavx2

_mm256_permutexvar_epi32 __m256i _mm256_permutexvar_epi32(__m256i A, __m256i B)

VPERMD ymm, ymm, ymm VEX.256 -mavx512vl

_mm256_mask_permutexvar_epi32 __m256i _mm256_mask_permutexvar_epi32(__m256i __W, __mmask8 __M, __m256i __X, __m256i __Y)

VPERMD ymm {k}, ymm, ymm EVEX.256 -mavx512vl

_mm256_maskz_permutexvar_epi32 __m256i _mm256_maskz_permutexvar_epi32(__mmask8 __M, __m256i __X, __m256i __Y)

VPERMD ymm {k}{z}, ymm, ymm EVEX.256 -mavx512vl

_mm512_permutexvar_epi32 __m512i _mm512_permutexvar_epi32(__m512i __X, __m512i __Y)

VPERMD zmm, zmm, zmm EVEX.512 -mavx512f

_mm512_mask_permutexvar_epi32 __m512i _mm512_mask_permutexvar_epi32(__m512i __W, __mmask16 __M, __m512i __X, __m512i __Y)

VPERMD zmm {k}, zmm, zmm EVEX.512 -mavx512f

_mm512_maskz_permutexvar_epi32 __m512i _mm512_maskz_permutexvar_epi32(__mmask16 __M, __m512i __X, __m512i __Y)

VPERMD zmm {k}{z}, zmm, zmm EVEX.512 -mavx512f

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.
ISA setCPUIDProcessors
AVX2

AVX2
CPUID.(EAX=07H,ECX=0):EBX[5] AVX2

Haswell, Broadwell, Skylake, Comet Lake, Cannon Lake, Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Skylake-SP, Cascade Lake, Cooper Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Sierra Forest, Clearwater Forest, Knights Landing, Knights Mill, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6
AVX512F_512

AVX10.1
CPUID.(EAX=07H,ECX=1):EDX[19] AVX10
CPUID.(EAX=24H,ECX=0):EBX[7:0] ≥ 1 AVX10 version

or

AVX512F
CPUID.(EAX=07H,ECX=0):EBX[16] AVX512F

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, Knights Landing, Knights Mill, Zen 4, Zen 5, Zen 6
AVX512F_256

AVX10.1
CPUID.(EAX=07H,ECX=1):EDX[19] AVX10
CPUID.(EAX=24H,ECX=0):EBX[7:0] ≥ 1 AVX10 version

or

AVX512F + AVX512VL
CPUID.(EAX=07H,ECX=0):EBX[16] AVX512F
CPUID.(EAX=07H,ECX=0):EBX[31] 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

More AVX2 instructions

All 138 AVX2 instructions

More AVX10.1 instructions

All 686 AVX10.1 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 2C, page 5-500 (VPERMD/VPERMW)
  6. Intel Advanced Vector Extensions 10.2 Architecture Specification, revision 7.0 (361050-007, April 2026)
  7. Intel 64 and IA-32 Architectures Optimization Reference Manual, Volume 1 (248966-051, October 2026)

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.