AESENCLAST
Perform Last Round of an AES Encryption Flow
stableVMJITAOTinstruction
Encodings
| Opcode | Instruction | Op/En | 64-bit | Compat/Legacy | Description |
|---|---|---|---|---|---|
66 0F 38 DD /r | AESENCLAST xmm1, xmm2/m128 | A | Valid | Valid | Perform the last round of an AES encryption flow, using one 128-bit data (state) from xmm1 with one 128-bit round key from xmm2/m128. |
VEX.128.66.0F38.WIG DD /r | VAESENCLAST xmm1, xmm2, xmm3/m128 | B | Valid | Valid | Perform the last round of an AES encryption flow, AVX using one 128-bit data (state) from xmm2 with one 128-bit round key from xmm3/m128; store the result in xmm1. |
VEX.256.66.0F38.WIG DD /r | VAESENCLAST ymm1, ymm2, ymm3/m256 | B | Valid | Valid | Perform the last round of an AES encryption flow, using two 128-bit data (state) from ymm2 with two 128-bit round keys from ymm3/m256; store the result in ymm1. |
EVEX.128.66.0F38.WIG DD /r | VAESENCLAST xmm1, xmm2, xmm3/m128 | C | Valid | Valid | Perform the last round of an AES encryption flow, (AVX512VL OR AVX10.1) using one 128-bit data (state) from xmm2 with one 128-bit round key from xmm3/m128; store the result in xmm1. |
EVEX.256.66.0F38.WIG DD /r | VAESENCLAST ymm1, ymm2, ymm3/m256 | C | Valid | Valid | Perform the last round of an AES encryption flow, (AVX512VL OR AVX10.1) using two 128-bit data (state) from ymm2 with two 128-bit round keys from ymm3/m256; store the result in ymm1. |
EVEX.512.66.0F38.WIG DD /r | VAESENCLAST zmm1, zmm2, zmm3/m512 | C | Valid | Valid | Perform the last round of an AES encryption flow, (AVX512F OR AVX10.1) using four 128-bit data (state) from zmm2 with four 128-bit round keys from zmm3/m512; store the result in zmm1. |
Operand encoding
Each mode is a value of the Op/En column above. It says which field of the encoded instruction carries each operand, in the order they are written, and whether the instruction reads it, writes it or both.
A
modrm.reglectura y escrituraModRM byte, reg field (bits 5-3)modrm.rmlecturaModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them
B
modrm.regescrituraModRM byte, reg field (bits 5-3)vex.vvvvlecturaVEX prefix, vvvv field (inverted)modrm.rmlecturaModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them
C
modrm.regescrituraModRM byte, reg field (bits 5-3)evex.vvvvlecturaEVEX prefix, vvvv field (inverted)modrm.rmlecturaModRM byte, r/m field (bits 2-0); with the SIB byte and the displacement when the mod field asks for them
Tupla: Full Mem
Measured cost
Loading measurements from arch-data...
Description
This instruction performs the last round of an AES encryption flow using one/two/four (depending on vector length) 128-bit data (state) from the first source operand with one/two/four (depending on vector length) round key(s) from the second source operand, and stores the result in the destination operand.
VEX and EVEX encoded versions of the instruction allows 3-operand (non-destructive) operation. The legacy encoded versions of the instruction require that the first source operand and the destination operand are the same and must be an XMM register.
The EVEX encoded form of this instruction does not support memory fault suppression.
Operation
AESENCLAST
STATE := SRC1;
RoundKey := SRC2;
STATE := ShiftRows( STATE );
STATE := SubBytes( STATE );
DEST[127:0] := STATE XOR RoundKey;
DEST[MAXVL-1:128] (Unmodified)
VAESENCLAST (128b and 256b VEX Encoded Versions)
(KL, VL) = (1,128), (2,256)
FOR I=0 to KL-1:
STATE := SRC1.xmm[i]
RoundKey := SRC2.xmm[i]
STATE := ShiftRows( STATE )
STATE := SubBytes( STATE )
DEST.xmm[i] := STATE XOR RoundKey
DEST[MAXVL-1:VL] := 0
VAESENCLAST (EVEX Encoded Version)
(KL,VL) = (1,128), (2,256), (4,512)
FOR i = 0 to KL-1:
STATE := SRC1.xmm[i]
RoundKey := SRC2.xmm[i]
STATE := ShiftRows( STATE )
STATE := SubBytes( STATE )
DEST.xmm[i] := STATE XOR RoundKey
DEST[MAXVL-1:VL] := 0Intel C/C++ compiler intrinsics
(V)AESENCLAST __m128i _mm_aesenclast (__m128i, __m128i) VAESENCLAST __m256i _mm256_aesenclast_epi128(__m256i, __m256i);
VAESENCLAST __m512i _mm512_aesenclast_epi128(__m512i, __m512i);SIMD Floating-Point Exceptions
None.
Other Exceptions
See Table 2-21, "Type 4 Class Exception Conditions."
EVEX-encoded: See Table 2-52, "Type E4NF Class Exception Conditions."