aboutsummaryrefslogtreecommitdiff
path: root/test/long_mode/mod.rs
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2020-07-26 03:45:40 -0700
committeriximeow <me@iximeow.net>2020-07-26 03:45:40 -0700
commit1f0cdea3e996ff2006c560c1f495ca49b03c23ee (patch)
tree4e139b313587059b9e9e6f2b868403602d8530be /test/long_mode/mod.rs
parentc5b4cd30efa6cc830f5effaf04df6ec86ad858dd (diff)
ssse3, some missing sse4.1, and pextrw operands
Diffstat (limited to 'test/long_mode/mod.rs')
-rw-r--r--test/long_mode/mod.rs25
1 files changed, 25 insertions, 0 deletions
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]);