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

AArch64 Capstone Update / SME2 support #429

Merged
merged 34 commits into from
Dec 20, 2024
Merged

AArch64 Capstone Update / SME2 support #429

merged 34 commits into from
Dec 20, 2024

Conversation

FinnWilkinson
Copy link
Contributor

@FinnWilkinson FinnWilkinson commented Sep 4, 2024

This PR updates SimEng to work with a newer release of Capstone who's AArch64 engine is based on LLVM18, hence allowing SME2 support.

The reccommended version of LLVM has also been changed to 18.1.8 and the test suite has been updated to work with this version in order to dissassemble new AArch64 instructions.

Closes Issue #349

There have been large changes to Capstone internally for AArch64, some of the main ones which effect our current development / usage include:

  • A writeback from a pre/post index load/store is now included as an implicit destination. Hence, in instruction_execute the updated base address register is resuts[0] rather than results[1] (for example).

  • Post index immediate operands are now included as part of the memory operand in mem.disp. Post indexing with a register however is added as an additional operand.

  • Aliasing can be dissabled for auto-sync architectures, and has been done for AArch64. This means expected registers for the operand are now correct and allows us to remove revertalias() from instruction_metadata completely! The only oddity is the mnemonic and operandStr are still that of the alias. This means exceptions or debugging print statements may be confusing. To indicate aliases better, an isAlias bool has been added to the metadata and exception print out.

  • Get automatic LLVM download and install working for version 18.1.8

  • Add AArch64 multi-vector operand enum decoding logic to instruction_decode

    • No longer required as multi-vector operands already give each register individually rather than using the multi-register enums

@FinnWilkinson FinnWilkinson added the enhancement New feature or request label Sep 4, 2024
@FinnWilkinson FinnWilkinson self-assigned this Sep 4, 2024
@FinnWilkinson FinnWilkinson marked this pull request as ready for review September 17, 2024 17:08
@FinnWilkinson FinnWilkinson added the 0.9.7 Part of SimEng Release 0.9.7 label Sep 17, 2024
CMakeLists.txt Show resolved Hide resolved
src/include/simeng/arch/aarch64/Instruction.hh Outdated Show resolved Hide resolved
src/lib/arch/aarch64/ExceptionHandler.cc Outdated Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Outdated Show resolved Hide resolved
src/lib/config/ModelConfig.cc Outdated Show resolved Hide resolved
@FinnWilkinson FinnWilkinson changed the title [WIP] AArch64 Capstone Update / SME2 support AArch64 Capstone Update / SME2 support Oct 2, 2024
@FinnWilkinson FinnWilkinson linked an issue Oct 24, 2024 that may be closed by this pull request
Copy link
Contributor

@jj16791 jj16791 left a comment

Choose a reason for hiding this comment

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

A fair few comments but there's a lot of work done here so expected. Great job on this, a significant amount of effort done!

CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
docs/sphinx/developer/arch/index.rst Outdated Show resolved Hide resolved
docs/sphinx/developer/arch/supported/aarch64.rst Outdated Show resolved Hide resolved
docs/sphinx/developer/arch/supported/aarch64.rst Outdated Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Outdated Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Outdated Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Outdated Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@dANW34V3R dANW34V3R left a comment

Choose a reason for hiding this comment

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

Not much to add on top of the others' comments. Will approve once theirs have been resolved

docs/sphinx/user/building_simeng.rst Outdated Show resolved Hide resolved
docs/sphinx/user/configuring_simeng.rst Outdated Show resolved Hide resolved
src/include/simeng/arch/aarch64/helpers/sve.hh Outdated Show resolved Hide resolved
src/lib/arch/aarch64/Architecture.cc Show resolved Hide resolved
src/lib/arch/riscv/InstructionMetadata.cc Show resolved Hide resolved
src/lib/arch/aarch64/Instruction_decode.cc Outdated Show resolved Hide resolved
dANW34V3R
dANW34V3R previously approved these changes Nov 11, 2024
ABenC377
ABenC377 previously approved these changes Nov 11, 2024
@FinnWilkinson FinnWilkinson dismissed stale reviews from ABenC377 and dANW34V3R via 97fb519 November 14, 2024 10:10
dANW34V3R
dANW34V3R previously approved these changes Dec 4, 2024
ABenC377
ABenC377 previously approved these changes Dec 5, 2024
@FinnWilkinson FinnWilkinson dismissed stale reviews from ABenC377 and dANW34V3R via bc91dcd December 10, 2024 16:44
ABenC377
ABenC377 previously approved these changes Dec 10, 2024
JosephMoore25
JosephMoore25 previously approved these changes Dec 12, 2024
Copy link
Contributor

@JosephMoore25 JosephMoore25 left a comment

Choose a reason for hiding this comment

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

Great work, and clean implementation. Couldn't find anything of note!

jj16791
jj16791 previously approved these changes Dec 14, 2024
ABenC377
ABenC377 previously approved these changes Dec 18, 2024
JosephMoore25
JosephMoore25 previously approved these changes Dec 18, 2024
CMakeLists.txt Outdated Show resolved Hide resolved
@FinnWilkinson FinnWilkinson dismissed stale reviews from JosephMoore25 and ABenC377 via 1f0084f December 18, 2024 15:07
@FinnWilkinson FinnWilkinson merged commit 6613d40 into dev Dec 20, 2024
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.9.7 Part of SimEng Release 0.9.7 enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add SME2 support
6 participants