add tests of kmov*

This commit is contained in:
MITSUNARI Shigeo 2023-11-30 21:20:18 +09:00
parent bd85d108ca
commit 944438195b

View file

@ -1714,3 +1714,42 @@ CYBOZU_TEST_AUTO(evex_misc)
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}
CYBOZU_TEST_AUTO(kmov)
{
struct Code : Xbyak::CodeGenerator {
Code()
{
kmovb(k1, ptr [r20]);
kmovb(k2, r21d);
kmovb(ptr [r22], k3);
kmovb(r23d, k4);
kmovw(k1, ptr [r20]);
kmovw(k2, r21d);
kmovw(ptr [r22], k3);
kmovw(r23d, k4);
kmovd(k1, ptr [r20]);
kmovd(k2, r21d);
kmovd(ptr [r22], k3);
kmovd(r23d, k4);
kmovq(k1, ptr [r20]);
kmovq(k2, r21);
kmovq(ptr [r22], k3);
kmovq(r23, k4);
}
} c;
const uint8_t tbl[] = {
0x62, 0xf9, 0x7d, 0x08, 0x90, 0x0c, 0x24, 0x62, 0xf9, 0x7d, 0x08, 0x92, 0xd5, 0x62, 0xf9, 0x7d,
0x08, 0x91, 0x1e, 0x62, 0xe1, 0x7d, 0x08, 0x93, 0xfc, 0x62, 0xf9, 0x7c, 0x08, 0x90, 0x0c, 0x24,
0x62, 0xf9, 0x7c, 0x08, 0x92, 0xd5, 0x62, 0xf9, 0x7c, 0x08, 0x91, 0x1e, 0x62, 0xe1, 0x7c, 0x08,
0x93, 0xfc, 0x62, 0xf9, 0xfd, 0x08, 0x90, 0x0c, 0x24, 0x62, 0xf9, 0x7f, 0x08, 0x92, 0xd5, 0x62,
0xf9, 0xfd, 0x08, 0x91, 0x1e, 0x62, 0xe1, 0x7f, 0x08, 0x93, 0xfc, 0x62, 0xf9, 0xfc, 0x08, 0x90,
0x0c, 0x24, 0x62, 0xf9, 0xff, 0x08, 0x92, 0xd5, 0x62, 0xf9, 0xfc, 0x08, 0x91, 0x1e, 0x62, 0xe1,
0xff, 0x08, 0x93, 0xfc,
};
const size_t n = sizeof(tbl);
CYBOZU_TEST_EQUAL(c.getSize(), n);
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}