diff options
| author | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-12-23 23:22:15 +0100 |
|---|---|---|
| committer | Fabrice Desclaux <fabrice.desclaux@cea.fr> | 2015-12-24 18:38:19 +0100 |
| commit | 3ba62672ccb2190b7598ec5e362c670f031f74a9 (patch) | |
| tree | b96c92353c5f0fd4edb4ca09c4c76891dfa951c7 | |
| parent | d2dc89a03a1fe475844a0ae5098604b0ae0a8525 (diff) | |
| download | miasm-3ba62672ccb2190b7598ec5e362c670f031f74a9.tar.gz miasm-3ba62672ccb2190b7598ec5e362c670f031f74a9.zip | |
Test: add x86 reg test
Diffstat (limited to '')
| -rw-r--r-- | test/arch/x86/unit/mn_punpck.py | 63 |
1 files changed, 62 insertions, 1 deletions
diff --git a/test/arch/x86/unit/mn_punpck.py b/test/arch/x86/unit/mn_punpck.py index bf66b8ed..84d86c32 100644 --- a/test/arch/x86/unit/mn_punpck.py +++ b/test/arch/x86/unit/mn_punpck.py @@ -59,5 +59,66 @@ class Test_PUNPCKHDQ(Asm_Test): assert self.myjit.cpu.MM0 == 0x1122334455667788 assert self.myjit.cpu.MM1 == 0xAABBCCDD11223344 + + + +class Test_PUNPCKLBW(Asm_Test): + TXT = ''' + main: + CALL next + .byte 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 + .byte 0x01, 0x02, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA + next: + POP EBP + MOVQ MM0, QWORD PTR [EBP] + MOVQ MM1, MM0 + PUNPCKLBW MM1, QWORD PTR [EBP+0x8] + RET + ''' + + def check(self): + assert self.myjit.cpu.MM0 == 0x1122334455667788 + assert self.myjit.cpu.MM1 == 0xEE55FF6602770188 + + +class Test_PUNPCKLWD(Asm_Test): + TXT = ''' + main: + CALL next + .byte 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 + .byte 0x01, 0x02, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA + next: + POP EBP + MOVQ MM0, QWORD PTR [EBP] + MOVQ MM1, MM0 + PUNPCKLWD MM1, QWORD PTR [EBP+0x8] + RET + ''' + + def check(self): + assert self.myjit.cpu.MM0 == 0x1122334455667788 + assert self.myjit.cpu.MM1 == 0xEEFF556602017788 + + + +class Test_PUNPCKLDQ(Asm_Test): + TXT = ''' + main: + CALL next + .byte 0x88, 0x77, 0x66, 0x55, 0x44, 0x33, 0x22, 0x11 + .byte 0x01, 0x02, 0xFF, 0xEE, 0xDD, 0xCC, 0xBB, 0xAA + next: + POP EBP + MOVQ MM0, QWORD PTR [EBP] + MOVQ MM1, MM0 + PUNPCKLDQ MM1, QWORD PTR [EBP+0x8] + RET + ''' + + def check(self): + assert self.myjit.cpu.MM0 == 0x1122334455667788 + assert self.myjit.cpu.MM1 == 0xEEFF020155667788 + if __name__ == "__main__": - [test()() for test in [Test_PUNPCKHBW, Test_PUNPCKHWD, Test_PUNPCKHDQ]] + [test()() for test in [Test_PUNPCKHBW, Test_PUNPCKHWD, Test_PUNPCKHDQ, + Test_PUNPCKLBW, Test_PUNPCKLWD, Test_PUNPCKLDQ,]] |