diff options
author | MITSUNARI Shigeo <[email protected]> | 2023-11-10 17:20:41 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2023-11-10 17:20:41 +0900 |
commit | f5fda7ace8ec04efd30e47266278ef65fc864bb6 (patch) | |
tree | 090b4558661a157a52334a816accd9f7f3af4e36 /test | |
parent | a18e5aeb5bc3a3cc27dbf3d6aea37472ade72e20 (diff) | |
download | xbyak-f5fda7ace8ec04efd30e47266278ef65fc864bb6.tar.gz xbyak-f5fda7ace8ec04efd30e47266278ef65fc864bb6.zip |
change detection of pp with type
Diffstat (limited to 'test')
-rw-r--r-- | test/apx.cpp | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp index b9e6e9f..3fad2e5 100644 --- a/test/apx.cpp +++ b/test/apx.cpp @@ -618,3 +618,69 @@ CYBOZU_TEST_AUTO(bextr_etc) CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } +CYBOZU_TEST_AUTO(bit) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + // adc + adc(r20b, r21b, r22b); + adc(r20w, r21w, r22w); + adc(r20d, r21d, r22d); + adc(r20, r21, r22); + + adc(r20b, r21b); + adc(r20w, r21w); + adc(r20d, r21d); + adc(r20, r21); + + adc(r20b, r21b, 0x3); + adc(r20w, r21w, 0x3); + adc(r20d, r21d, 0x3); + adc(r20, r21, 0x3); + + adc(r20b, 0x3); + adc(r20w, 0x3); + adc(r20d, 0x3); + adc(r20, 0x3); + + // add + add(r20b, r21b, r22b); + add(r20w, r21w, r22w); + add(r20d, r21d, r22d); + add(r20, r21, r22); + add(r20b, r21b); + add(r20w, r21w); + add(r20d, r21d); + add(r20, r21); + add(r20b, r21b, 0x3); + add(r20w, r21w, 0x3); + add(r20d, r21d, 0x3); + add(r20, r21, 0x3); + add(r20b, 0x3); + add(r20w, 0x3); + add(r20d, 0x3); + add(r20, 0x3); + } + } c; + const uint8_t tbl[] = { + // adc + 0x62, 0xec, 0x5c, 0x10, 0x10, 0xf5, 0x62, 0xec, 0x5d, 0x10, 0x11, 0xf5, 0x62, 0xec, 0x5c, 0x10, + 0x11, 0xf5, 0x62, 0xec, 0xdc, 0x10, 0x11, 0xf5, 0xd5, 0x50, 0x10, 0xec, 0x66, 0xd5, 0x50, 0x11, + 0xec, 0xd5, 0x50, 0x11, 0xec, 0xd5, 0x58, 0x11, 0xec, 0x62, 0xfc, 0x5c, 0x10, 0x80, 0xd5, 0x03, + 0x62, 0xfc, 0x5d, 0x10, 0x83, 0xd5, 0x03, 0x62, 0xfc, 0x5c, 0x10, 0x83, 0xd5, 0x03, 0x62, 0xfc, + 0xdc, 0x10, 0x83, 0xd5, 0x03, 0xd5, 0x10, 0x80, 0xd4, 0x03, 0x66, 0xd5, 0x10, 0x83, 0xd4, 0x03, + 0xd5, 0x10, 0x83, 0xd4, 0x03, 0xd5, 0x18, 0x83, 0xd4, 0x03, + + // add + 0x62, 0xec, 0x5c, 0x10, 0x00, 0xf5, 0x62, 0xec, 0x5d, 0x10, 0x01, 0xf5, 0x62, 0xec, 0x5c, 0x10, + 0x01, 0xf5, 0x62, 0xec, 0xdc, 0x10, 0x01, 0xf5, 0xd5, 0x50, 0x00, 0xec, 0x66, 0xd5, 0x50, 0x01, + 0xec, 0xd5, 0x50, 0x01, 0xec, 0xd5, 0x58, 0x01, 0xec, 0x62, 0xfc, 0x5c, 0x10, 0x80, 0xc5, 0x03, + 0x62, 0xfc, 0x5d, 0x10, 0x83, 0xc5, 0x03, 0x62, 0xfc, 0x5c, 0x10, 0x83, 0xc5, 0x03, 0x62, 0xfc, + 0xdc, 0x10, 0x83, 0xc5, 0x03, 0xd5, 0x10, 0x80, 0xc4, 0x03, 0x66, 0xd5, 0x10, 0x83, 0xc4, 0x03, + 0xd5, 0x10, 0x83, 0xc4, 0x03, 0xd5, 0x18, 0x83, 0xc4, 0x03, + }; + const size_t n = sizeof(tbl); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} |