aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <[email protected]>2023-11-23 10:35:54 +0900
committerMITSUNARI Shigeo <[email protected]>2023-11-23 10:35:54 +0900
commitc4d05037e254eee3aae808e1c4794ce1b22d45e4 (patch)
tree25e35471e6cf447346b3cf83029fbe0ad70473f3 /test
parent17f7d279c8bad265b7de16f8bc74c3934ceae5ce (diff)
downloadxbyak-c4d05037e254eee3aae808e1c4794ce1b22d45e4.tar.gz
xbyak-c4d05037e254eee3aae808e1c4794ce1b22d45e4.zip
add ccmpscc
Diffstat (limited to 'test')
-rw-r--r--test/apx.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/apx.cpp b/test/apx.cpp
index 080dcc1..ea5afff 100644
--- a/test/apx.cpp
+++ b/test/apx.cpp
@@ -1461,3 +1461,60 @@ CYBOZU_TEST_AUTO(push2_pop2)
CYBOZU_TEST_EQUAL(c.getSize(), n);
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
+
+CYBOZU_TEST_AUTO(ccmp)
+{
+ struct Code : Xbyak::CodeGenerator {
+ Code()
+ {
+ ccmpb(rax, rbx, 0);
+ ccmpb(r30b, r31b, 1);
+ ccmpb(r30w, r31w, 2);
+ ccmpb(r30d, r31d, 3);
+ ccmpb(r30, r31, 4);
+ ccmpb(ptr [r30], r31b, 5);
+ ccmpb(ptr [r30], r31w, 6);
+ ccmpb(ptr [r30], r31d, 7);
+ ccmpb(ptr [r30], r31, 8);
+ ccmpb(r31b, ptr [r30], 9);
+ ccmpb(r31w, ptr [r30], 10);
+ ccmpb(r31d, ptr [r30], 11);
+ ccmpb(r31, ptr [r30], 12);
+
+ ccmpo(rax, rcx, 0);
+ ccmpno(rax, rcx, 1);
+ ccmpb(rax, rcx, 2);
+ ccmpnb(rax, rcx, 3);
+ ccmpz(rax, rcx, 4);
+ ccmpnz(rax, rcx, 5);
+ ccmpbe(rax, rcx, 6);
+ ccmpnbe(rax, rcx, 7);
+ ccmps(rax, rcx, 8);
+ ccmpns(rax, rcx, 9);
+ ccmpt(rax, rcx, 10);
+ ccmpf(rax, rcx, 11);
+ ccmpl(rax, rcx, 12);
+ ccmpnl(rax, rcx, 13);
+ ccmple(rax, rcx, 14);
+ ccmpnle(rax, rcx, 15);
+ }
+ } c;
+ const uint8_t tbl[] = {
+ // ccmpb
+ 0x62, 0xf4, 0x84, 0x02, 0x39, 0xd8, 0x62, 0x4c, 0x0c, 0x02, 0x38, 0xfe, 0x62, 0x4c, 0x15, 0x02,
+ 0x39, 0xfe, 0x62, 0x4c, 0x1c, 0x02, 0x39, 0xfe, 0x62, 0x4c, 0xa4, 0x02, 0x39, 0xfe, 0x62, 0x4c,
+ 0x2c, 0x02, 0x38, 0x3e, 0x62, 0x4c, 0x35, 0x02, 0x39, 0x3e, 0x62, 0x4c, 0x3c, 0x02, 0x39, 0x3e,
+ 0x62, 0x4c, 0xc4, 0x02, 0x39, 0x3e, 0x62, 0x4c, 0x4c, 0x02, 0x3a, 0x3e, 0x62, 0x4c, 0x55, 0x02,
+ 0x3b, 0x3e, 0x62, 0x4c, 0x5c, 0x02, 0x3b, 0x3e, 0x62, 0x4c, 0xe4, 0x02, 0x3b, 0x3e,
+ // all
+ 0x62, 0xf4, 0x84, 0x00, 0x39, 0xc8, 0x62, 0xf4, 0x8c, 0x01, 0x39, 0xc8, 0x62, 0xf4, 0x94, 0x02,
+ 0x39, 0xc8, 0x62, 0xf4, 0x9c, 0x03, 0x39, 0xc8, 0x62, 0xf4, 0xa4, 0x04, 0x39, 0xc8, 0x62, 0xf4,
+ 0xac, 0x05, 0x39, 0xc8, 0x62, 0xf4, 0xb4, 0x06, 0x39, 0xc8, 0x62, 0xf4, 0xbc, 0x07, 0x39, 0xc8,
+ 0x62, 0xf4, 0xc4, 0x08, 0x39, 0xc8, 0x62, 0xf4, 0xcc, 0x09, 0x39, 0xc8, 0x62, 0xf4, 0xd4, 0x0a,
+ 0x39, 0xc8, 0x62, 0xf4, 0xdc, 0x0b, 0x39, 0xc8, 0x62, 0xf4, 0xe4, 0x0c, 0x39, 0xc8, 0x62, 0xf4,
+ 0xec, 0x0d, 0x39, 0xc8, 0x62, 0xf4, 0xf4, 0x0e, 0x39, 0xc8, 0x62, 0xf4, 0xfc, 0x0f, 0x39, 0xc8,
+ };
+ const size_t n = sizeof(tbl);
+ CYBOZU_TEST_EQUAL(c.getSize(), n);
+ CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
+}