aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2024-10-07 10:59:08 +0900
committerMITSUNARI Shigeo <[email protected]>2024-10-07 10:59:08 +0900
commitee42b66543b7a416eff50540cc20221beb3e7739 (patch)
treebb54ca2e20d250d00918a1cb079a3c493afc5327 /test
parent4856dcca61daaea808a4e8050e4ecf678cabd93e (diff)
downloadxbyak-ee42b66543b7a416eff50540cc20221beb3e7739.tar.gz
xbyak-ee42b66543b7a416eff50540cc20221beb3e7739.zip
add {rd,wr}{fs,gs}base
Diffstat (limited to 'test')
-rw-r--r--test/misc.cpp52
1 files changed, 51 insertions, 1 deletions
diff --git a/test/misc.cpp b/test/misc.cpp
index 1457691..a15721f 100644
--- a/test/misc.cpp
+++ b/test/misc.cpp
@@ -2284,5 +2284,55 @@ CYBOZU_TEST_AUTO(avx_vnni_int)
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
-
+CYBOZU_TEST_AUTO(rdfsbase)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ rdfsbase(rax);
+ rdfsbase(r15d);
+ rdfsbase(r30d);
+ rdfsbase(r31);
+
+ rdgsbase(rax);
+ rdgsbase(r15d);
+ rdgsbase(r30d);
+ rdgsbase(r31);
+
+ wrfsbase(rax);
+ wrfsbase(r15d);
+ wrfsbase(r30d);
+ wrfsbase(r31);
+
+ wrgsbase(rax);
+ wrgsbase(r15d);
+ wrgsbase(r30d);
+ wrgsbase(r31);
+ }
+ } c;
+ const uint8_t tbl[] = {
+ 0xf3, 0x48, 0x0f, 0xae, 0xc0,
+ 0xf3, 0x41, 0x0f, 0xae, 0xc7,
+ 0xf3, 0xd5, 0x91, 0xae, 0xc6,
+ 0xf3, 0xd5, 0x99, 0xae, 0xc7,
+
+ 0xf3, 0x48, 0x0f, 0xae, 0xc8,
+ 0xf3, 0x41, 0x0f, 0xae, 0xcf,
+ 0xf3, 0xd5, 0x91, 0xae, 0xce,
+ 0xf3, 0xd5, 0x99, 0xae, 0xcf,
+
+ 0xf3, 0x48, 0x0f, 0xae, 0xd0,
+ 0xf3, 0x41, 0x0f, 0xae, 0xd7,
+ 0xf3, 0xd5, 0x91, 0xae, 0xd6,
+ 0xf3, 0xd5, 0x99, 0xae, 0xd7,
+
+ 0xf3, 0x48, 0x0f, 0xae, 0xd8,
+ 0xf3, 0x41, 0x0f, 0xae, 0xdf,
+ 0xf3, 0xd5, 0x91, 0xae, 0xde,
+ 0xf3, 0xd5, 0x99, 0xae, 0xdf,
+ };
+ const size_t n = sizeof(tbl) / sizeof(tbl[0]);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}
#endif