diff options
author | MITSUNARI Shigeo <[email protected]> | 2022-04-05 17:30:23 +0900 |
---|---|---|
committer | MITSUNARI Shigeo <[email protected]> | 2022-04-05 17:30:23 +0900 |
commit | fb953284babb1306dfc8817ee497659417c938d3 (patch) | |
tree | c20ef9e16079a249858c2548cee9bf82ca7b584a /test | |
parent | 4e8214ca24030dfd4d9061b5aaed0d6b94df2efd (diff) | |
parent | dbd96b277e858a5e42af86accc4d7ca6c343da84 (diff) | |
download | xbyak-6.04.tar.gz xbyak-6.04.zip |
Merge branch 'dev'v6.04
Diffstat (limited to 'test')
-rw-r--r-- | test/make_nm.cpp | 1 | ||||
-rw-r--r-- | test/misc.cpp | 38 |
2 files changed, 37 insertions, 2 deletions
diff --git a/test/make_nm.cpp b/test/make_nm.cpp index c26394a..e1cf112 100644 --- a/test/make_nm.cpp +++ b/test/make_nm.cpp @@ -1519,6 +1519,7 @@ class Test { put("pextrq", REG64|MEM, XMM, IMM); put("pinsrq", XMM, REG64|MEM, IMM); #endif + } void putSHA() const { diff --git a/test/misc.cpp b/test/misc.cpp index 92227cd..f46239b 100644 --- a/test/misc.cpp +++ b/test/misc.cpp @@ -102,8 +102,8 @@ CYBOZU_TEST_AUTO(mov_const) CYBOZU_TEST_NO_EXCEPTION(mov(rax, ptr[(void*)0x80000000])); CYBOZU_TEST_NO_EXCEPTION(mov(rax, ptr[(void*)0xffffffff])); #else - CYBOZU_TEST_EXCEPTION(mov(rax, ptr[(void*)0x80000000]), Xbyak::Error); - CYBOZU_TEST_EXCEPTION(mov(rax, ptr[(void*)0xffffffff]), Xbyak::Error); + CYBOZU_TEST_EXCEPTION(mov(rax, ptr[(void*)0x80000000ull]), Xbyak::Error); + CYBOZU_TEST_EXCEPTION(mov(rax, ptr[(void*)0xffffffffull]), Xbyak::Error); #endif #endif } @@ -1890,3 +1890,37 @@ CYBOZU_TEST_AUTO(vaddph) CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); } #endif + +CYBOZU_TEST_AUTO(waitpkg) +{ + struct Code : Xbyak::CodeGenerator { + Code() + { + tpause(eax); + tpause(ebx); +#ifdef XBYAK32 + umonitor(cx); + umonitor(ecx); +#else + umonitor(ecx); + umonitor(rcx); +#endif + umwait(eax); + umwait(ebx); + } + } c; + const uint8_t tbl[] = { + // tpause + 0x66, 0x0f, 0xae, 0xf0, + 0x66, 0x0f, 0xae, 0xf3, + // umonitor + 0x67, 0xf3, 0x0f, 0xae, 0xf1, + 0xf3, 0x0f, 0xae, 0xf1, + // tpause + 0xf2, 0x0f, 0xae, 0xf0, + 0xf2, 0x0f, 0xae, 0xf3, + }; + const size_t n = sizeof(tbl) / sizeof(tbl[0]); + CYBOZU_TEST_EQUAL(c.getSize(), n); + CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n); +} |