Extensions
Forms
6 (6 VEX)
Data
Intel XED v2026.08.23

VPERMIL2PD fills each quadword of the destination with a quadword from one of two sources, or with zero, under the control of a selector in a third source: the double-precision form of VPERMIL2PS, whose page gives the operands and the M2Z table. Its opcode is 49h in VEX map 3, and it comes in XMM and YMM widths.

Selector bits

Each quadword of the selector uses four of its low bits: bit 1 picks the low or high quadword of the lane, bit 2 the source, and bit 3 is M. Bit 0 is ignored, like bits 63:4. So the index sits one bit higher than an element count suggests, as for VPERMILPD’s control vector, and an index of 1 written in bit 0 chooses nothing. Elements stay in their own 128-bit lane; AVX-512’s VPERMI2PD crosses lanes.

With two sources and a choice for each position, it covers what VSHUFPD cannot: VSHUFPD always takes the low element of each lane from its first source and the high one from its second.

In our builds

GCC 14 and Clang 23 at -O2 with -mxop compile _mm_permute2_pd(a, b, c, 0) to it. On four doubles, __builtin_shufflevector(a, b, 5, 0, 3, 6) takes Clang 23 one VPERMIL2PD with a selector from memory; the same shuffle through __builtin_shuffle takes GCC 14 two VBLENDPDs and a VSHUFPD.

AMD only

XOP came with AMD’s Bulldozer family and left with Zen (Zen 1 guide); CPUID.80000001H:ECX[11] reports it. Zen 5 clears that bit and raised #UD for all six recorded forms.

Forms

Every encoding of VPERMIL2PD that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
VPERMIL2PD xmm, xmm, m128, xmm, imm8 VPERMIL2PD_XMMdq_XMMdq_MEMdq_XMMdq_IMMbVEX.128.66.0F3A.W0 49 /r /is4XOP
VPERMIL2PD xmm, xmm, xmm, xmm, imm8 VPERMIL2PD_XMMdq_XMMdq_XMMdq_XMMdq_IMMbVEX.128.66.0F3A.W0 49 /r /is4
VEX.128.66.0F3A.W1 49 /r /is4
XOP
VPERMIL2PD ymm, ymm, m256, ymm, imm8 VPERMIL2PD_YMMqq_YMMqq_MEMqq_YMMqq_IMMbVEX.256.66.0F3A.W0 49 /r /is4XOP
VPERMIL2PD ymm, ymm, ymm, ymm, imm8 VPERMIL2PD_YMMqq_YMMqq_YMMqq_YMMqq_IMMbVEX.256.66.0F3A.W0 49 /r /is4
VEX.256.66.0F3A.W1 49 /r /is4
XOP
VPERMIL2PD xmm, xmm, xmm, m128, imm8 VPERMIL2PD_XMMdq_XMMdq_XMMdq_MEMdq_IMMbVEX.128.66.0F3A.W1 49 /r /is4XOP
VPERMIL2PD ymm, ymm, ymm, m256, imm8 VPERMIL2PD_YMMqq_YMMqq_YMMqq_MEMqq_IMMbVEX.256.66.0F3A.W1 49 /r /is4XOP

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.

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 from two sources within lanes: each double of the result is the double of its lane of ymm2 or, with bit 2 of its selector in ymm4 set, of ymm3 that bit 1 of the selector number; with imm8[1] set, it is zeroed where bit 3 of the selector differs from imm8[0].
VPERMIL2PD with example selectors and imm8 = 0x02With the example selectors and imm8 = 0x02, result doubles 3 to 0: b2, 0, a0, b1.61A4ymm4or m2560123ymm2ab1b2a00ymm10312ymm3or m256b

Example selectors in ymm4 (element 0 on the right, in hex); only bits 3:1 count. Example: imm8 = 0x02, M2Z = 10b: the elements whose selector has bit 3 set are zeroed. No processor here has XOP: the example was not run, but worked out by the pseudocode below. Shown for the ymm form; the xmm form works the same on 2 doubles.

With the example selectors and imm8 = 0x02, result doubles 3 to 0: b2, 0, a0, b1.

Operation

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

features = cpuid_leaf(0x80000001, 0)[2]
if not features >> 11 & 1:
    fault(UD)                    # CPUID: no XOP
for i in range(VL // 64):
    s = src4.q[i]                # the selector of element i
    j = i - i % 2 + (s >> 1 & 1)  # in the lane of element i
    a = ymm2.q[j]
    b = src3.q[j]
    x = b if s & 4 else a
    m = s >> 3 & 1               # M
    if imm8 & 2 and m != imm8 & 1:
        x = 0                    # M2Z
    ymm1.q[i] = x
# bit 0 of a selector is ignored
# ymm1 is zeroed from bit VL up

Run on AMD Zen 5 (EPYC 9645): 6 cases. Its cases ran where CPUID reported no XOP, and every one raised an exception.

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
VPERMIL2PD xmm, xmm, xmm/m128, xmm, imm8 VPERMIL2PD ymm, ymm, ymm/m256, ymm, imm8
xmm, ymmexplicitwrite
xmm, ymmexplicitread
xmm/m128, ymm/m256explicitread
xmm, ymmexplicitread
imm8explicitread
VPERMIL2PD xmm, xmm, xmm, m128, imm8 VPERMIL2PD ymm, ymm, ymm, m256, imm8
xmm, ymmexplicitwrite
xmm, ymmexplicitread
xmm, ymmexplicitread
m128/256explicitread
imm8explicitread

Flags

None: XED records no flag that the forms test or change.

Intrinsics

The C intrinsics of Clang 23.1.2 that compile to VPERMIL2PD, 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
_mm_permute2_pd __m128d _mm_permute2_pd(__m128d X, __m128d Y, __m128i C, const int I)

VPERMIL2PD xmm, xmm, xmm, xmm, imm8 VEX.128 -mxop

_mm256_permute2_pd __m256d _mm256_permute2_pd(__m256d X, __m256d Y, __m256i C, const int I)

VPERMIL2PD ymm, ymm, ymm, ymm, imm8 VEX.256 -mxop

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
XOP

XOP
CPUID.80000001H:ECX[11] XOP

Bulldozer, Piledriver

More XOP instructions

All 55 XOP 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. 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.
  3. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  4. AMD64 Architecture Programmer's Manual, Volume 4: 128-Bit, 256-Bit, and 512-Bit Media Instructions (26568, rev. 3.27, July 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.