Opcode | Encoding | 16-bit | 32-bit | 64-bit | CPUID Feature Flag(s) | Description |
---|---|---|---|---|---|---|
66 0F 3A DF /r ib AESKEYGENASSIST xmm1, xmm2/m128, imm8 | rmi | Invalid | Valid | Valid | aes | Assist in AES round key generation using an 8 bit round constant (RCON) specified in the immediate byte and 128 bits of data specified in xmm2/m128. Store the result in xmm1. |
VEX.128.66.0F3A.WIG DF /r ib VAESKEYGENASSIST xmm1, xmm2/m128, imm8 | rmi | Invalid | Valid | Valid | avx aes | Assist in AES round key generation using an 8 bit round constant (RCON) specified in the immediate byte and 128 bits of data specified in xmm2/m128. Store the result in xmm1. |
Encoding
Encoding | Operand 1 | Operand 2 | Operand 3 |
---|---|---|---|
rmi | ModRM.reg[w] | ModRM.r/m[r] | imm8 |
Description
The (V)AESKEYGENASSIST
instruction assists in expanding the AES cipher key using an 8 bit round constant (RCON) and 128 bits of data from the source operand. The result is stored in in the destination operand.
VEX.vvvv
is reserved and must be b1111
(0
inverted). Any other values will raise a #UD
exception. All forms except the legacy SSE one will zero the upper (untouched) bits.
Operation
public void AESKEYGENASSIST(SimdU32 dest, SimdU32 src, byte roundConstant)
{
U32 x0 = src[0];
U32 x1 = src[1];
U32 x2 = src[2];
U32 x3 = src[3];
U32 rcon = roundConstant;
dest[0] = SubWord(x1);
dest[1] = RotWord(SubWord(x1)) ^ rcon;
dest[2] = SubWord(x3);
dest[3] = RotWord(SubWord(x3)) ^ rcon;
// dest[4..] is unmodified
}
public void VAESKEYGENASSIST_Vex128(SimdU32 dest, SimdU32 src, byte roundConstant)
{
U32 x0 = src[0];
U32 x1 = src[1];
U32 x2 = src[2];
U32 x3 = src[3];
U32 rcon = roundConstant;
dest[0] = SubWord(x1);
dest[1] = RotWord(SubWord(x1)) ^ rcon;
dest[2] = SubWord(x3);
dest[3] = RotWord(SubWord(x3)) ^ rcon;
dest[4..] = 0;
}
Intrinsics
__m128i _mm_aeskeygenassist(__m128i data, const int roundConstant)
Exceptions
SIMD Floating-Point
None.Other Exceptions
VEX Encoded Form: See Type 4 Exception Conditions.
#UD
- If
VEX.vvvv
- is not
1111b
- .