Instruction
VPCLMULQDQ
Carry-less multiplies one quadword of each source, chosen by an immediate, into a 128-bit product in each 128-bit lane.
- Extensions
- Forms
- 10 (4 VEX, 6 EVEX)
- Data
- Intel XED v2026.08.23
VPCLMULQDQ is the VEX and EVEX form of PCLMULQDQ, the carry-less multiplication of two quadwords into a 128-bit product. That page explains the arithmetic, the immediate and the uses in GHASH and CRCs. The wider forms repeat the operation in every 128-bit lane: lane i multiplies a quadword of lane i of the first source by one of lane i of the second, chosen by bits 0 and 4 of the same immediate for all lanes, and writes its own 128-bit product. A 512-bit VPCLMULQDQ therefore computes four independent products, the “up to 4x” that Intel’s optimization manual expects for GHASH (Section 19.2).
One name, two feature bits
| Form | Needs |
|---|---|
| VEX.128 | AVX and PCLMULQDQ (CPUID leaf 1, ECX bit 1) |
| VEX.256 | AVX and VPCLMULQDQ (CPUID leaf 7, ECX bit 10) |
| EVEX | AVX-512F and VPCLMULQDQ, with AVX512VL for 128 and 256 bits |
The 128-bit VEX form predates the VPCLMULQDQ feature bit and is detected like the VEX-encoded AES instructions, from the PCLMULQDQ bit and the AVX checks (Intel’s optimization manual, Section 5.1.10). Checking only the VPCLMULQDQ bit for it would refuse processors that run it. The EVEX forms take no write mask and no broadcast.
The compilers follow the same split. At -O2, GCC 14 and Clang 23 emit
the 128-bit form for _mm_clmulepi64_si128 with -mavx -mpclmul, but
-march=x86-64-v3 and -march=x86-64-v4 include neither VPCLMULQDQ nor
PCLMULQDQ: _mm256_clmulepi64_epi128 needs -mvpclmulqdq on top, and
_mm512_clmulepi64_epi128 that and AVX-512F. -march=znver4 and later
enable all of them.
Recorded on Zen 5
The cases recorded on Zen 5 run every form. With immediate EEh, whose bits 0 and 4 are clear, the low quadwords were chosen and the other bits ignored; all ones squared gave 5555…5555h, the bits spread to the even positions, as squaring does without carries. A 512-bit case with immediate 13h multiplied the high quadwords of each lane separately: 1 times 1 in one lane gave 1, and 8 times 8 in the next gave 40h.
AMD’s Zen 5 guide lists VPCLMULQDQ as four macro-ops with a latency of four cycles and one instruction every two cycles at every width, the same as the legacy form, so the wider forms do more products in the same time.
In the optimization guide
What the optimization guide says about VPCLMULQDQ, a line per claim. Each links to the claim in the guide, with its sources and where they differ.
Ice Lake to Rocket Lake
- Vectors and AVX-512: VPCLMULQDQ does four carry-less multiplications at once in a 512-bit register, up to four times the rate of PCLMULQDQ, for the GHASH of AES-GCM.
Forms
| Instruction | Encoding | Requires |
|---|---|---|
VPCLMULQDQ xmm, xmm, xmm, imm8
VPCLMULQDQ_XMMdq_XMMdq_XMMdq_IMMb | VEX.128.66.0F3A.WIG 44 /r ib | AVX |
VPCLMULQDQ xmm, xmm, m128, imm8
VPCLMULQDQ_XMMdq_XMMdq_MEMdq_IMMb | VEX.128.66.0F3A.WIG 44 /r ib | AVX |
VPCLMULQDQ ymm, ymm, ymm, imm8
VPCLMULQDQ_YMMu128_YMMu64_YMMu64_IMM8 | VEX.256.66.0F3A.WIG 44 /r ib | VPCLMULQDQ |
VPCLMULQDQ ymm, ymm, m256, imm8
VPCLMULQDQ_YMMu128_YMMu64_MEMu64_IMM8 | VEX.256.66.0F3A.WIG 44 /r ib | VPCLMULQDQ |
VPCLMULQDQ xmm, xmm, xmm, imm8
VPCLMULQDQ_XMMu128_XMMu64_XMMu64_IMM8_AVX512 | EVEX.128.66.0F3A.WIG 44 /r ib | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F + AVX512VL |
VPCLMULQDQ xmm, xmm, m128, imm8
VPCLMULQDQ_XMMu128_XMMu64_MEMu64_IMM8_AVX512 | EVEX.128.66.0F3A.WIG 44 /r ib | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F + AVX512VL |
VPCLMULQDQ ymm, ymm, ymm, imm8
VPCLMULQDQ_YMMu128_YMMu64_YMMu64_IMM8_AVX512 | EVEX.256.66.0F3A.WIG 44 /r ib | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F + AVX512VL |
VPCLMULQDQ ymm, ymm, m256, imm8
VPCLMULQDQ_YMMu128_YMMu64_MEMu64_IMM8_AVX512 | EVEX.256.66.0F3A.WIG 44 /r ib | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F + AVX512VL |
VPCLMULQDQ zmm, zmm, zmm, imm8
VPCLMULQDQ_ZMMu128_ZMMu64_ZMMu64_IMM8_AVX512 | EVEX.512.66.0F3A.WIG 44 /r ib | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F |
VPCLMULQDQ zmm, zmm, m512, imm8
VPCLMULQDQ_ZMMu128_ZMMu64_MEMu64_IMM8_AVX512 | EVEX.512.66.0F3A.WIG 44 /r ib | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F |
Latency and throughput
| Model | xmm, xmm, xmm, imm8ymm, ymm, ymm, imm8zmm, zmm, zmm, imm8 | xmm, xmm, m128, imm8 | ymm, ymm, m256, imm8zmm, zmm, m512, imm8 |
|---|---|---|---|
| Sandy Bridge | 14 / 6p015 | 20 / 5.67p015 | |
| Haswell | 11 / 2p05 | 17 / 2p05 | |
| Broadwell | 5 / 1p0 | 10 / 1p0 | |
| Skylake, Skylake-SP | 6 / 1p5 | 12 / 1p5 | |
| Ice Lake | 6 / 1p5 | 12 / 1p5 | 12 / 1p5 |
| Alder Lake, Sapphire Rapids | 3 / 1p5 | 10 / 1p5 | 11 / 1p5 |
| Lunar Lake | 3 / 0.5V2 V3 | 10 / 0.5V2 V3 | 10 / 2.33V2 V3 |
| Piledriver | 12 / 7FPMMA FPU0 | 17 / 7FPMMA FPU0 | |
| Zen, Zen 2 | 100 / 0.25 | 100 / 0.25 | |
| Zen 3 | 4 / 2FP0 FP1 | 11 / 2FP0 FP1 | 11 / 2FP0 FP1 |
| Zen 4 | 4 / 1.51FP0 FP1 | 11 / 1.5FP0 FP1 | 11 / 1.5FP0 FP1 |
| Jaguar | 2 / 1FPU0 VIMUL | 7 / 1FPU0 VIMUL |
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 = 0x10 (0001 0000 in binary). The ymm and zmm forms repeat this in each 128-bit lane, with the same imm8.
With imm8 = 0x10, the result is the carry-less product of quadword 0 of xmm2 and quadword 1 of xmm3: clmul(a0,b1).
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 // 128):
x = zmm2.q[2 * i + (imm8 & 1)]
y = src3.q[2 * i + (imm8 >> 4 & 1)]
zmm1.dq[i] = clmul(x, y)
# zmm1 is zeroed from bit VL upRun on AMD Zen 5 (EPYC 9645): 10 cases.
Operands
| Operand | Kind | Action |
|---|---|---|
VPCLMULQDQ xmm, xmm, xmm/m128, imm8 VPCLMULQDQ ymm, ymm, ymm/m256, imm8 VPCLMULQDQ zmm, zmm, zmm/m512, imm8 | ||
xmm, ymm, zmm | explicit | write |
xmm, ymm, zmm | explicit | read |
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-4- EVEX forms
AVX512-E4
Intrinsics
The C intrinsics of Clang 23.1.2 that compile to VPCLMULQDQ, 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_clmulepi64_si128
__m128i _mm_clmulepi64_si128(__m128i X, __m128i Y, const char I) |
|
_mm256_clmulepi64_epi128
__m256i _mm256_clmulepi64_epi128(__m256i A, __m256i B, const char I) |
|
_mm512_clmulepi64_epi128
__m512i _mm512_clmulepi64_epi128(__m512i A, __m512i B, const char I) |
|
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 |
|---|---|---|
AVX | AVX | Sandy Bridge, Ivy Bridge, 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, Bulldozer, Piledriver, Zen, Zen+, Zen 2, Zen 3, Zen 4, Zen 5, Zen 6 |
VPCLMULQDQ | VPCLMULQDQ XED and Intel’s SDM differ: XED asks for the VPCLMULQDQ bit, Sources: Intel XED v2026.08.23, datafiles/gfni-vaes-vpcl/cpuid-sse.xed.txt; Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026), PCLMULQDQ: the opcode table, page 4-242. | Ice Lake (client), Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Ice Lake (server), Sapphire Rapids, Emerald Rapids, Granite Rapids, Diamond Rapids, Sierra Forest, Clearwater Forest, Zen 3, Zen 4, Zen 5, Zen 6 |
AVX512_VPCLMULQDQ_128 | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F + AVX512VL XED and Intel’s SDM differ: XED also asks for the PCLMULQDQ bit, Sources: Intel XED v2026.08.23, datafiles/gfni-vaes-vpcl/cpuid-evex.xed.txt; Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026), PCLMULQDQ: the opcode table, page 4-242. | 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_VPCLMULQDQ_256 | Same as AVX512_VPCLMULQDQ_128XED and Intel’s SDM differ: see the note on | Same as AVX512_VPCLMULQDQ_128 |
AVX512_VPCLMULQDQ_512 | AVX10.1 + VPCLMULQDQ or VPCLMULQDQ + PCLMULQDQ + AVX512F XED and Intel’s SDM differ: see the note on | Same as AVX512_VPCLMULQDQ_128 |
More AVX instructions
- VPABSW
- VPACKSSDW
- VPACKSSWB
- VPACKUSDW
- VPACKUSWB
- VPADDB
- VPADDD
- VPADDQ
- VPADDSB
- VPADDSW
- VPADDUSB
- VPADDUSW
- VPADDW
- VPALIGNR
- VPAND
- VPANDN
- VPAVGB
- VPAVGW
- VPBLENDVB
- VPBLENDW
- VPCMPEQB
- VPCMPEQD
- VPCMPEQQ
- VPCMPEQW
- VPCMPESTRI
- VPCMPESTRM
- VPCMPGTB
- VPCMPGTD
- VPCMPGTQ
- VPCMPGTW
- VPCMPISTRI
- VPCMPISTRM
- VPERM2F128
- VPERMILPD
- VPERMILPS
- VPEXTRB
- VPEXTRD
- VPEXTRQ
- VPEXTRW
- VPHADDD
More AVX10.1 instructions
- VPADDUSB
- VPADDUSW
- VPADDW
- VPALIGNR
- VPANDD
- VPANDND
- VPANDNQ
- VPANDQ
- VPAVGB
- VPAVGW
- VPBLENDMB
- VPBLENDMD
- VPBLENDMQ
- VPBLENDMW
- VPBROADCASTB
- VPBROADCASTD
- VPBROADCASTMB2Q
- VPBROADCASTMW2D
- VPBROADCASTQ
- VPBROADCASTW
- VPCMPB
- VPCMPD
- VPCMPEQB
- VPCMPEQD
- VPCMPEQQ
- VPCMPEQW
- VPCMPGTB
- VPCMPGTD
- VPCMPGTQ
- VPCMPGTW
- VPCMPQ
- VPCMPUB
- VPCMPUD
- VPCMPUQ
- VPCMPUW
- VPCMPW
- VPCOMPRESSB
- VPCOMPRESSD
- VPCOMPRESSQ
- VPCOMPRESSW
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-242 (PCLMULQDQ)
- 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)
- 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.