diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-20 11:10:42 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-20 11:10:52 +0900 |
commit | ed5dc351610cefdb79ffe72f8757384380d4d32b (patch) | |
tree | 518e9bce484c114ed41ecaba357ba8a31a192f25 /test | |
parent | b01c0ed40e066bdc0adcce2ef4903a48ed3dfdb7 (diff) | |
download | xbyak-ed5dc351610cefdb79ffe72f8757384380d4d32b.tar.gz xbyak-ed5dc351610cefdb79ffe72f8757384380d4d32b.zip |
add tests of shld/shrd
Diffstat (limited to 'test')
-rw-r--r-- | test/apx.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index d5ca303..fde981f 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -965,3 +965,47 @@ CYBOZU_TEST_AUTO(lzcnt) CYBOZU_TEST_EQUAL(c.getSize(), n); CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } + +CYBOZU_TEST_AUTO(shld) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + shld(rax|T_nf, rcx, cl); + shld(r16, rcx, cl); + shld(r16, rcx, 0x9); + shld(r16|T_nf, rcx, 0x9); + shld(r20, r16, rcx, cl); + shld(r20|T_nf, r16, rcx, cl); + shld(r20, r16, rcx, 0x9); + shld(r20|T_nf, r16, rcx, 0x9); + shld(r20, ptr [r21], rcx, 0x9); + + shrd(rax|T_nf, rcx, cl); + shrd(r16, rcx, cl); + shrd(r16, rcx, 0x9); + shrd(r16|T_nf, rcx, 0x9); + shrd(r20, r16, rcx, cl); + shrd(r20|T_nf, r16, rcx, cl); + shrd(r20, r16, rcx, 0x9); + shrd(r20|T_nf, r16, rcx, 0x9); + shrd(r20, ptr [r21], rcx, 0x9); + } + } c; + const uint8_t tbl[] = { + // shld + 0x62, 0xf4, 0xfc, 0x0c, 0xa5, 0xc8, 0x62, 0xfc, 0xfc, 0x08, 0xa5, 0xc8, 0x62, 0xfc, 0xfc, 0x08, + 0x24, 0xc8, 0x09, 0x62, 0xfc, 0xfc, 0x0c, 0x24, 0xc8, 0x09, 0x62, 0xfc, 0xdc, 0x10, 0xa5, 0xc8, + 0x62, 0xfc, 0xdc, 0x14, 0xa5, 0xc8, 0x62, 0xfc, 0xdc, 0x10, 0x24, 0xc8, 0x09, 0x62, 0xfc, 0xdc, + 0x14, 0x24, 0xc8, 0x09, 0x62, 0xfc, 0xdc, 0x10, 0x24, 0x4d, 0x00, 0x09, + // shrd + 0x62, 0xf4, 0xfc, 0x0c, 0xad, 0xc8, 0x62, 0xfc, 0xfc, 0x08, 0xad, 0xc8, 0x62, 0xfc, 0xfc, 0x08, + 0x2c, 0xc8, 0x09, 0x62, 0xfc, 0xfc, 0x0c, 0x2c, 0xc8, 0x09, 0x62, 0xfc, 0xdc, 0x10, 0xad, 0xc8, + 0x62, 0xfc, 0xdc, 0x14, 0xad, 0xc8, 0x62, 0xfc, 0xdc, 0x10, 0x2c, 0xc8, 0x09, 0x62, 0xfc, 0xdc, + 0x14, 0x2c, 0xc8, 0x09, 0x62, 0xfc, 0xdc, 0x10, 0x2c, 0x4d, 0x00, 0x09, + + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} |