aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/apx.cpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-11-15 17:19:32 +0900
committerMITSUNARI Shigeo <[email protected]>2023-11-15 17:19:32 +0900
commit045ef31a367e7709ad4d116a06a80bdb712d1852 (patch)
tree31f96529845352199ce6df29c087634f8ae5856b /test/apx.cpp
parent1d7e2a6bbde1323716ba2af36afe7e00c9046471 (diff)
downloadxbyak-045ef31a367e7709ad4d116a06a80bdb712d1852.tar.gz
xbyak-045ef31a367e7709ad4d116a06a80bdb712d1852.zip
add tests of div
Diffstat (limited to 'test/apx.cpp')
-rw-r--r--test/apx.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp
index 686f271..0de524c 100644
--- a/test/apx.cpp
+++ b/test/apx.cpp
@@ -734,3 +734,37 @@ CYBOZU_TEST_AUTO(inc_dec)
CYBOZU_TEST_EQUAL(c.getSize(), n);
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
+
+CYBOZU_TEST_AUTO(div)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ div(r20b);
+ div(r20d);
+ div(r20w);
+ div(r20);
+ div(r20|T_nf);
+ div(eax|T_nf);
+ div(byte [r20+r30*1]);
+ div(word [r20+r30*1]);
+ div(dword [r20+r30*1]);
+ div(qword [r20+r30*1]);
+ }
+ } c;
+ const uint8_t tbl[] = {
+ 0x62, 0xfc, 0x7c, 0x08, 0xf6, 0xf4,
+ 0x62, 0xfc, 0x7c, 0x08, 0xf7, 0xf4,
+ 0x62, 0xfc, 0x7d, 0x08, 0xf7, 0xf4,
+ 0x62, 0xfc, 0xfc, 0x08, 0xf7, 0xf4,
+ 0x62, 0xfc, 0xfc, 0x0c, 0xf7, 0xf4, // r20|T_nf
+ 0x62, 0xf4, 0x7c, 0x0c, 0xf7, 0xf0, // eax|T_nf
+ 0x62, 0xbc, 0x78, 0x08, 0xf6, 0x34, 0x34,
+ 0x62, 0xbc, 0x79, 0x08, 0xf7, 0x34, 0x34,
+ 0x62, 0xbc, 0x78, 0x08, 0xf7, 0x34, 0x34,
+ 0x62, 0xbc, 0xf8, 0x08, 0xf7, 0x34, 0x34,
+ };
+ const size_t n = sizeof(tbl);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}