diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-22 11:46:45 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-22 11:46:45 +0900 |
commit | 114152fedf82cf6d3ff1e047098c5b9d4a31b8bc (patch) | |
tree | 699bb9050cd7285f65ce89472903dd3bbddca292 /test | |
parent | 1aefdb649960a4bfdc69602967968462165d6d8c (diff) | |
download | xbyak-114152fedf82cf6d3ff1e047098c5b9d4a31b8bc.tar.gz xbyak-114152fedf82cf6d3ff1e047098c5b9d4a31b8bc.zip |
add push2/pop2
Diffstat (limited to 'test')
-rw-r--r-- | test/apx.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index ba767e2..3e0b0af 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -1397,3 +1397,38 @@ CYBOZU_TEST_AUTO(shift_3op) CYBOZU_TEST_EQUAL(c.getSize(), n); CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } + +CYBOZU_TEST_AUTO(push2_pop2) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + push2(r20, r30); + push2(rax, rcx); + push2p(r20, r30); + push2p(rdx, r8); + + pop2(rax, rcx); + pop2(r20, r30); + pop2p(rax, rcx); + pop2p(r20, r30); + } + } c; + const uint8_t tbl[] = { + // push2 + 0x62, 0xdc, 0x5c, 0x10, 0xff, 0xf6, + 0x62, 0xf4, 0x7c, 0x18, 0xff, 0xf1, + // push2p (What is this?) + 0x62, 0xdc, 0xdc, 0x10, 0xff, 0xf6, + 0x62, 0xd4, 0xec, 0x18, 0xff, 0xf0, + // pop2 + 0x62, 0xf4, 0x7c, 0x18, 0x8f, 0xc1, + 0x62, 0xdc, 0x5c, 0x10, 0x8f, 0xc6, + // pop2p + 0x62, 0xf4, 0xfc, 0x18, 0x8f, 0xc1, + 0x62, 0xdc, 0xdc, 0x10, 0x8f, 0xc6, + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} |