@@ -821,6 +821,11 @@ static const struct test movrs_all[] = {
INSN(movrsw, f2, map5, 6f, vl, w, vl),
};
+static const struct test sm4_all[] = {
+ INSN(sm4key4, f3, 0f38, da, vl, d_nb, vl),
+ INSN(sm4rnds4, f2, 0f38, da, vl, d_nb, vl),
+};
+
static const unsigned char vl_all[] = { VL_512, VL_128, VL_256 };
static const unsigned char vl_128[] = { VL_128 };
static const unsigned char vl_no128[] = { VL_512, VL_256 };
@@ -1246,6 +1251,7 @@ void evex_disp8_test(void *instr, struct
if ( cpu_has_avx10_2 )
{
run(ctxt->addr_size == 64 && cpu_has_movrs, movrs, all);
+ (void)sm4_all;//todo run(cpu_has_sm4, sm4, all);
}
#undef run
@@ -2046,6 +2046,8 @@ static const struct evex {
{ { 0xd3 }, 2, T, R, pfx_no, W0, Ln }, /* vpdpwuuds */
{ { 0xd3 }, 2, T, R, pfx_66, W0, Ln }, /* vpdpwusds */
{ { 0xd3 }, 2, T, R, pfx_f3, W0, Ln }, /* vpdpwsuds */
+ { { 0xda }, 2, T, R, pfx_f3, W0, Ln }, /* vsm4key4 */
+ { { 0xda }, 2, T, R, pfx_f2, W0, Ln }, /* vsm4rnds4 */
{ { 0xdc }, 2, T, R, pfx_66, WIG, Ln }, /* vaesenc */
{ { 0xdd }, 2, T, R, pfx_66, WIG, Ln }, /* vaesenclast */
{ { 0xde }, 2, T, R, pfx_66, WIG, Ln }, /* vaesdec */
@@ -439,7 +439,7 @@ static const struct ext0f38_table {
[0xd3] = { .simd_size = simd_other, .d8s = d8s_vl },
[0xd6] = { .simd_size = simd_other, .d8s = d8s_vl },
[0xd7] = { .simd_size = simd_scalar_vexw, .d8s = d8s_dq },
- [0xda] = { .simd_size = simd_other },
+ [0xda] = { .simd_size = simd_other, .d8s = d8s_vl },
[0xdb] = { .simd_size = simd_packed_int, .two_op = 1 },
[0xdc ... 0xdf] = { .simd_size = simd_packed_int, .d8s = d8s_vl },
[0xe0 ... 0xef] = { .to_mem = 1 },
@@ -6928,6 +6928,14 @@ x86_emulate(
op_bytes = 16 << vex.l;
goto simd_0f_ymm;
+ case X86EMUL_OPC_EVEX_F3(0x0f38, 0xda): /* vsm4key4 [xyz]mm/mem,[xyz]mm,[xyz]mm */
+ case X86EMUL_OPC_EVEX_F2(0x0f38, 0xda): /* vsm4rnds4 [xyz]mm/mem,[xyz]mm,[xyz]mm */
+ vcpu_must_have(avx10, 2);
+ host_and_vcpu_must_have(sm4);
+ generate_exception_if(evex.w || evex.brs || evex.opmsk, X86_EXC_UD);
+ op_bytes = 16 << evex.lr;
+ goto simd_zmm;
+
case X86EMUL_OPC_VEX_66(0x0f38, 0xdc): /* vaesenc {x,y}mm/mem,{x,y}mm,{x,y}mm */
case X86EMUL_OPC_VEX_66(0x0f38, 0xdd): /* vaesenclast {x,y}mm/mem,{x,y}mm,{x,y}mm */
case X86EMUL_OPC_VEX_66(0x0f38, 0xde): /* vaesdec {x,y}mm/mem,{x,y}mm,{x,y}mm */
Simply clone the VEX-encoded handling to cover the EVEX forms. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- There's a TODO left due to lack of SDE support. Invoking the test would fail at present, for SDE 9.44.0 advertising both AVX10.2 and SM4, while not supporting the new EVEX encodings just yet. --- SDE: -??? --- v3: New.