Skip to content

Commit

Permalink
add crc32 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Nov 20, 2023
1 parent 92153b6 commit e43d997
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/apx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@ CYBOZU_TEST_AUTO(base)
CYBOZU_TEST_EQUAL_ARRAY(c.getCode(), tbl, n);
}

CYBOZU_TEST_AUTO(mov)
CYBOZU_TEST_AUTO(mov_misc)
{
struct Code : Xbyak::CodeGenerator {
Code()
Expand All @@ -1050,6 +1050,11 @@ CYBOZU_TEST_AUTO(mov)
movbe(r30d, ptr [r16]);
movbe(r30, ptr [r16]);

crc32(r30d, r8b);
crc32(r30d, r8w);
crc32(r30d, r8d);
crc32(r30, r8b);
crc32(r30, r8);
}
} c;
const uint8_t tbl[] = {
Expand All @@ -1061,6 +1066,9 @@ CYBOZU_TEST_AUTO(mov)
0x62, 0x6c, 0x7d, 0x08, 0x61, 0x30, 0x62, 0x6c, 0x7c, 0x08, 0x61, 0x30, 0x62, 0x6c, 0xfc, 0x08,
0x61, 0x30, 0x62, 0x6c, 0x7d, 0x08, 0x60, 0x30, 0x62, 0x6c, 0x7c, 0x08, 0x60, 0x30, 0x62, 0x6c,
0xfc, 0x08, 0x60, 0x30,
// crc32
0x62, 0x44, 0x7c, 0x08, 0xf0, 0xf0, 0x62, 0x44, 0x7d, 0x08, 0xf1, 0xf0, 0x62, 0x44, 0x7c, 0x08,
0xf1, 0xf0, 0x62, 0x44, 0xfc, 0x08, 0xf0, 0xf0, 0x62, 0x44, 0xfc, 0x08, 0xf1, 0xf0,
};
const size_t n = sizeof(tbl);
CYBOZU_TEST_EQUAL(c.getSize(), n);
Expand Down

0 comments on commit e43d997

Please sign in to comment.