diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-09 11:16:40 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-09 11:16:40 +0900 |
commit | b1f0fef4d0e71ab87e6d76ccf68320d1f2018a85 (patch) | |
tree | c4ebae0d84b25f01c9130cf09b22981264ab7a22 /test | |
parent | 9b21727ba0bd3938de518918a118c221ee85f1d1 (diff) | |
download | xbyak-b1f0fef4d0e71ab87e6d76ccf68320d1f2018a85.tar.gz xbyak-b1f0fef4d0e71ab87e6d76ccf68320d1f2018a85.zip |
add test of 3op apx
Diffstat (limited to 'test')
-rw-r--r-- | test/apx.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index 5e2eb04..a564c59 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -378,3 +378,37 @@ CYBOZU_TEST_AUTO(adcx_adox) CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } +CYBOZU_TEST_AUTO(r3_2) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + add(rax, rcx, rdx); + adc(rax, rcx, rdx); + and_(rax, rcx, rdx); + or_(rax, rcx, rdx); + sbb(rax, rcx, rdx); + sub(rax, rcx, rdx); + xor_(rax, rcx, rdx); + add(r30, ptr [r20], r9); + adc(r30, ptr [r20], r9); + and_(r30, ptr [r20], r9); + or_(r30, ptr [r20], r9); + sbb(r30, ptr [r20], r9); + sub(r30, ptr [r20], r9); + xor_(r30, ptr [r20], r9); + } + } c; + const uint8_t tbl[] = { + 0x62, 0xf4, 0xfc, 0x18, 0x01, 0xd1, 0x62, 0xf4, 0xfc, 0x18, 0x11, 0xd1, 0x62, 0xf4, 0xfc, 0x18, + 0x21, 0xd1, 0x62, 0xf4, 0xfc, 0x18, 0x09, 0xd1, 0x62, 0xf4, 0xfc, 0x18, 0x19, 0xd1, 0x62, 0xf4, + 0xfc, 0x18, 0x29, 0xd1, 0x62, 0xf4, 0xfc, 0x18, 0x31, 0xd1, 0x62, 0x7c, 0x8c, 0x10, 0x01, 0x0c, + 0x24, 0x62, 0x7c, 0x8c, 0x10, 0x11, 0x0c, 0x24, 0x62, 0x7c, 0x8c, 0x10, 0x21, 0x0c, 0x24, 0x62, + 0x7c, 0x8c, 0x10, 0x09, 0x0c, 0x24, 0x62, 0x7c, 0x8c, 0x10, 0x19, 0x0c, 0x24, 0x62, 0x7c, 0x8c, + 0x10, 0x29, 0x0c, 0x24, 0x62, 0x7c, 0x8c, 0x10, 0x31, 0x0c, 0x24, + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} + |