Skip to content

No Support for Later x86 Instructions (including AMX) #2503

@matthew-olson-intel

Description

@matthew-olson-intel

Work environment

Questions Answers
OS/arch/bits Arch Linux x86_64
Architecture x86
Source of Capstone git clone
Version/git commit latest next

Expected behavior

Capstone should disassemble, e.g., AMX instructions.

Actual behavior

It fails to disassemble AMX instructions. Updating the LLVM tables seems to be failing for later versions of LLVM, and we need to work through the various errors.

Steps to reproduce the behavior

[Listed below]

Additional Logs, screenshots, source code, configuration dump, ...

I've noticed that the TableGen scripts in suite/synctools/tablegen were out-of-date (for example, more recent versions of x86.td include a line like this:

def FeatureAMXTILE     : SubtargetFeature<"amx-tile", "HasAMXTILE", "true",
                                      "Support AMX-TILE instructions">;

So it seems as if simply upgrading the those scripts, along with the headers in suite/synctools/tablegen/include, and re-generating all of the .inc files, should do the trick.

Toward that end, I cloned a fresh copy of LLVM 18.1.8 (the same version as is available in Arch Linux, but I don't mind using earlier versions if there's a specific version that we should ultimately commit to), copied the llvm-project/llvm/include and llvm-project/llvm/lib/Target/X86/ directories into tablegen, and re-ran the scripts according to the README.

Currently I'm stuck on Step 3 of the suite/synctools/README, where building strinforeduce/strinforeduce.cpp fails due to the namespace MCID being undefined. Please advise!

Metadata

Metadata

Assignees

No one assigned

    Labels

    X86Archoutdated-moduleIssue due to an outdated arch module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions