Skip to content

Add support for Apple's vendor-specific aarch64 instructions#8316

Merged
bdash merged 2 commits into
devfrom
test_aarch64_apple_extensions
Jul 15, 2026
Merged

Add support for Apple's vendor-specific aarch64 instructions#8316
bdash merged 2 commits into
devfrom
test_aarch64_apple_extensions

Conversation

@bdash

@bdash bdash commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The following instructions are disassembled and lifted to intrinsics:

  • genter #imm5
  • gexit
  • sdsb <domain>
  • wkdmc <Xd>, <Xs>
  • wkdmd <Xd>, <Xs>
  • at_as1elx <Xt>
  • mul53lo <Vd>.2d, <Vm>.2d
  • mul53hi <Vd>.2d, <Vm>.2d

Additionally, AMX instructions are disassembled but not yet lifted.

Fixes #5933.

These instructions are in encoding space that is unallocated by ARM. As we do not currently have any mechanism for architecture variants (#979) and these encodings are not currently used by any other vendor, I've opted to have Arm64Architecture decode these unconditionally.

In hopes of a better future, I've structured the code such that the vendor-specific instruction handling is entirely separate from the primary disassembler / lifting logic. When support for architecture variants is added in the future, this logic can all be moved into an Apple-specific variant.

Comment thread arch/arm64/apple_vendor.cpp
Comment thread arch/arm64/apple_vendor.cpp
Comment thread arch/arm64/apple_vendor.cpp Outdated

@plafosse plafosse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The only blocking thing here is addressing the AV_WKDMD/AV_WKDMC issue and adding a unit test containing these instructions in the core repo.

@bdash
bdash force-pushed the test_aarch64_apple_extensions branch from 2fff1d2 to 361c036 Compare July 14, 2026 20:20
@bdash
bdash requested a review from plafosse July 14, 2026 20:20

@plafosse plafosse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good now.

bdash added 2 commits July 14, 2026 17:15
The following instructions are disassembled and lifted to intrinsics:
* `genter #imm5`
* `gexit`
* `sdsb <domain>`
* `wkdmc <Xd>, <Xs>`
* `wkdmd <Xd>, <Xs>`
* `at_as1elx <Xt>`
* `mul53lo <Vd>.2d, <Vm>.2d`
* `mul53hi <Vd>.2d, <Vm>.2d`

Additionally, AMX instructions are disassembled but not yet lifted.

Fixes #5933.

These instructions are in encoding space that is unallocated by ARM. As
we do not currently have any mechanism for architecture variants
(#979) and these
encodings are not currently used by any other vendor, I've opted to have
`Arm64Architecture` decode these unconditionally.

In hopes of a better future, I've structured the code such that the
vendor-specific instruction handling is entirely separate from the
primary disassembler / lifting logic. When support for architecture
variants is added in the future, this logic can all be moved into an
Apple-specific variant.
@bdash
bdash force-pushed the test_aarch64_apple_extensions branch from 361c036 to da3ff7a Compare July 15, 2026 00:29
@bdash
bdash merged commit da3ff7a into dev Jul 15, 2026
5 checks passed
@bdash
bdash deleted the test_aarch64_apple_extensions branch July 15, 2026 00:30
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.

Add support for GENTER and GEXIT in AArch64 on Apple platforms

2 participants