diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-20 12:03:42 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-20 12:03:42 +0900 |
commit | 3636cde22306aa43ca00f69be19a2969456f4c35 (patch) | |
tree | 31036994809e9d36705b28c084be9045734d4622 /test/apx.cpp | |
parent | 1dd02012634737383498d8f3a4260ba1576f2e10 (diff) | |
download | xbyak-3636cde22306aa43ca00f69be19a2969456f4c35.tar.gz xbyak-3636cde22306aa43ca00f69be19a2969456f4c35.zip |
tests of 1-byte opcode with rex2
Diffstat (limited to 'test/apx.cpp')
-rw-r--r-- | test/apx.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index 91604fd..a95f285 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -1010,6 +1010,31 @@ CYBOZU_TEST_AUTO(shld) CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } +CYBOZU_TEST_AUTO(base) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + lea(r30, ptr[r20+r21]); + add(r30, r20); + add(r30, ptr[r20]); + cmp(r30, ptr[r20]); + } + } c; + const uint8_t tbl[] = { + // lea + 0xd5, 0x7c, 0x8d, 0x34, 0x2c, + // add + 0xd5, 0x59, 0x01, 0xe6, + 0xd5, 0x5c, 0x03, 0x34, 0x24, + // cmp + 0xd5, 0x5c, 0x3b, 0x34, 0x24, + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} + CYBOZU_TEST_AUTO(mov) { struct Code : Xbyak::CodeGenerator { |