aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/apx.cpp
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-11-12 17:35:23 +0900
committerMITSUNARI Shigeo <[email protected]>2023-11-12 17:35:23 +0900
commitf55f596ad20599ecd93651c0b7a69bbf34930ab3 (patch)
tree181f284eaf8bf3713c20b1af7feb8e34381e59e8 /test/apx.cpp
parent6f6423899b61d470a88418db8feda7d2a0b4a4b5 (diff)
downloadxbyak-f55f596ad20599ecd93651c0b7a69bbf34930ab3.tar.gz
xbyak-f55f596ad20599ecd93651c0b7a69bbf34930ab3.zip
add inc test
Diffstat (limited to 'test/apx.cpp')
-rw-r--r--test/apx.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp
index 3fad2e5..9d0e219 100644
--- a/test/apx.cpp
+++ b/test/apx.cpp
@@ -684,3 +684,33 @@ CYBOZU_TEST_AUTO(bit)
CYBOZU_TEST_EQUAL(c.getSize(), n);
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
+
+CYBOZU_TEST_AUTO(inc_dec)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ inc(r30b);
+ inc(r30w);
+ inc(r30d);
+ inc(r30);
+ inc(r30b, r31b);
+ inc(r30w, r31w);
+ inc(r30w|T_nf, r31w);
+ inc(r30d, r31d);
+ inc(r30, r31);
+ inc(r30, ptr [r31]);
+ }
+ } c;
+ const uint8_t tbl[] = {
+ 0xd5, 0x11, 0xfe, 0xc6, 0x66, 0xd5, 0x11, 0xff, 0xc6, 0xd5, 0x11, 0xff, 0xc6, 0xd5, 0x19, 0xff,
+ 0xc6, 0x62, 0xdc, 0x0c, 0x10, 0xfe, 0xc7,
+ 0x62, 0xdc, 0x0d, 0x10, 0xff, 0xc7,
+ 0x62, 0xdc, 0x0d, 0x14, 0xff, 0xc7, // T_nf
+ 0x62, 0xdc, 0x0c, 0x10, 0xff, 0xc7, 0x62, 0xdc, 0x8c, 0x10, 0xff, 0xc7, 0x62,
+ 0xdc, 0x8c, 0x10, 0xff, 0x07,
+ };
+ const size_t n = sizeof(tbl);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}