Skip to content

Add LoongArch64 support#33

Merged
FRoith merged 3 commits intoics-jku:masterfrom
CSharperMantle:feat-loongarch
May 8, 2025
Merged

Add LoongArch64 support#33
FRoith merged 3 commits intoics-jku:masterfrom
CSharperMantle:feat-loongarch

Conversation

@CSharperMantle
Copy link
Copy Markdown
Contributor

@CSharperMantle CSharperMantle commented Apr 17, 2025

Add auto-generated LoongArch64 decoding tables.

The scripts and data sources used to generate the tables can be found at https://gist.github.com/CSharperMantle/7a6615aa2cfcfcf7ce344816db2dc5b3 and https://github.com/loongson/LoongArch-Documentation/blob/e0d6592229d9e00e512bd28b688a7f20b171714f/docs/LoongArch-Vol1-EN/table-of-instruction-encoding.adoc.

Preferred merging strategy: Squash.

Remark. It is not expected to work before #31 is resolved due to some mnemonics containing underscores.

Checklist

@CSharperMantle CSharperMantle marked this pull request as ready for review April 18, 2025 15:10
Copy link
Copy Markdown
Collaborator

@FRoith FRoith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, the only possible improvement I can suggest right now is more randomized test cases, since I can't easily verify the large toml file

but those can be added later too, it looks good enough to merge imo

@CSharperMantle
Copy link
Copy Markdown
Contributor Author

more randomized test cases

Talking about tests, is it okay to share some bits about how RV test cases are generated?

AFAIK LoongArch does not have a standardized testbench like https://github.com/riscv-software-src/riscv-tests, so maybe yet another script is needed.

@FRoith
Copy link
Copy Markdown
Collaborator

FRoith commented May 8, 2025

Talking about tests, is it okay to share some bits about how RV test cases are generated?

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.

@FRoith
Copy link
Copy Markdown
Collaborator

FRoith commented May 8, 2025

but if it's alright, I will merge this in a few minutes

@CSharperMantle
Copy link
Copy Markdown
Contributor Author

I think I will add generated tests in a later, separate PR. So glad that this one can 🚀!

@FRoith FRoith merged commit bb6dc7a into ics-jku:master May 8, 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