Migrate arm64 disassembler implementation to AsmArm64
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.Capstonealso doesn't support these instruction though) Disassembler results has some differences (e.g. instructions are resolved to alias (MOVZis printed asMOVautomatically))
Source: dotnet/BenchmarkDotNet