Skip to content

Add generated LA64 test cases#34

Merged
FRoith merged 2 commits intoics-jku:masterfrom
CSharperMantle:feat-la64-more-tests
Jun 3, 2025
Merged

Add generated LA64 test cases#34
FRoith merged 2 commits intoics-jku:masterfrom
CSharperMantle:feat-la64-more-tests

Conversation

@CSharperMantle
Copy link
Copy Markdown
Contributor

@CSharperMantle CSharperMantle commented May 27, 2025

This PR adds LA64 tests generated by https://gist.github.com/CSharperMantle/7a6615aa2cfcfcf7ce344816db2dc5b3#file-gen_test-py. This covers all instruction mnemonics, with 10 cases for each instruction.

This test matches the output of:

$ loongarch64-linux-gnu-objdump -b binary -m Loongarch64 -D --no-addresses --show-raw-insn --disassembler-options=no-aliases ./tests.bin

Preferred merge strategy: Squash.

Context

I generated tests by identifying the variable parts of every Instruction, and generating a couple of random bit patterns I could then decode with objdump (or whatever decompiler you want the instructions to match), parse the result and create the tests that way.

Originally posted by @FRoith in #33 (comment)

@CSharperMantle CSharperMantle marked this pull request as draft May 27, 2025 12:04
@CSharperMantle
Copy link
Copy Markdown
Contributor Author

CSharperMantle commented May 27, 2025

The current test generator creates duplicated entries for instructions with less than 10 variants.

06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn
06483800 ertn

A fix is underway.


Update: Done.

@CSharperMantle CSharperMantle marked this pull request as ready for review May 27, 2025 13:05
@FRoith
Copy link
Copy Markdown
Collaborator

FRoith commented Jun 3, 2025

looks good!

@FRoith FRoith merged commit f016312 into ics-jku:master Jun 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants