Skip to content

Commit

Permalink
add tests o idiv
Browse files Browse the repository at this point in the history
  • Loading branch information
herumi committed Nov 16, 2023
1 parent 045ef31 commit 790afb7
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/apx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,18 @@ CYBOZU_TEST_AUTO(div)
div(word [r20+r30*1]);
div(dword [r20+r30*1]);
div(qword [r20+r30*1]);

idiv(r20b);
idiv(r20d);
idiv(r20w);
idiv(r20);
idiv(r20|T_nf);
idiv(eax|T_nf);
idiv(byte [r20+r30*1]);
idiv(word [r20+r30*1]);
idiv(dword [r20+r30*1]);
idiv(qword [r20+r30*1]);

}
} c;
const uint8_t tbl[] = {
Expand All @@ -763,6 +775,12 @@ CYBOZU_TEST_AUTO(div)
0x62, 0xbc, 0x79, 0x08, 0xf7, 0x34, 0x34,
0x62, 0xbc, 0x78, 0x08, 0xf7, 0x34, 0x34,
0x62, 0xbc, 0xf8, 0x08, 0xf7, 0x34, 0x34,

0x62, 0xfc, 0x7c, 0x08, 0xf6, 0xfc, 0x62, 0xfc, 0x7c, 0x08, 0xf7, 0xfc, 0x62, 0xfc, 0x7d, 0x08,
0xf7, 0xfc, 0x62, 0xfc, 0xfc, 0x08, 0xf7, 0xfc, 0x62, 0xfc, 0xfc, 0x0c, 0xf7, 0xfc, 0x62, 0xf4,
0x7c, 0x0c, 0xf7, 0xf8, 0x62, 0xbc, 0x78, 0x08, 0xf6, 0x3c, 0x34, 0x62, 0xbc, 0x79, 0x08, 0xf7,
0x3c, 0x34, 0x62, 0xbc, 0x78, 0x08, 0xf7, 0x3c, 0x34, 0x62, 0xbc, 0xf8, 0x08, 0xf7, 0x3c, 0x34,

};
const size_t n = sizeof(tbl);
CYBOZU_TEST_EQUAL(c.getSize(), n);
Expand Down

0 comments on commit 790afb7

Please sign in to comment.