Skip to content

Migrate arm64 disassembler implementation to AsmArm64 #3246

Description

@filzrev

Currently, BenchmarkDotNet using Gee.External.Capstone package for arm64 disassembler.
And Iced for x86/x64 disassemblers.

Gee.External.Capstone package contains a lot of native dependency DLLs.
So It's better to migrate to use AsmArm64.

Support newer instruction

Currently, Gee.External.Capstone using capstone v4.0.2 binaries. and it looks like some instruction support are missing.

On .NET 11, arm64 minimum instruction requirement is updated.
So it might need to handle additional instructions that are emitted by JIT.
https://github.com/dotnet/docs/blob/main/docs/core/whats-new/dotnet-11/runtime.md#arm64-requirements

e.g. .NET 11 JIT looks like emitting RETAA/RETBB, but current Gee.External.Capstone can't handle these instructions.
https://github.com/dotnet/runtime/blob/7e807becb8c6b1917dac0565c674ade7947a8bec/src/coreclr/jit/instrsarm64.h#L1321C21-L1324

Known Issues when migrated to AsmArm64

  • Currently AsmArm64 don't support SVE/SVE2/SME instruction. (Gee.External.Capstone also doesn't support these instruction though)
  • Disassembler results has some differences (e.g. instructions are resolved to alias (MOVZ is printed as MOV automatically))

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions