diff options
| author | iximeow <me@iximeow.net> | 2026-05-03 17:48:14 +0000 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-05-25 01:33:18 +0000 |
| commit | 351adb926722b626a3fdc85b4d42303d37678fd3 (patch) | |
| tree | 4542a61752e272b559687377c53a77604f149c81 /test | |
| parent | 706ec278edebe06eff9f91f5cb30f5faba46132d (diff) | |
actually support avx/f16c in per-uarch decoding
Diffstat (limited to 'test')
| -rw-r--r-- | test/long_mode/mod.rs | 9 | ||||
| -rw-r--r-- | test/protected_mode/mod.rs | 9 | ||||
| -rw-r--r-- | test/real_mode/mod.rs | 4 |
3 files changed, 20 insertions, 2 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs index 3f7d9e0..0b78dd2 100644 --- a/test/long_mode/mod.rs +++ b/test/long_mode/mod.rs @@ -1534,6 +1534,7 @@ fn test_misc() { test_invalid(&[0x43, 0x0f, 0x38, 0x82, 0x2f]); test_display(&[0x66, 0x0f, 0xae, 0xf1], "tpause ecx"); test_display(&[0x66, 0x4f, 0x0f, 0xae, 0xf1], "tpause r9"); + test_display(&[0xc4, 0b000_00011, 0b0_1111_101, 0x1d, 0b11_001_010, 0x77], "vcvtps2ph xmm10, ymm9, 0x77"); } #[test] @@ -1589,6 +1590,8 @@ fn test_vex() { fn test_instr_vex_f16c(bytes: &[u8], text: &'static str) { test_display_under(&InstDecoder::minimal().with_avx().with_f16c(), bytes, text); test_display_under(&InstDecoder::default(), bytes, text); + test_invalid_under(&InstDecoder::minimal().with_avx(), bytes); + test_invalid_under(&InstDecoder::minimal().with_f16c(), bytes); test_invalid_under(&InstDecoder::minimal(), bytes); } @@ -1664,7 +1667,7 @@ fn test_vex() { test_invalid(&[0xc4, 0b000_00011, 0b1_0111_001, 0x18, 0b11_001_010, 0x77]); test_instr(&[0xc4, 0b000_00011, 0b0_0111_101, 0x18, 0b11_001_010, 0x77], "vinsertf128 ymm9, ymm8, xmm10, 0x77"); - test_invalid(&[0xc4, 0b000_00011, 0b1_0111_101, 0x18, 0b11_001_010, 0x77]); + test_invalid(&[0xc4, 0b000_00011, 0b1_0111_101, 0x19, 0b11_001_010, 0x77]); test_instr(&[0xc4, 0b000_00011, 0b0_1111_101, 0x19, 0b11_001_010, 0x77], "vextractf128 xmm10, ymm9, 0x77"); test_invalid(&[0xc4, 0b000_00011, 0b0_1111_001, 0x19, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b000_00011, 0b1_1111_101, 0x19, 0b11_001_010, 0x77]); @@ -1676,6 +1679,10 @@ fn test_vex() { test_invalid(&[0xc4, 0b000_00011, 0b0_1111_001, 0x19, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b000_00011, 0b1_1111_101, 0x19, 0b11_001_010, 0x77]); + test_instr_vex_f16c(&[0xc4, 0b000_00011, 0b0_1111_101, 0x1d, 0b11_001_010, 0x77], "vcvtps2ph xmm10, ymm9, 0x77"); + test_instr_vex_f16c(&[0xc4, 0b000_00011, 0b0_1111_101, 0x1d, 0b11_001_010, 0x77], "vcvtps2ph xmm10, ymm9, 0x77"); + test_invalid(&[0xc4, 0b000_00011, 0b1_1111_101, 0x1d, 0b11_001_010, 0x77]); + test_instr(&[0xc4, 0b000_00011, 0b0_0111_001, 0x20, 0b11_001_010, 0x77], "vpinsrb xmm9, xmm8, r10d, 0x77"); test_instr(&[0xc4, 0b000_00011, 0b0_0111_001, 0x20, 0b00_001_010, 0x77], "vpinsrb xmm9, xmm8, byte [r10], 0x77"); test_invalid(&[0xc4, 0b000_00011, 0b0_0111_101, 0x20, 0b00_001_010, 0x77]); diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs index f152bbe..87520cf 100644 --- a/test/protected_mode/mod.rs +++ b/test/protected_mode/mod.rs @@ -1349,6 +1349,7 @@ fn test_misc() { test_display(&[0x66, 0x0f, 0x38, 0x82, 0x2f], "invpcid ebp, xmmword [edi]"); test_invalid(&[0x0f, 0x38, 0x82, 0x2f]); test_display(&[0x66, 0x0f, 0xae, 0xf1], "tpause ecx"); + test_display(&[0xc4, 0b111_00011, 0b0_1111_101, 0x1d, 0b11_001_010, 0x77], "vcvtps2ph xmm2, ymm1, 0x77"); } #[test] @@ -1391,6 +1392,8 @@ fn test_vex() { fn test_instr_vex_f16c(bytes: &[u8], text: &'static str) { test_display_under(&InstDecoder::minimal().with_avx().with_f16c(), bytes, text); test_display_under(&InstDecoder::default(), bytes, text); + test_invalid_under(&InstDecoder::minimal().with_avx(), bytes); + test_invalid_under(&InstDecoder::minimal().with_f16c(), bytes); test_invalid_under(&InstDecoder::minimal(), bytes); } @@ -1467,7 +1470,7 @@ fn test_vex() { test_invalid(&[0xc4, 0b110_00011, 0b1_0111_001, 0x18, 0b11_001_010, 0x77]); test_instr(&[0xc4, 0b110_00011, 0b0_0111_101, 0x18, 0b11_001_010, 0x77], "vinsertf128 ymm1, ymm0, xmm2, 0x77"); - test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0x18, 0b11_001_010, 0x77]); + test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0x19, 0b11_001_010, 0x77]); test_instr(&[0xc4, 0b110_00011, 0b0_1111_101, 0x19, 0b11_001_010, 0x77], "vextractf128 xmm2, ymm1, 0x77"); test_invalid(&[0xc4, 0b110_00011, 0b0_1111_001, 0x19, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x19, 0b11_001_010, 0x77]); @@ -1479,6 +1482,10 @@ fn test_vex() { test_invalid(&[0xc4, 0b110_00011, 0b0_1111_001, 0x19, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x19, 0b11_001_010, 0x77]); + test_instr_vex_f16c(&[0xc4, 0b110_00011, 0b0_1111_101, 0x1d, 0b11_001_010, 0x77], "vcvtps2ph xmm2, ymm1, 0x77"); + test_instr_vex_f16c(&[0xc4, 0b110_00011, 0b0_1111_101, 0x1d, 0b11_001_010, 0x77], "vcvtps2ph xmm2, ymm1, 0x77"); + test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x1d, 0b11_001_010, 0x77]); + test_instr(&[0xc4, 0b110_00011, 0b0_0111_001, 0x20, 0b11_001_010, 0x77], "vpinsrb xmm1, xmm0, edx, 0x77"); test_instr(&[0xc4, 0b110_00011, 0b0_0111_001, 0x20, 0b00_001_010, 0x77], "vpinsrb xmm1, xmm0, byte [edx], 0x77"); test_invalid(&[0xc4, 0b110_00011, 0b0_0111_101, 0x20, 0b00_001_010, 0x77]); diff --git a/test/real_mode/mod.rs b/test/real_mode/mod.rs index f6ace8b..c81a8cd 100644 --- a/test/real_mode/mod.rs +++ b/test/real_mode/mod.rs @@ -17596,6 +17596,7 @@ fn test_real_mode() { test_display(&[0xc4, 0xc3, 0x7d, 0x08, 0xca, 0x77], "vroundps ymm1, ymm2, 0x77"); test_display(&[0xc4, 0xc3, 0x7d, 0x09, 0xca, 0x77], "vroundpd ymm1, ymm2, 0x77"); test_display(&[0xc4, 0xc3, 0x7d, 0x19, 0xca, 0x77], "vextractf128 xmm2, ymm1, 0x77"); + test_display(&[0xc4, 0xc3, 0x7d, 0x1d, 0xca, 0x77], "vcvtps2ph xmm2, ymm1, 0x77"); test_display(&[0xc4, 0xc3, 0x7d, 0x39, 0xca, 0x77], "vextracti128 xmm2, ymm1, 0x77"); test_display(&[0xc4, 0xc3, 0x7d, 0x46, 0x0a, 0x77], "vperm2i128 ymm1, ymm0, ymmword [bp + si * 1], 0x77"); test_display(&[0xc4, 0xc3, 0x7d, 0x46, 0xca, 0x77], "vperm2i128 ymm1, ymm0, ymm2, 0x77"); @@ -17641,6 +17642,7 @@ fn test_real_mode() { test_display(&[0xc4, 0xe2, 0xf8, 0xf3, 0x11], "blsmsk eax, dword [bx + di * 1]"); test_display(&[0xc4, 0xe2, 0xf8, 0xf3, 0x19], "blsi eax, dword [bx + di * 1]"); test_display(&[0xc4, 0xe3, 0x7b, 0xf0, 0x01, 0x05], "rorx eax, dword [bx + di * 1], 0x5"); + test_display(&[0xc4, 0xe3, 0x7d, 0x1d, 0xca, 0x77], "vcvtps2ph xmm2, ymm1, 0x77"); test_display(&[0xc4, 0xe3, 0xfb, 0xf0, 0x01, 0x05], "rorx eax, dword [bx + di * 1], 0x5"); test_display(&[0xc5, 0x78, 0x10], "lds di, dword [bx + si * 1 + 0x10]"); test_display(&[0xc5, 0xf8, 0x10, 0x00], "vmovups xmm0, xmmword [bx + si * 1]"); @@ -18279,6 +18281,7 @@ fn test_invalid_sequences() { test_invalid(&[0xc4, 0b110_00011, 0b1_0111_001, 0x4c, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_0111_001, 0xdf, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0x18, 0b11_001_010, 0x77]); + test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0x19, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0x22, 0b00_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0x4c, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_0111_101, 0xdf, 0b11_001_010, 0x77]); @@ -18287,6 +18290,7 @@ fn test_invalid_sequences() { test_invalid(&[0xc4, 0b110_00011, 0b1_1111_001, 0x02, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x02, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x19, 0b11_001_010, 0x77]); + test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x1d, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b110_00011, 0b1_1111_101, 0x46, 0b11_001_010, 0x77]); test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x13, 0b11_001_010]); test_invalid(&[0xc4, 0xe2, 0xf9, 0x58, 0xc1]); |
