aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-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);
+}