diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-29 14:41:13 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-29 14:41:13 +0900 |
commit | 45711c5021ad4de196bd91d74a1986cf4fe74af5 (patch) | |
tree | 811a2ce66a37e7e8599120e7b7b8c9be690bf619 /test | |
parent | a1f6c14cccfc1bf40d6460f8f8c4b0419e09194d (diff) | |
download | xbyak-45711c5021ad4de196bd91d74a1986cf4fe74af5.tar.gz xbyak-45711c5021ad4de196bd91d74a1986cf4fe74af5.zip |
add ctestscc
Diffstat (limited to 'test')
-rw-r--r-- | test/apx.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index 23054e8..0e15381 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -1533,3 +1533,45 @@ CYBOZU_TEST_AUTO(ccmp) CYBOZU_TEST_EQUAL(c.getSize(), n); CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } + +CYBOZU_TEST_AUTO(ctestb) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + ctestb(r30b, r31b, 0); + ctestb(r30w, r31w, 1); + ctestb(r30d, r31d, 2); + ctestb(r30, r31, 3); + + ctestb(ptr [r30], r31b, 4); + ctestb(ptr [r30], r31w, 5); + ctestb(ptr [r30], r31d, 6); + ctestb(ptr [r30], r31, 7); + + ctestb(r30b, 0x12, 8); + ctestb(r30w, 0x1234, 9); + ctestb(r30d, 0x12345678, 10); + ctestb(r30, 0x12345678, 11); + + ctestb(byte [r30], 0x12, 12); + ctestb(word [r30], 0x1234, 13); + ctestb(dword [r30], 0x12345678, 14); + ctestb(qword [r30], 0x12345678, 15); + } + } c; + const uint8_t tbl[] = { + 0x62, 0x4c, 0x04, 0x02, 0x84, 0xfe, 0x62, 0x4c, 0x0d, 0x02, 0x85, 0xfe, 0x62, 0x4c, 0x14, 0x02, + 0x85, 0xfe, 0x62, 0x4c, 0x9c, 0x02, 0x85, 0xfe, 0x62, 0x4c, 0x24, 0x02, 0x84, 0x3e, 0x62, 0x4c, + 0x2d, 0x02, 0x85, 0x3e, 0x62, 0x4c, 0x34, 0x02, 0x85, 0x3e, 0x62, 0x4c, 0xbc, 0x02, 0x85, 0x3e, + 0x62, 0xdc, 0x44, 0x02, 0xf6, 0xc6, 0x12, 0x62, 0xdc, 0x4d, 0x02, 0xf7, 0xc6, 0x34, 0x12, 0x62, + 0xdc, 0x54, 0x02, 0xf7, 0xc6, 0x78, 0x56, 0x34, 0x12, 0x62, 0xdc, 0xdc, 0x02, 0xf7, 0xc6, 0x78, + 0x56, 0x34, 0x12, 0x62, 0xdc, 0x64, 0x02, 0xf6, 0x06, 0x12, 0x62, 0xdc, 0x6d, 0x02, 0xf7, 0x06, + 0x34, 0x12, 0x62, 0xdc, 0x74, 0x02, 0xf7, 0x06, 0x78, 0x56, 0x34, 0x12, 0x62, 0xdc, 0xfc, 0x02, + 0xf7, 0x06, 0x78, 0x56, 0x34, 0x12, + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} + |