Extensions
Forms
1 (1 Legacy)
Data
Intel XED v2026.08.23

Forms

Every encoding of ENCODEKEY256 that Intel XED knows, one row per XED instruction form (iform). How to read the notation.
InstructionEncodingRequires
ENCODEKEY256 r32, r32 ENCODEKEY256_GPR32u8_GPR32u8F3 0F 38 FB /rKL + KLENABLED

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.
Modelr32, r32
Alder Lake100 / 0.25p0156

Operation

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

if not cr4 >> 19 & 1:            # CR4.KL; clear without Key Locker
    fault(UD)
if not cpuid_leaf(0x19, 0)[1] & 1:
    fault(UD)                    # AESKLE: the AES instructions of
                                 # Key Locker not enabled
if cr0 >> 2 & 1 or not cr4 >> 9 & 1:
    fault(UD)                    # CR0.EM set, CR4.OSFXSR clear
if cr0 >> 3 & 1:
    fault(NM)                    # CR0.TS
r = src.read()                   # restrictions, as ENCODEKEY128's
can = cpuid_leaf(0x19, 0)[0] & 7
if r & ~can:
    fault(GP, 0)
meta = r | 1 << 24               # key type 1, AES-256
h = wrap_key(xmm[1] << 128 | xmm[0], meta)
                                 # the key in XMM1:XMM0
dest.write(iwkey >> 384 & 0x1F)  # NoBackup in bit 0, KeySource 4:1
xmm[0] = meta                    # the handle: the metadata,
xmm[1] = low(h, 128)             # the integrity tag,
xmm[2] = low(h >> 128, 128)      # the encrypted key, low half
xmm[3] = h >> 256                # and high
xmm[4] = 0
xmm[5] = 0
xmm[6] = 0
of = sf = zf = af = pf = cf = 0

Run on AMD Zen 5 (EPYC 9645): 2 cases. Its cases ran where CPUID reported no Key Locker, 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
ENCODEKEY256 r32, r32
r32explicitwrite
r32explicitread
XMM0implicitread, write
XMM1implicitread, write
XMM2implicitwrite
XMM3implicitwrite
XMM4implicitwrite
XMM5implicitwrite
XMM6implicitwrite
RFLAGSimplicitwrite

Flags

0 cleared; blank: not affected. How to read.
OFSFZFAFPFCF
All forms
000000

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
KEYLOCKER

KL + KLENABLED
CPUID.(EAX=07H,ECX=0):ECX[23] KL
CPUID.(EAX=19H,ECX=0):EBX[0] KLENABLED

Tiger Lake, Alder Lake, Arrow Lake, Panther Lake, Nova Lake, Sierra Forest, Clearwater Forest

More Key Locker 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. LLVM 23.1.2's x86 scheduling models (commit 85ac56026243): the latency, reciprocal throughput and ports of each form, as llvm-mca reports them.
  3. Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 2 (325383-093, September 2026): Volume 2A, page 3-285 (ENCODEKEY256)

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 timings come from LLVM's scheduling models, part of the LLVM Project, licensed under the Apache License 2.0 with LLVM Exceptions. The text is our own.