-
Notifications
You must be signed in to change notification settings - Fork 562
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add exhaustive AArch64 decoder/encoder/macro consistency tests #2443
Comments
Adds three new cross-platform instruction creation macros, XINST_CREATE_add_sll(), XINST_CREATE_jump_cond() and XINST_CREATE_slr_s(), for use in drcachesim. For XINST_CREATE_jump_cond(), we add aliases so that the same DR_PRED_* constants can be used for x86 as are used on aarchxx. Adds x86 tests. The infrastructure for easily adding ARM (#1686) and AArch64 (#2443) tests is still missing, unfortunately.
Xref #2440 |
Do the tests of XINST_CREATE macros have to be architecture-specific? It might be better if they weren't. At the moment it is perhaps not always clear what kinds of operand are allowed (register or immediate), what range of immediate values, and so on. Note that we already have "api.dis-a64" for testing the A64 encoder and decoder, without the macros. |
Sure, some of the XINST could be shared. The api.dis test is a decoding and disassembly test, comparing the DR decoder/disassembler to other disassemblers using a moderately large, relatively random binary input and comparing the output to what other tools agree on. At least that's what it is for both x86 and ARM. The api.ir test that this issue covers is an internal self-consistency test that systematically goes through every INSTR_CREATE macro with every type variation and ensures it can encode and be decoded back and that all varieties of decoder agree (fast and slow). It says nothing about agreeing with a ground truth: only internal consistency, but it systematically covers the full IR, whereas the decode-this-binary api.dis test only covers what happens to be in the binary input. |
The test "api.dis-a64" has a big set of cases (dis-a64.txt) and checks encoder and decoder (dis-a64.c). It doesn't check different varieties of decoder because those aren't implemented yet (i#2374). |
For x86 we have exhaustive tests of every INSTR_CREATE and XINST_CREATE
macro with self-consistency tests that the decoder and encoder agree on
everything.
For ARM we are still missing this: #1686.
This issue covers adding such tests for AArch64.
Without these tests, it is fragile to add new XINST_CREATE macros: we have
no idea whether they work.
The text was updated successfully, but these errors were encountered: