EgorBo / Disasmo

VS2022 Add-in. Click on any method or class to see what .NET Core's JIT generates for them (ASM).
MIT License
638 stars 39 forks source link

Mnemonics missing as syntax keywords #50

Open hopperpl opened 7 months ago

hopperpl commented 7 months ago

Found a few mnemonics that are not correctly syntax highlighted

pshufb, palignr, .... maybe more. it's from the SSSE3 group.

image

EgorBo commented 7 months ago

Thanks, yeah, I need to find a list somewhere and add them to https://github.com/EgorBo/Disasmo/blob/main/src/Vsix/Resources/AsmSyntax.xshd

same on arm64

hopperpl commented 7 months ago

https://github.com/yasm/yasm/blob/master/modules/arch/x86/gen_x86_insn.py

and then with a regular expression to extract mnemonics... Pattern is add_insn\("(\w+)",

I use this file to pull information about mnemonic feature flags, but to get all mnemonic names this should be useful too. Unfortunately, there is no AVX-512 in yasm.

Maybe gas (gnu assembler) has a complete mnemonic list, for arm as well. All other assemblers nowadays are pretty much dead.


or clang/llvm

they have instruction definitions in their .td files

https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/X86/X86InstrAVX512.td https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/ARM/ARMInstrNEON.td

it's a bit more complicated but should work as well to at least pull mnemonic names out of the files