aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/misc.cpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2022-04-05 17:30:23 +0900
committerMITSUNARI Shigeo <[email protected]>2022-04-05 17:30:23 +0900
commitfb953284babb1306dfc8817ee497659417c938d3 (patch)
treec20ef9e16079a249858c2548cee9bf82ca7b584a /test/misc.cpp
parent4e8214ca24030dfd4d9061b5aaed0d6b94df2efd (diff)
parentdbd96b277e858a5e42af86accc4d7ca6c343da84 (diff)
downloadxbyak-6.04.tar.gz
xbyak-6.04.zip
Merge branch 'dev'v6.04
Diffstat (limited to 'test/misc.cpp')
-rw-r--r--test/misc.cpp38
1 files changed, 36 insertions, 2 deletions
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);
+}