From 1f0cdea3e996ff2006c560c1f495ca49b03c23ee Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 26 Jul 2020 03:45:40 -0700 Subject: ssse3, some missing sse4.1, and pextrw operands --- test/long_mode/mod.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'test') diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs index 50774ff..545a2d5 100644 --- a/test/long_mode/mod.rs +++ b/test/long_mode/mod.rs @@ -130,10 +130,14 @@ fn test_mmx() { test_display(&[0x0f, 0x6f, 0xe9], "movq mm5, mm1"); test_display(&[0x0f, 0xe5, 0x3d, 0xaa, 0xbb, 0xcc, 0x77], "pmulhw mm7, [rip + 0x77ccbbaa]"); + test_display(&[0x0f, 0x38, 0x00, 0xda], "pshufb mm3, mm2"); + test_display(&[0x0f, 0x74, 0xc2], "pcmpeqb mm0, mm2"); test_display(&[0x0f, 0x75, 0xc2], "pcmpeqw mm0, mm2"); test_display(&[0x0f, 0x76, 0xc2], "pcmpeqd mm0, mm2"); + test_display(&[0x0f, 0xc5, 0xd1, 0x00], "pextrw edx, mm1, 0x0"); + test_display(&[0x0f, 0xd8, 0xc2], "psubusb mm0, mm2"); test_display(&[0x0f, 0xd9, 0xc2], "psubusw mm0, mm2"); test_display(&[0x0f, 0xda, 0xc2], "pminub mm0, mm2"); @@ -582,6 +586,26 @@ fn test_sse3() { } #[test] +fn test_ssse3() { + fn test_instr(bytes: &[u8], text: &'static str) { + test_display_under(&InstDecoder::minimal().with_ssse3(), bytes, text); + test_invalid_under(&InstDecoder::minimal(), bytes); + // avx doesn't imply older instructions are necessarily valid + test_invalid_under(&InstDecoder::minimal().with_avx(), bytes); + // sse4 doesn't imply older instructions are necessarily valid + test_invalid_under(&InstDecoder::minimal().with_sse4_1(), bytes); + test_invalid_under(&InstDecoder::minimal().with_sse4_2(), bytes); + } + + #[allow(unused)] + fn test_instr_invalid(bytes: &[u8]) { + test_invalid_under(&InstDecoder::minimal().with_ssse3(), bytes); + test_invalid_under(&InstDecoder::default(), bytes); + } + test_instr(&[0x66, 0x0f, 0x38, 0x00, 0xda], "pshufb xmm3, xmm2"); +} + +#[test] fn test_0f01() { // drawn heavily from "Table A-6. Opcode Extensions for One- and Two-byte Opcodes by Group // Number" @@ -1214,6 +1238,7 @@ fn prefixed_0f() { test_display(&[0x0f, 0x6e, 0xc2], "movd mm0, edx"); test_display(&[0x0f, 0x6f, 0x00], "movq mm0, [rax]"); test_display(&[0x0f, 0x6f, 0xc2], "movq mm0, mm2"); + test_display(&[0x0f, 0x6f, 0xfb], "movq mm7, mm3"); test_display(&[0x0f, 0x70, 0x00, 0x7f], "pshufw mm0, [rax], 0x7f"); test_display(&[0x4f, 0x0f, 0x70, 0x00, 0x7f], "pshufw mm0, [r8], 0x7f"); test_invalid(&[0x0f, 0x71, 0x00, 0x7f]); -- cgit v1.1