diff options
| author | iximeow <me@iximeow.net> | 2026-04-30 15:47:43 +0000 |
|---|---|---|
| committer | iximeow <me@iximeow.net> | 2026-05-25 00:59:27 +0000 |
| commit | 1652c236ee3441c89f294fda93faefadb10874e7 (patch) | |
| tree | c848f28659d99981e9a2b56afaaa95cee7b204b9 /test | |
| parent | abc0978c7d4d331fe047fdcf1acf221754327fd2 (diff) | |
more general avx improvements
Diffstat (limited to 'test')
| -rw-r--r-- | test/long_mode/mod.rs | 38 | ||||
| -rw-r--r-- | test/protected_mode/mod.rs | 38 | ||||
| -rw-r--r-- | test/real_mode/mod.rs | 29 |
3 files changed, 105 insertions, 0 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs index bf49443..066d8c0 100644 --- a/test/long_mode/mod.rs +++ b/test/long_mode/mod.rs @@ -1586,6 +1586,12 @@ fn test_vex() { test_invalid_under(&InstDecoder::minimal(), bytes); } + 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(), bytes); + } + fn test_instr_invalid(bytes: &[u8]) { test_invalid_under(&InstDecoder::minimal().with_avx(), bytes); test_invalid_under(&InstDecoder::default(), bytes); @@ -1759,6 +1765,8 @@ fn test_vex() { test_instr(&[0xc4, 0b000_00010, 0b0_1111_001, 0x0f, 0b11_001_010], "vtestpd xmm9, xmm10"); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x0f, 0b11_001_010], "vtestpd ymm9, ymm10"); test_invalid(&[0xc4, 0b000_00010, 0b1_1111_101, 0x0f, 0b11_001_010]); + test_instr_vex_f16c(&[0xc4, 0b111_00010, 0b0_1111_001, 0x13, 0b11_001_010], "vcvtph2ps xmm1, xmm2"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x13, 0b11_001_010]); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x16, 0b11_001_010], "vpermps ymm9, ymm0, ymm10"); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x16, 0b00_001_010], "vpermps ymm9, ymm0, ymmword [r10]"); @@ -1778,6 +1786,7 @@ fn test_vex() { test_invalid(&[0xc4, 0b000_00010, 0b0_0111_101, 0x19, 0b00_001_010]); test_invalid(&[0xc4, 0b000_00010, 0b1_0111_101, 0x19, 0b00_001_010]); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x1a, 0b00_001_010], "vbroadcastf128 ymm9, xmmword [r10]"); + test_invalid(&[0xc4, 0b000_00010, 0b1_1111_101, 0x1a, 0b00_001_010]); // vex.w=1 is invalid test_invalid(&[0xc4, 0b000_00010, 0b1_0111_101, 0x1a, 0b00_001_010]); test_invalid(&[0xc4, 0b000_00010, 0b1_0111_001, 0x1a, 0b00_001_010]); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x5a, 0b00_001_010], "vbroadcasti128 ymm9, xmmword [r10]"); @@ -1789,6 +1798,7 @@ fn test_vex() { test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x18, 0b00_001_010], "vbroadcastss ymm9, dword [r10]"); test_invalid(&[0xc4, 0b000_00010, 0b1_0111_001, 0x18, 0b11_001_010]); test_invalid(&[0xc4, 0b000_00010, 0b1_0111_101, 0x18, 0b11_001_010]); + test_invalid(&[0xc4, 0b111_00010, 0b0_1111_001, 0x19, 0b11_001_010]); // "vbroadcastsd xmm, xmm" is not legal (L!=0) test_avx2(&[0xc4, 0b000_00010, 0b0_1111_101, 0x19, 0b11_001_010], "vbroadcastsd ymm9, xmm10"); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x19, 0b00_001_010], "vbroadcastsd ymm9, qword [r10]"); test_invalid(&[0xc4, 0b000_00010, 0b1_1111_101, 0x19, 0b11_001_010]); @@ -1840,6 +1850,19 @@ fn test_vex() { test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2b, 0b11_001_010], "vpackusdw ymm9, ymm8, ymm10"); test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2b, 0b00_001_010], "vpackusdw ymm9, ymm8, ymmword [r10]"); + test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x2c, 0b00_001_010], "vmaskmovps xmm9, xmm8, xmmword [r10]"); + test_invalid(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2c, 0b11_001_010]); + test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2c, 0b00_001_010], "vmaskmovps ymm9, ymm8, ymmword [r10]"); + test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x2d, 0b00_001_010], "vmaskmovpd xmm9, xmm8, xmmword [r10]"); + test_invalid(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2d, 0b11_001_010]); + test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2d, 0b00_001_010], "vmaskmovpd ymm9, ymm8, ymmword [r10]"); + test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x2e, 0b00_001_010], "vmaskmovps xmmword [r10], xmm8, xmm9"); + test_invalid(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2e, 0b11_001_010]); + test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2e, 0b00_001_010], "vmaskmovps ymmword [r10], ymm8, ymm9"); + test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x2f, 0b00_001_010], "vmaskmovpd xmmword [r10], xmm8, xmm9"); + test_invalid(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2f, 0b11_001_010]); + test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x2f, 0b00_001_010], "vmaskmovpd ymmword [r10], ymm8, ymm9"); + test_instr(&[0xc4, 0b000_00010, 0b0_1111_001, 0x30, 0b11_001_010], "vpmovzxbw xmm9, xmm10"); test_instr(&[0xc4, 0b000_00010, 0b0_1111_101, 0x30, 0b11_001_010], "vpmovzxbw ymm9, xmm10"); test_instr(&[0xc4, 0b000_00010, 0b0_1111_001, 0x31, 0b11_001_010], "vpmovzxbd xmm9, xmm10"); @@ -1868,6 +1891,7 @@ fn test_vex() { test_invalid(&[0xc4, 0b000_00010, 0b0_0111_001, 0x36, 0b11_001_010]); test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x36, 0b11_001_010], "vpermd ymm9, ymm8, ymm10"); + test_invalid(&[0xc4, 0b000_00010, 0b1_1111_101, 0x36, 0b11_001_010]); test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x37, 0b11_001_010], "vpcmpgtq xmm9, xmm8, xmm10"); test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x37, 0b11_001_010], "vpcmpgtq ymm9, ymm8, ymm10"); test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x38, 0b11_001_010], "vpminsb xmm9, xmm8, xmm10"); @@ -1919,6 +1943,20 @@ fn test_vex() { test_avx2(&[0xc4, 0b000_00010, 0b1_1111_001, 0x47, 0b11_001_010], "vpsllvq xmm9, xmm0, xmm10"); test_avx2(&[0xc4, 0b000_00010, 0b1_1111_101, 0x47, 0b11_001_010], "vpsllvq ymm9, ymm0, ymm10"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x58, 0b11_000_001], "vpbroadcastd xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x58, 0b11_000_001], "vpbroadcastd ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x58, 0b11_000_001]); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x59, 0b11_000_001], "vpbroadcastq xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x59, 0b11_000_001], "vpbroadcastq ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x59, 0b11_000_001]); + + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x78, 0b11_000_001], "vpbroadcastb xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x78, 0b11_000_001], "vpbroadcastb ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x78, 0b11_000_001]); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x79, 0b11_000_001], "vpbroadcastw xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x79, 0b11_000_001], "vpbroadcastw ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x79, 0b11_000_001]); + test_avx2(&[0xc4, 0b000_00010, 0b0_1111_001, 0x8c, 0b00_001_010], "vpmaskmovd xmm9, xmm0, xmmword [r10]"); test_avx2(&[0xc4, 0b000_00010, 0b0_1111_101, 0x8c, 0b00_001_010], "vpmaskmovd ymm9, ymm0, ymmword [r10]"); test_invalid(&[0xc4, 0b000_00010, 0b0_1111_001, 0x8c, 0b11_001_010]); diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs index c42ea73..4bd5fc5 100644 --- a/test/protected_mode/mod.rs +++ b/test/protected_mode/mod.rs @@ -1388,6 +1388,12 @@ fn test_vex() { test_invalid_under(&InstDecoder::minimal(), bytes); } + 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(), bytes); + } + #[allow(dead_code)] fn test_instr_invalid(bytes: &[u8]) { test_invalid_under(&InstDecoder::minimal().with_avx(), bytes); @@ -1562,6 +1568,8 @@ fn test_vex() { test_instr(&[0xc4, 0b110_00010, 0b0_1111_001, 0x0f, 0b11_001_010], "vtestpd xmm1, xmm2"); test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x0f, 0b11_001_010], "vtestpd ymm1, ymm2"); test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x0f, 0b11_001_010]); + test_instr_vex_f16c(&[0xc4, 0b111_00010, 0b0_1111_001, 0x13, 0b11_001_010], "vcvtph2ps xmm1, xmm2"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x13, 0b11_001_010]); test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x16, 0b11_001_010], "vpermps ymm1, ymm0, ymm2"); @@ -1582,6 +1590,7 @@ fn test_vex() { test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x19, 0b00_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_0111_101, 0x19, 0b00_001_010]); test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x1a, 0b00_001_010], "vbroadcastf128 ymm1, xmmword [edx]"); + test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x1a, 0b00_001_010]); // vex.w=1 is invalid test_invalid(&[0xc4, 0b110_00010, 0b1_0111_101, 0x1a, 0b00_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_0111_001, 0x1a, 0b00_001_010]); test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x5a, 0b00_001_010], "vbroadcasti128 ymm1, xmmword [edx]"); @@ -1593,6 +1602,7 @@ fn test_vex() { test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x18, 0b00_001_010], "vbroadcastss ymm1, dword [edx]"); test_invalid(&[0xc4, 0b110_00010, 0b1_0111_001, 0x18, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_0111_101, 0x18, 0b11_001_010]); + test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x19, 0b11_001_010]); // "vbroadcastsd xmm, xmm" is not legal (L!=0) test_avx2(&[0xc4, 0b110_00010, 0b0_1111_101, 0x19, 0b11_001_010], "vbroadcastsd ymm1, xmm2"); test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x19, 0b00_001_010], "vbroadcastsd ymm1, qword [edx]"); test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x19, 0b11_001_010]); @@ -1644,6 +1654,19 @@ fn test_vex() { test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2b, 0b11_001_010], "vpackusdw ymm1, ymm0, ymm2"); test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2b, 0b00_001_010], "vpackusdw ymm1, ymm0, ymmword [edx]"); + test_instr(&[0xc4, 0b110_00010, 0b0_0111_001, 0x2c, 0b00_001_010], "vmaskmovps xmm1, xmm0, xmmword [edx]"); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2c, 0b11_001_010]); + test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2c, 0b00_001_010], "vmaskmovps ymm1, ymm0, ymmword [edx]"); + test_instr(&[0xc4, 0b110_00010, 0b0_0111_001, 0x2d, 0b00_001_010], "vmaskmovpd xmm1, xmm0, xmmword [edx]"); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2d, 0b11_001_010]); + test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2d, 0b00_001_010], "vmaskmovpd ymm1, ymm0, ymmword [edx]"); + test_instr(&[0xc4, 0b110_00010, 0b0_0111_001, 0x2e, 0b00_001_010], "vmaskmovps xmmword [edx], xmm0, xmm1"); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2e, 0b11_001_010]); + test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2e, 0b00_001_010], "vmaskmovps ymmword [edx], ymm0, ymm1"); + test_instr(&[0xc4, 0b110_00010, 0b0_0111_001, 0x2f, 0b00_001_010], "vmaskmovpd xmmword [edx], xmm0, xmm1"); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2f, 0b11_001_010]); + test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2f, 0b00_001_010], "vmaskmovpd ymmword [edx], ymm0, ymm1"); + test_instr(&[0xc4, 0b110_00010, 0b0_1111_001, 0x30, 0b11_001_010], "vpmovzxbw xmm1, xmm2"); test_instr(&[0xc4, 0b110_00010, 0b0_1111_101, 0x30, 0b11_001_010], "vpmovzxbw ymm1, xmm2"); test_instr(&[0xc4, 0b110_00010, 0b0_1111_001, 0x31, 0b11_001_010], "vpmovzxbd xmm1, xmm2"); @@ -1672,6 +1695,7 @@ fn test_vex() { test_invalid(&[0xc4, 0b110_00010, 0b0_0111_001, 0x36, 0b11_001_010]); test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x36, 0b11_001_010], "vpermd ymm1, ymm0, ymm2"); + test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x36, 0b11_001_010]); test_instr(&[0xc4, 0b110_00010, 0b0_0111_001, 0x37, 0b11_001_010], "vpcmpgtq xmm1, xmm0, xmm2"); test_avx2(&[0xc4, 0b110_00010, 0b0_0111_101, 0x37, 0b11_001_010], "vpcmpgtq ymm1, ymm0, ymm2"); test_instr(&[0xc4, 0b110_00010, 0b0_0111_001, 0x38, 0b11_001_010], "vpminsb xmm1, xmm0, xmm2"); @@ -1723,6 +1747,20 @@ fn test_vex() { test_avx2(&[0xc4, 0b110_00010, 0b1_1111_001, 0x47, 0b11_001_010], "vpsllvq xmm1, xmm0, xmm2"); test_avx2(&[0xc4, 0b110_00010, 0b1_1111_101, 0x47, 0b11_001_010], "vpsllvq ymm1, ymm0, ymm2"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x58, 0b11_000_001], "vpbroadcastd xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x58, 0b11_000_001], "vpbroadcastd ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x58, 0b11_000_001]); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x59, 0b11_000_001], "vpbroadcastq xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x59, 0b11_000_001], "vpbroadcastq ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x59, 0b11_000_001]); + + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x78, 0b11_000_001], "vpbroadcastb xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x78, 0b11_000_001], "vpbroadcastb ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x78, 0b11_000_001]); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_001, 0x79, 0b11_000_001], "vpbroadcastw xmm0, xmm1"); + test_avx2(&[0xc4, 0b111_00010, 0b0_1111_101, 0x79, 0b11_000_001], "vpbroadcastw ymm0, ymm1"); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x79, 0b11_000_001]); + test_avx2(&[0xc4, 0b110_00010, 0b0_1111_001, 0x8c, 0b00_001_010], "vpmaskmovd xmm1, xmm0, xmmword [edx]"); test_avx2(&[0xc4, 0b110_00010, 0b0_1111_101, 0x8c, 0b00_001_010], "vpmaskmovd ymm1, ymm0, ymmword [edx]"); test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x8c, 0b11_001_010]); diff --git a/test/real_mode/mod.rs b/test/real_mode/mod.rs index b866aa0..90a6c60 100644 --- a/test/real_mode/mod.rs +++ b/test/real_mode/mod.rs @@ -17401,6 +17401,10 @@ fn test_real_mode() { test_display(&[0xc4, 0xc2, 0x39, 0x28, 0xca], "vpmuldq xmm1, xmm0, xmm2"); test_display(&[0xc4, 0xc2, 0x39, 0x29, 0xca], "vpcmpeqq xmm1, xmm0, xmm2"); test_display(&[0xc4, 0xc2, 0x39, 0x2b, 0xca], "vpackusdw xmm1, xmm0, xmm2"); + test_display(&[0xc4, 0xc2, 0x39, 0x2c, 0x0a], "vmaskmovps xmm1, xmm0, xmmword [bp + si * 1]"); + test_display(&[0xc4, 0xc2, 0x39, 0x2d, 0x0a], "vmaskmovpd xmm1, xmm0, xmmword [bp + si * 1]"); + test_display(&[0xc4, 0xc2, 0x39, 0x2e, 0x0a], "vmaskmovps xmmword [bp + si * 1], xmm0, xmm1"); + test_display(&[0xc4, 0xc2, 0x39, 0x2f, 0x0a], "vmaskmovpd xmmword [bp + si * 1], xmm0, xmm1"); test_display(&[0xc4, 0xc2, 0x39, 0x37, 0xca], "vpcmpgtq xmm1, xmm0, xmm2"); test_display(&[0xc4, 0xc2, 0x39, 0x38, 0xca], "vpminsb xmm1, xmm0, xmm2"); test_display(&[0xc4, 0xc2, 0x39, 0x39, 0xca], "vpminsd xmm1, xmm0, xmm2"); @@ -17417,6 +17421,10 @@ fn test_real_mode() { test_display(&[0xc4, 0xc2, 0x3d, 0x29, 0xca], "vpcmpeqq ymm1, ymm0, ymm2"); test_display(&[0xc4, 0xc2, 0x3d, 0x2b, 0x0a], "vpackusdw ymm1, ymm0, ymmword [bp + si * 1]"); test_display(&[0xc4, 0xc2, 0x3d, 0x2b, 0xca], "vpackusdw ymm1, ymm0, ymm2"); + test_display(&[0xc4, 0xc2, 0x3d, 0x2c, 0x0a], "vmaskmovps ymm1, ymm0, ymmword [bp + si * 1]"); + test_display(&[0xc4, 0xc2, 0x3d, 0x2d, 0x0a], "vmaskmovpd ymm1, ymm0, ymmword [bp + si * 1]"); + test_display(&[0xc4, 0xc2, 0x3d, 0x2e, 0x0a], "vmaskmovps ymmword [bp + si * 1], ymm0, ymm1"); + test_display(&[0xc4, 0xc2, 0x3d, 0x2f, 0x0a], "vmaskmovpd ymmword [bp + si * 1], ymm0, ymm1"); test_display(&[0xc4, 0xc2, 0x3d, 0x36, 0xca], "vpermd ymm1, ymm0, ymm2"); test_display(&[0xc4, 0xc2, 0x3d, 0x37, 0xca], "vpcmpgtq ymm1, ymm0, ymm2"); test_display(&[0xc4, 0xc2, 0x3d, 0x38, 0xca], "vpminsb ymm1, ymm0, ymm2"); @@ -17509,6 +17517,7 @@ fn test_real_mode() { test_display(&[0xc4, 0xc2, 0x7d, 0x34, 0xca], "vpmovzxwq ymm1, xmm2"); test_display(&[0xc4, 0xc2, 0x7d, 0x35, 0xca], "vpmovzxdq ymm1, xmm2"); test_display(&[0xc4, 0xc2, 0x7d, 0x45, 0x0a], "vpsrlvd ymm1, ymm0, ymmword [bp + si * 1]"); + test_display(&[0xc4, 0xe2, 0x79, 0x13, 0xca], "vcvtph2ps xmm1, xmm2"); test_display(&[0xc4, 0xc2, 0x7d, 0x45, 0xca], "vpsrlvd ymm1, ymm0, ymm2"); test_display(&[0xc4, 0xc2, 0x7d, 0x46, 0x0a], "vpsravd ymm1, ymm0, ymmword [bp + si * 1]"); test_display(&[0xc4, 0xc2, 0x7d, 0x47, 0x0a], "vpsllvd ymm1, ymm0, ymmword [bp + si * 1]"); @@ -17611,6 +17620,14 @@ fn test_real_mode() { test_display(&[0xc4, 0xe2, 0x78, 0xf3, 0x09], "blsr eax, dword [bx + di * 1]"); test_display(&[0xc4, 0xe2, 0x78, 0xf3, 0x11], "blsmsk eax, dword [bx + di * 1]"); test_display(&[0xc4, 0xe2, 0x78, 0xf3, 0x19], "blsi eax, dword [bx + di * 1]"); + test_display(&[0xc4, 0xe2, 0x79, 0x58, 0xc1], "vpbroadcastd xmm0, xmm1"); + test_display(&[0xc4, 0xe2, 0x79, 0x59, 0xc1], "vpbroadcastq xmm0, xmm1"); + test_display(&[0xc4, 0xe2, 0x79, 0x78, 0xc1], "vpbroadcastb xmm0, xmm1"); + test_display(&[0xc4, 0xe2, 0x79, 0x79, 0xc1], "vpbroadcastw xmm0, xmm1"); + test_display(&[0xc4, 0xe2, 0x7d, 0x58, 0xc1], "vpbroadcastd ymm0, ymm1"); + test_display(&[0xc4, 0xe2, 0x7d, 0x59, 0xc1], "vpbroadcastq ymm0, ymm1"); + test_display(&[0xc4, 0xe2, 0x7d, 0x78, 0xc1], "vpbroadcastb ymm0, ymm1"); + test_display(&[0xc4, 0xe2, 0x7d, 0x79, 0xc1], "vpbroadcastw ymm0, ymm1"); test_display(&[0xc4, 0xe2, 0xe0, 0xf2, 0x01], "andn eax, ebx, dword [bx + di * 1]"); test_display(&[0xc4, 0xe2, 0xe0, 0xf5, 0x07], "bzhi eax, dword [bx], ebx"); test_display(&[0xc4, 0xe2, 0xe0, 0xf7, 0x01], "bextr eax, dword [bx + di * 1], ebx"); @@ -18186,6 +18203,10 @@ fn test_invalid_sequences() { test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x23, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x24, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x25, 0b11_001_010]); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2c, 0b11_001_010]); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2d, 0b11_001_010]); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2e, 0b11_001_010]); + test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x2f, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x30, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x31, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x32, 0b11_001_010]); @@ -18195,6 +18216,7 @@ fn test_invalid_sequences() { test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0x41, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_0111_101, 0xdb, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x16, 0b00_011_010]); + test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x19, 0b11_001_010]); // "vbroadcastsd xmm, xmm" is not legal (L!=0) test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x5a, 0b00_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x8c, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b0_1111_001, 0x8e, 0b11_001_010]); @@ -18213,6 +18235,8 @@ fn test_invalid_sequences() { test_invalid(&[0xc4, 0b110_00010, 0b1_1111_001, 0x46, 0b00_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x16, 0b00_011_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x19, 0b11_001_010]); + test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x1a, 0b00_001_010]); // vex.w=1 is invalid + test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x36, 0b11_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x46, 0b00_001_010]); test_invalid(&[0xc4, 0b110_00010, 0b1_1111_101, 0x5a, 0b00_001_010]); test_invalid(&[0xc4, 0b110_00011, 0b0_0111_001, 0x08, 0b11_001_010, 0x77]); @@ -18262,6 +18286,11 @@ fn test_invalid_sequences() { 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, 0x46, 0b11_001_010, 0x77]); + test_invalid(&[0xc4, 0b111_00010, 0b1_1111_001, 0x13, 0b11_001_010]); + test_invalid(&[0xc4, 0xe2, 0xf9, 0x58, 0xc1]); + test_invalid(&[0xc4, 0xe2, 0xf9, 0x59, 0xc1]); + test_invalid(&[0xc4, 0xe2, 0xf9, 0x78, 0xc1]); + test_invalid(&[0xc4, 0xe2, 0xf9, 0x79, 0xc1]); test_invalid(&[0xc5, 0b1_1111_111, 0x2f, 0b11_001_010]); test_invalid(&[0xc5, 0x8c, 0x77]); test_invalid(&[0xd9, 0x08]); |
