Skip to content

Support for x86_64 APX extensions #8977

@CUB3D

Description

@CUB3D

APX (Advanced Performance eXtensions) is an expansion to the x86_64 instruction set that adds 16 additional GPRs and a new REX2 instruction prefix. Hardware with support for this extension is predicted to be launched later this year and sufficiently modern compilers already support the new extensions. Currently Ghidra cannot dissassemble instructions that use these new prefixes.

The official introduction can be found here
With the spec available here

Here is an example binary that demonstrates these new instruction forms:

Source code
int main() {
        asm("INC %r16");
        asm("OR %r16, %r17, %r18");
        asm("PUSH2 %r30, %r31");
        asm("PUSH2P %r30, %r31");
        asm("POP2 %r30, %r31");
        asm("RORX $5, %r21, %r20");
        asm("POPCNTq (%r18), %r21");
        asm("SUB %r16, %r17, %r18");
        asm("RDMSR $123, %r16");
        return 0;
}

Compile with: clang test.c (tested with clang 21.1.8, older versions may not support these instructions)

apx.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions