Skip to content
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

Open
derekbruening opened this issue May 26, 2017 · 4 comments
Open

add exhaustive AArch64 decoder/encoder/macro consistency tests #2443

derekbruening opened this issue May 26, 2017 · 4 comments

Comments

@derekbruening
Copy link
Contributor

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.

derekbruening added a commit that referenced this issue Jun 1, 2017
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.
@derekbruening
Copy link
Contributor Author

Xref #2440

@egrimley
Copy link
Contributor

egrimley commented Jun 6, 2017

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.

@derekbruening
Copy link
Contributor Author

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.

@egrimley
Copy link
Contributor

egrimley commented Jun 6, 2017

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).

AssadHashmi added a commit that referenced this issue Nov 18, 2021
This adds immediate and register variants of CCMP and CCMN to the
codec. The implementation also addresses the issues raised in
PR4500.

Issues: #2440, #2443, #2626
AssadHashmi added a commit that referenced this issue Nov 23, 2021
)

This adds immediate and register variants of CCMP and CCMN to the
codec. The implementation also addresses the issues raised in
PR #4500.

Issues: #2440, #2443, #2626
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants