diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-21 16:27:42 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-21 16:27:42 +0900 |
commit | 26be71a124a6af486f45b80dce102b4f0e90843d (patch) | |
tree | c25799c27a81e965b86f00c0e021a9f24b32ad5c /test | |
parent | 83f5bd25e84cf2e2082014558fe1b2178a0e9316 (diff) | |
download | xbyak-26be71a124a6af486f45b80dce102b4f0e90843d.tar.gz xbyak-26be71a124a6af486f45b80dce102b4f0e90843d.zip |
2-op shl supports apx
Diffstat (limited to 'test')
-rw-r--r-- | test/apx.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index 4272fbb..f00b01d 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -1074,3 +1074,37 @@ CYBOZU_TEST_AUTO(mov_misc) CYBOZU_TEST_EQUAL(c.getSize(), n); CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } + +CYBOZU_TEST_AUTO(shift_2op) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + shl(r16b, cl); + shl(r16w, cl); + shl(r16d, cl); + shl(r16, cl); + shl(r16|T_nf, cl); + shl(r16b, 0x3); + shl(r16w, 0x5); + shl(r16d, 0x7); + shl(r16, 0x9); + shl(byte [r30], 0x3); + shl(word [r30], 0x5); + shl(dword [r30], 0x7); + shl(qword [r30], 0x9); + } + } c; + const uint8_t tbl[] = { + // shl + 0x62, 0xfc, 0x7c, 0x08, 0xd2, 0xe0, 0x62, 0xfc, 0x7d, 0x08, 0xd3, 0xe0, 0x62, 0xfc, 0x7c, 0x08, + 0xd3, 0xe0, 0x62, 0xfc, 0xfc, 0x08, 0xd3, 0xe0, 0x62, 0xfc, 0xfc, 0x0c, 0xd3, 0xe0, 0x62, 0xfc, + 0x7c, 0x08, 0xc0, 0xe0, 0x03, 0x62, 0xfc, 0x7d, 0x08, 0xc1, 0xe0, 0x05, 0x62, 0xfc, 0x7c, 0x08, + 0xc1, 0xe0, 0x07, 0x62, 0xfc, 0xfc, 0x08, 0xc1, 0xe0, 0x09, 0x62, 0xdc, 0x7c, 0x08, 0xc0, 0x26, + 0x03, 0x62, 0xdc, 0x7d, 0x08, 0xc1, 0x26, 0x05, 0x62, 0xdc, 0x7c, 0x08, 0xc1, 0x26, 0x07, 0x62, + 0xdc, 0xfc, 0x08, 0xc1, 0x26, 0x09, + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} |