diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-17 16:00:26 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-17 16:00:26 +0900 |
commit | 273d8d5b6bc3df51df6137b803bdb15e67289fe0 (patch) | |
tree | 71c3942228193b989137af28b1acbbe66e264016 /test | |
parent | 50875294c25b38168c5ff60177295541df1ad30d (diff) | |
download | xbyak-273d8d5b6bc3df51df6137b803bdb15e67289fe0.tar.gz xbyak-273d8d5b6bc3df51df6137b803bdb15e67289fe0.zip |
add 3-op imul with T_zu
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 08cbbb9..29a7850 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -895,3 +895,38 @@ CYBOZU_TEST_AUTO(imul_2op) CYBOZU_TEST_EQUAL(c.getSize(), n); CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } + +CYBOZU_TEST_AUTO(imul_zu) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + imul(ax|T_zu, cx, 0x1234); + imul(ax|T_nf, cx, 0x1234); + imul(ax|T_zu|T_nf, cx, 0x1234); + imul(r30w, ax, 0x1234); + imul(r30d, eax, 0x12345678); + imul(r30, rax, 0x12345678); + imul(r30|T_zu, rax, 0x12345678); + imul(r30|T_nf, rax, 0x12345678); + imul(r30|T_nf|T_zu, rax, 0x12345678); + imul(rcx, ptr [r30], 0x12345678); + } + } c; + const uint8_t tbl[] = { + 0x62, 0xf4, 0x7d, 0x18, 0x69, 0xc1, 0x34, 0x12, // T_zu + 0x62, 0xf4, 0x7d, 0x0c, 0x69, 0xc1, 0x34, 0x12, // T_nf + 0x62, 0xf4, 0x7d, 0x1c, 0x69, 0xc1, 0x34, 0x12, // T_zu|T_nf + 0x62, 0x64, 0x7d, 0x08, 0x69, 0xf0, 0x34, 0x12, // w + 0x62, 0x64, 0x7c, 0x08, 0x69, 0xf0, 0x78, 0x56, 0x34, 0x12, // d + 0x62, 0x64, 0xfc, 0x08, 0x69, 0xf0, 0x78, 0x56, 0x34, 0x12, + 0x62, 0x64, 0xfc, 0x18, 0x69, 0xf0, 0x78, 0x56, 0x34, 0x12, // T_zu + 0x62, 0x64, 0xfc, 0x0c, 0x69, 0xf0, 0x78, 0x56, 0x34, 0x12, // T_nf + 0x62, 0x64, 0xfc, 0x1c, 0x69, 0xf0, 0x78, 0x56, 0x34, 0x12, // T_nf|T_zu + 0x62, 0xdc, 0xfc, 0x08, 0x69, 0x0e, 0x78, 0x56, 0x34, 0x12, + + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} |