hexcore-capstone 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +26 -0
- package/README.md +191 -0
- package/binding.gyp +168 -0
- package/deps/capstone/LEB128.h +38 -0
- package/deps/capstone/MCDisassembler.h +14 -0
- package/deps/capstone/MCFixedLenDisassembler.h +32 -0
- package/deps/capstone/MCInst.c +270 -0
- package/deps/capstone/MCInst.h +165 -0
- package/deps/capstone/MCInstrDesc.c +41 -0
- package/deps/capstone/MCInstrDesc.h +167 -0
- package/deps/capstone/MCRegisterInfo.c +151 -0
- package/deps/capstone/MCRegisterInfo.h +116 -0
- package/deps/capstone/Mapping.c +254 -0
- package/deps/capstone/Mapping.h +174 -0
- package/deps/capstone/MathExtras.h +442 -0
- package/deps/capstone/SStream.c +181 -0
- package/deps/capstone/SStream.h +40 -0
- package/deps/capstone/arch/AArch64/AArch64AddressingModes.h +945 -0
- package/deps/capstone/arch/AArch64/AArch64BaseInfo.c +77 -0
- package/deps/capstone/arch/AArch64/AArch64BaseInfo.h +585 -0
- package/deps/capstone/arch/AArch64/AArch64Disassembler.c +2280 -0
- package/deps/capstone/arch/AArch64/AArch64Disassembler.h +18 -0
- package/deps/capstone/arch/AArch64/AArch64GenAsmWriter.inc +26589 -0
- package/deps/capstone/arch/AArch64/AArch64GenDisassemblerTables.inc +27322 -0
- package/deps/capstone/arch/AArch64/AArch64GenInstrInfo.inc +13194 -0
- package/deps/capstone/arch/AArch64/AArch64GenRegisterInfo.inc +3814 -0
- package/deps/capstone/arch/AArch64/AArch64GenRegisterName.inc +714 -0
- package/deps/capstone/arch/AArch64/AArch64GenRegisterV.inc +673 -0
- package/deps/capstone/arch/AArch64/AArch64GenSubtargetInfo.inc +229 -0
- package/deps/capstone/arch/AArch64/AArch64GenSystemOperands.inc +2863 -0
- package/deps/capstone/arch/AArch64/AArch64GenSystemOperands_enum.inc +21 -0
- package/deps/capstone/arch/AArch64/AArch64InstPrinter.c +3029 -0
- package/deps/capstone/arch/AArch64/AArch64InstPrinter.h +28 -0
- package/deps/capstone/arch/AArch64/AArch64Mapping.c +883 -0
- package/deps/capstone/arch/AArch64/AArch64Mapping.h +43 -0
- package/deps/capstone/arch/AArch64/AArch64MappingInsn.inc +37790 -0
- package/deps/capstone/arch/AArch64/AArch64MappingInsnName.inc +1282 -0
- package/deps/capstone/arch/AArch64/AArch64MappingInsnOp.inc +26994 -0
- package/deps/capstone/arch/AArch64/AArch64Module.c +44 -0
- package/deps/capstone/arch/AArch64/AArch64Module.h +12 -0
- package/deps/capstone/arch/ARM/ARMAddressingModes.h +698 -0
- package/deps/capstone/arch/ARM/ARMBaseInfo.h +486 -0
- package/deps/capstone/arch/ARM/ARMDisassembler.c +5763 -0
- package/deps/capstone/arch/ARM/ARMDisassembler.h +18 -0
- package/deps/capstone/arch/ARM/ARMGenAsmWriter.inc +9545 -0
- package/deps/capstone/arch/ARM/ARMGenDisassemblerTables.inc +15185 -0
- package/deps/capstone/arch/ARM/ARMGenInstrInfo.inc +6632 -0
- package/deps/capstone/arch/ARM/ARMGenRegisterInfo.inc +2102 -0
- package/deps/capstone/arch/ARM/ARMGenRegisterName.inc +231 -0
- package/deps/capstone/arch/ARM/ARMGenRegisterName_digit.inc +231 -0
- package/deps/capstone/arch/ARM/ARMGenSubtargetInfo.inc +162 -0
- package/deps/capstone/arch/ARM/ARMGenSystemRegister.inc +270 -0
- package/deps/capstone/arch/ARM/ARMInstPrinter.c +3364 -0
- package/deps/capstone/arch/ARM/ARMInstPrinter.h +43 -0
- package/deps/capstone/arch/ARM/ARMMapping.c +551 -0
- package/deps/capstone/arch/ARM/ARMMapping.h +40 -0
- package/deps/capstone/arch/ARM/ARMMappingInsn.inc +18772 -0
- package/deps/capstone/arch/ARM/ARMMappingInsnName.inc +475 -0
- package/deps/capstone/arch/ARM/ARMMappingInsnOp.inc +10729 -0
- package/deps/capstone/arch/ARM/ARMModule.c +63 -0
- package/deps/capstone/arch/ARM/ARMModule.h +12 -0
- package/deps/capstone/arch/BPF/BPFConstants.h +88 -0
- package/deps/capstone/arch/BPF/BPFDisassembler.c +464 -0
- package/deps/capstone/arch/BPF/BPFDisassembler.h +27 -0
- package/deps/capstone/arch/BPF/BPFInstPrinter.c +285 -0
- package/deps/capstone/arch/BPF/BPFInstPrinter.h +16 -0
- package/deps/capstone/arch/BPF/BPFMapping.c +513 -0
- package/deps/capstone/arch/BPF/BPFMapping.h +21 -0
- package/deps/capstone/arch/BPF/BPFModule.c +34 -0
- package/deps/capstone/arch/BPF/BPFModule.h +12 -0
- package/deps/capstone/arch/EVM/EVMDisassembler.c +379 -0
- package/deps/capstone/arch/EVM/EVMDisassembler.h +12 -0
- package/deps/capstone/arch/EVM/EVMInstPrinter.c +20 -0
- package/deps/capstone/arch/EVM/EVMInstPrinter.h +17 -0
- package/deps/capstone/arch/EVM/EVMMapping.c +344 -0
- package/deps/capstone/arch/EVM/EVMMapping.h +8 -0
- package/deps/capstone/arch/EVM/EVMMappingInsn.inc +259 -0
- package/deps/capstone/arch/EVM/EVMModule.c +33 -0
- package/deps/capstone/arch/EVM/EVMModule.h +12 -0
- package/deps/capstone/arch/M680X/M680XDisassembler.c +2307 -0
- package/deps/capstone/arch/M680X/M680XDisassembler.h +17 -0
- package/deps/capstone/arch/M680X/M680XDisassemblerInternals.h +57 -0
- package/deps/capstone/arch/M680X/M680XInstPrinter.c +360 -0
- package/deps/capstone/arch/M680X/M680XInstPrinter.h +25 -0
- package/deps/capstone/arch/M680X/M680XModule.c +77 -0
- package/deps/capstone/arch/M680X/M680XModule.h +12 -0
- package/deps/capstone/arch/M680X/cpu12.inc +335 -0
- package/deps/capstone/arch/M680X/hcs08.inc +60 -0
- package/deps/capstone/arch/M680X/hd6301.inc +15 -0
- package/deps/capstone/arch/M680X/hd6309.inc +259 -0
- package/deps/capstone/arch/M680X/insn_props.inc +367 -0
- package/deps/capstone/arch/M680X/m6800.inc +277 -0
- package/deps/capstone/arch/M680X/m6801.inc +39 -0
- package/deps/capstone/arch/M680X/m6805.inc +277 -0
- package/deps/capstone/arch/M680X/m6808.inc +91 -0
- package/deps/capstone/arch/M680X/m6809.inc +352 -0
- package/deps/capstone/arch/M680X/m6811.inc +105 -0
- package/deps/capstone/arch/M68K/M68KDisassembler.c +3668 -0
- package/deps/capstone/arch/M68K/M68KDisassembler.h +30 -0
- package/deps/capstone/arch/M68K/M68KInstPrinter.c +387 -0
- package/deps/capstone/arch/M68K/M68KInstPrinter.h +21 -0
- package/deps/capstone/arch/M68K/M68KInstructionTable.inc +65540 -0
- package/deps/capstone/arch/M68K/M68KModule.c +42 -0
- package/deps/capstone/arch/M68K/M68KModule.h +12 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXDisassembler.c +544 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXDisassembler.h +22 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXDisassemblerInternals.h +23 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXModule.c +79 -0
- package/deps/capstone/arch/MOS65XX/MOS65XXModule.h +12 -0
- package/deps/capstone/arch/MOS65XX/instruction_info.inc +106 -0
- package/deps/capstone/arch/MOS65XX/m6502.inc +256 -0
- package/deps/capstone/arch/MOS65XX/m65816.inc +256 -0
- package/deps/capstone/arch/MOS65XX/m65c02.inc +256 -0
- package/deps/capstone/arch/MOS65XX/mw65c02.inc +256 -0
- package/deps/capstone/arch/Mips/MipsDisassembler.c +1794 -0
- package/deps/capstone/arch/Mips/MipsDisassembler.h +16 -0
- package/deps/capstone/arch/Mips/MipsGenAsmWriter.inc +5725 -0
- package/deps/capstone/arch/Mips/MipsGenDisassemblerTables.inc +6942 -0
- package/deps/capstone/arch/Mips/MipsGenInstrInfo.inc +1805 -0
- package/deps/capstone/arch/Mips/MipsGenRegisterInfo.inc +1679 -0
- package/deps/capstone/arch/Mips/MipsGenSubtargetInfo.inc +52 -0
- package/deps/capstone/arch/Mips/MipsInstPrinter.c +424 -0
- package/deps/capstone/arch/Mips/MipsInstPrinter.h +25 -0
- package/deps/capstone/arch/Mips/MipsMapping.c +1070 -0
- package/deps/capstone/arch/Mips/MipsMapping.h +25 -0
- package/deps/capstone/arch/Mips/MipsMappingInsn.inc +9315 -0
- package/deps/capstone/arch/Mips/MipsModule.c +52 -0
- package/deps/capstone/arch/Mips/MipsModule.h +12 -0
- package/deps/capstone/arch/PowerPC/PPCDisassembler.c +627 -0
- package/deps/capstone/arch/PowerPC/PPCDisassembler.h +17 -0
- package/deps/capstone/arch/PowerPC/PPCGenAsmWriter.inc +11451 -0
- package/deps/capstone/arch/PowerPC/PPCGenDisassemblerTables.inc +6886 -0
- package/deps/capstone/arch/PowerPC/PPCGenInstrInfo.inc +4772 -0
- package/deps/capstone/arch/PowerPC/PPCGenRegisterInfo.inc +1122 -0
- package/deps/capstone/arch/PowerPC/PPCGenRegisterName.inc +278 -0
- package/deps/capstone/arch/PowerPC/PPCGenSubtargetInfo.inc +90 -0
- package/deps/capstone/arch/PowerPC/PPCInstPrinter.c +1238 -0
- package/deps/capstone/arch/PowerPC/PPCInstPrinter.h +15 -0
- package/deps/capstone/arch/PowerPC/PPCMapping.c +570 -0
- package/deps/capstone/arch/PowerPC/PPCMapping.h +40 -0
- package/deps/capstone/arch/PowerPC/PPCMappingInsn.inc +13220 -0
- package/deps/capstone/arch/PowerPC/PPCMappingInsnName.inc +1731 -0
- package/deps/capstone/arch/PowerPC/PPCModule.c +45 -0
- package/deps/capstone/arch/PowerPC/PPCModule.h +12 -0
- package/deps/capstone/arch/PowerPC/PPCPredicates.h +62 -0
- package/deps/capstone/arch/RISCV/RISCVBaseInfo.h +106 -0
- package/deps/capstone/arch/RISCV/RISCVDisassembler.c +433 -0
- package/deps/capstone/arch/RISCV/RISCVDisassembler.h +18 -0
- package/deps/capstone/arch/RISCV/RISCVGenAsmWriter.inc +2651 -0
- package/deps/capstone/arch/RISCV/RISCVGenDisassemblerTables.inc +1776 -0
- package/deps/capstone/arch/RISCV/RISCVGenInsnNameMaps.inc +275 -0
- package/deps/capstone/arch/RISCV/RISCVGenInstrInfo.inc +470 -0
- package/deps/capstone/arch/RISCV/RISCVGenRegisterInfo.inc +426 -0
- package/deps/capstone/arch/RISCV/RISCVGenSubtargetInfo.inc +33 -0
- package/deps/capstone/arch/RISCV/RISCVInstPrinter.c +447 -0
- package/deps/capstone/arch/RISCV/RISCVInstPrinter.h +24 -0
- package/deps/capstone/arch/RISCV/RISCVMapping.c +366 -0
- package/deps/capstone/arch/RISCV/RISCVMapping.h +22 -0
- package/deps/capstone/arch/RISCV/RISCVMappingInsn.inc +1635 -0
- package/deps/capstone/arch/RISCV/RISCVModule.c +42 -0
- package/deps/capstone/arch/RISCV/RISCVModule.h +12 -0
- package/deps/capstone/arch/SH/SHDisassembler.c +2221 -0
- package/deps/capstone/arch/SH/SHDisassembler.h +19 -0
- package/deps/capstone/arch/SH/SHInsnTable.inc +66 -0
- package/deps/capstone/arch/SH/SHInstPrinter.c +438 -0
- package/deps/capstone/arch/SH/SHInstPrinter.h +23 -0
- package/deps/capstone/arch/SH/SHModule.c +39 -0
- package/deps/capstone/arch/SH/SHModule.h +12 -0
- package/deps/capstone/arch/SH/mktable.rb +390 -0
- package/deps/capstone/arch/Sparc/Sparc.h +63 -0
- package/deps/capstone/arch/Sparc/SparcDisassembler.c +500 -0
- package/deps/capstone/arch/Sparc/SparcDisassembler.h +17 -0
- package/deps/capstone/arch/Sparc/SparcGenAsmWriter.inc +5709 -0
- package/deps/capstone/arch/Sparc/SparcGenDisassemblerTables.inc +2028 -0
- package/deps/capstone/arch/Sparc/SparcGenInstrInfo.inc +514 -0
- package/deps/capstone/arch/Sparc/SparcGenRegisterInfo.inc +451 -0
- package/deps/capstone/arch/Sparc/SparcGenSubtargetInfo.inc +27 -0
- package/deps/capstone/arch/Sparc/SparcInstPrinter.c +446 -0
- package/deps/capstone/arch/Sparc/SparcInstPrinter.h +17 -0
- package/deps/capstone/arch/Sparc/SparcMapping.c +665 -0
- package/deps/capstone/arch/Sparc/SparcMapping.h +34 -0
- package/deps/capstone/arch/Sparc/SparcMappingInsn.inc +2643 -0
- package/deps/capstone/arch/Sparc/SparcModule.c +45 -0
- package/deps/capstone/arch/Sparc/SparcModule.h +12 -0
- package/deps/capstone/arch/SystemZ/SystemZDisassembler.c +484 -0
- package/deps/capstone/arch/SystemZ/SystemZDisassembler.h +17 -0
- package/deps/capstone/arch/SystemZ/SystemZGenAsmWriter.inc +11575 -0
- package/deps/capstone/arch/SystemZ/SystemZGenDisassemblerTables.inc +10262 -0
- package/deps/capstone/arch/SystemZ/SystemZGenInsnNameMaps.inc +2348 -0
- package/deps/capstone/arch/SystemZ/SystemZGenInstrInfo.inc +2820 -0
- package/deps/capstone/arch/SystemZ/SystemZGenRegisterInfo.inc +741 -0
- package/deps/capstone/arch/SystemZ/SystemZGenSubtargetInfo.inc +49 -0
- package/deps/capstone/arch/SystemZ/SystemZInstPrinter.c +433 -0
- package/deps/capstone/arch/SystemZ/SystemZInstPrinter.h +15 -0
- package/deps/capstone/arch/SystemZ/SystemZMCTargetDesc.c +195 -0
- package/deps/capstone/arch/SystemZ/SystemZMCTargetDesc.h +51 -0
- package/deps/capstone/arch/SystemZ/SystemZMapping.c +479 -0
- package/deps/capstone/arch/SystemZ/SystemZMapping.h +23 -0
- package/deps/capstone/arch/SystemZ/SystemZMappingInsn.inc +14175 -0
- package/deps/capstone/arch/SystemZ/SystemZModule.c +44 -0
- package/deps/capstone/arch/SystemZ/SystemZModule.h +12 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.c +628 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xDisassembler.h +19 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenAsmWriter.inc +684 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenDisassemblerTables.inc +1352 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenInstrInfo.inc +298 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xGenRegisterInfo.inc +277 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.c +572 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xInstPrinter.h +15 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xMapping.c +1926 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xMapping.h +26 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xModule.c +39 -0
- package/deps/capstone/arch/TMS320C64x/TMS320C64xModule.h +12 -0
- package/deps/capstone/arch/TriCore/TriCore.td +134 -0
- package/deps/capstone/arch/TriCore/TriCoreCallingConv.td +61 -0
- package/deps/capstone/arch/TriCore/TriCoreDisassembler.c +1655 -0
- package/deps/capstone/arch/TriCore/TriCoreDisassembler.h +18 -0
- package/deps/capstone/arch/TriCore/TriCoreGenAsmWriter.inc +3691 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSFeatureName.inc +22 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsn.inc +8938 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsnName.inc +404 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSMappingInsnOp.inc +7994 -0
- package/deps/capstone/arch/TriCore/TriCoreGenCSOpGroup.inc +32 -0
- package/deps/capstone/arch/TriCore/TriCoreGenDisassemblerTables.inc +4044 -0
- package/deps/capstone/arch/TriCore/TriCoreGenInstrInfo.inc +2693 -0
- package/deps/capstone/arch/TriCore/TriCoreGenRegisterInfo.inc +295 -0
- package/deps/capstone/arch/TriCore/TriCoreGenSubtargetInfo.inc +40 -0
- package/deps/capstone/arch/TriCore/TriCoreInstPrinter.c +488 -0
- package/deps/capstone/arch/TriCore/TriCoreInstrFormats.td +773 -0
- package/deps/capstone/arch/TriCore/TriCoreInstrInfo.td +1873 -0
- package/deps/capstone/arch/TriCore/TriCoreLinkage.h +21 -0
- package/deps/capstone/arch/TriCore/TriCoreMapping.c +241 -0
- package/deps/capstone/arch/TriCore/TriCoreMapping.h +32 -0
- package/deps/capstone/arch/TriCore/TriCoreModule.c +44 -0
- package/deps/capstone/arch/TriCore/TriCoreModule.h +11 -0
- package/deps/capstone/arch/TriCore/TriCoreRegisterInfo.td +153 -0
- package/deps/capstone/arch/WASM/WASMDisassembler.c +1009 -0
- package/deps/capstone/arch/WASM/WASMDisassembler.h +12 -0
- package/deps/capstone/arch/WASM/WASMInstPrinter.c +47 -0
- package/deps/capstone/arch/WASM/WASMInstPrinter.h +18 -0
- package/deps/capstone/arch/WASM/WASMMapping.c +333 -0
- package/deps/capstone/arch/WASM/WASMMapping.h +9 -0
- package/deps/capstone/arch/WASM/WASMModule.c +33 -0
- package/deps/capstone/arch/WASM/WASMModule.h +12 -0
- package/deps/capstone/arch/X86/X86ATTInstPrinter.c +997 -0
- package/deps/capstone/arch/X86/X86BaseInfo.h +50 -0
- package/deps/capstone/arch/X86/X86Disassembler.c +1033 -0
- package/deps/capstone/arch/X86/X86Disassembler.h +28 -0
- package/deps/capstone/arch/X86/X86DisassemblerDecoder.c +2358 -0
- package/deps/capstone/arch/X86/X86DisassemblerDecoder.h +725 -0
- package/deps/capstone/arch/X86/X86DisassemblerDecoderCommon.h +483 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter.inc +49199 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter1.inc +33196 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter1_reduce.inc +2531 -0
- package/deps/capstone/arch/X86/X86GenAsmWriter_reduce.inc +2855 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables.inc +112961 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables2.inc +102151 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables_reduce.inc +28047 -0
- package/deps/capstone/arch/X86/X86GenDisassemblerTables_reduce2.inc +18827 -0
- package/deps/capstone/arch/X86/X86GenInstrInfo.inc +15158 -0
- package/deps/capstone/arch/X86/X86GenInstrInfo_reduce.inc +1564 -0
- package/deps/capstone/arch/X86/X86GenRegisterInfo.inc +1549 -0
- package/deps/capstone/arch/X86/X86GenRegisterName.inc +292 -0
- package/deps/capstone/arch/X86/X86GenRegisterName1.inc +291 -0
- package/deps/capstone/arch/X86/X86ImmSize.inc +335 -0
- package/deps/capstone/arch/X86/X86InstPrinter.h +26 -0
- package/deps/capstone/arch/X86/X86InstPrinterCommon.c +116 -0
- package/deps/capstone/arch/X86/X86InstPrinterCommon.h +16 -0
- package/deps/capstone/arch/X86/X86IntelInstPrinter.c +1061 -0
- package/deps/capstone/arch/X86/X86Lookup16.inc +16874 -0
- package/deps/capstone/arch/X86/X86Lookup16_reduce.inc +2308 -0
- package/deps/capstone/arch/X86/X86Mapping.c +2266 -0
- package/deps/capstone/arch/X86/X86Mapping.h +96 -0
- package/deps/capstone/arch/X86/X86MappingInsn.inc +105977 -0
- package/deps/capstone/arch/X86/X86MappingInsnName.inc +1527 -0
- package/deps/capstone/arch/X86/X86MappingInsnName_reduce.inc +348 -0
- package/deps/capstone/arch/X86/X86MappingInsnOp.inc +75700 -0
- package/deps/capstone/arch/X86/X86MappingInsnOp_reduce.inc +7729 -0
- package/deps/capstone/arch/X86/X86MappingInsn_reduce.inc +10819 -0
- package/deps/capstone/arch/X86/X86MappingReg.inc +280 -0
- package/deps/capstone/arch/X86/X86Module.c +94 -0
- package/deps/capstone/arch/X86/X86Module.h +12 -0
- package/deps/capstone/arch/XCore/XCoreDisassembler.c +794 -0
- package/deps/capstone/arch/XCore/XCoreDisassembler.h +17 -0
- package/deps/capstone/arch/XCore/XCoreGenAsmWriter.inc +772 -0
- package/deps/capstone/arch/XCore/XCoreGenDisassemblerTables.inc +853 -0
- package/deps/capstone/arch/XCore/XCoreGenInstrInfo.inc +267 -0
- package/deps/capstone/arch/XCore/XCoreGenRegisterInfo.inc +110 -0
- package/deps/capstone/arch/XCore/XCoreInstPrinter.c +250 -0
- package/deps/capstone/arch/XCore/XCoreInstPrinter.h +18 -0
- package/deps/capstone/arch/XCore/XCoreMapping.c +297 -0
- package/deps/capstone/arch/XCore/XCoreMapping.h +26 -0
- package/deps/capstone/arch/XCore/XCoreMappingInsn.inc +1287 -0
- package/deps/capstone/arch/XCore/XCoreModule.c +41 -0
- package/deps/capstone/arch/XCore/XCoreModule.h +12 -0
- package/deps/capstone/cs.c +1664 -0
- package/deps/capstone/cs_priv.h +101 -0
- package/deps/capstone/cs_simple_types.h +886 -0
- package/deps/capstone/include/capstone/arm.h +991 -0
- package/deps/capstone/include/capstone/arm64.h +3159 -0
- package/deps/capstone/include/capstone/bpf.h +209 -0
- package/deps/capstone/include/capstone/capstone.h +875 -0
- package/deps/capstone/include/capstone/evm.h +188 -0
- package/deps/capstone/include/capstone/m680x.h +537 -0
- package/deps/capstone/include/capstone/m68k.h +613 -0
- package/deps/capstone/include/capstone/mips.h +956 -0
- package/deps/capstone/include/capstone/mos65xx.h +204 -0
- package/deps/capstone/include/capstone/platform.h +122 -0
- package/deps/capstone/include/capstone/ppc.h +2108 -0
- package/deps/capstone/include/capstone/riscv.h +531 -0
- package/deps/capstone/include/capstone/sh.h +465 -0
- package/deps/capstone/include/capstone/sparc.h +520 -0
- package/deps/capstone/include/capstone/systemz.h +2601 -0
- package/deps/capstone/include/capstone/tms320c64x.h +359 -0
- package/deps/capstone/include/capstone/tricore.h +567 -0
- package/deps/capstone/include/capstone/wasm.h +250 -0
- package/deps/capstone/include/capstone/x86.h +1986 -0
- package/deps/capstone/include/capstone/xcore.h +235 -0
- package/deps/capstone/include/platform.h +110 -0
- package/deps/capstone/include/windowsce/intrin.h +12 -0
- package/deps/capstone/include/windowsce/stdint.h +133 -0
- package/deps/capstone/utils.c +140 -0
- package/deps/capstone/utils.h +54 -0
- package/index.d.ts +448 -0
- package/index.js +64 -0
- package/index.mjs +25 -0
- package/package.json +82 -0
- package/prebuilds/win32-x64/hexcore-capstone.node +0 -0
- package/src/capstone_wrapper.cpp +910 -0
- package/src/capstone_wrapper.h +147 -0
- package/src/disasm_async_worker.h +215 -0
- package/src/main.cpp +145 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
//===- TriCoreInstPrinter.cpp - Convert TriCore MCInst to assembly syntax -===//
|
|
2
|
+
//
|
|
3
|
+
// The LLVM Compiler Infrastructure
|
|
4
|
+
//
|
|
5
|
+
// This file is distributed under the University of Illinois Open Source
|
|
6
|
+
// License. See LICENSE.TXT for details.
|
|
7
|
+
//
|
|
8
|
+
//===----------------------------------------------------------------------===//
|
|
9
|
+
//
|
|
10
|
+
// This class prints an TriCore MCInst to a .s file.
|
|
11
|
+
//
|
|
12
|
+
//===----------------------------------------------------------------------===//
|
|
13
|
+
|
|
14
|
+
/* Capstone Disassembly Engine */
|
|
15
|
+
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
|
16
|
+
|
|
17
|
+
#ifdef CAPSTONE_HAS_TRICORE
|
|
18
|
+
|
|
19
|
+
#include <platform.h>
|
|
20
|
+
#include <stdio.h>
|
|
21
|
+
#include <stdlib.h>
|
|
22
|
+
#include <string.h>
|
|
23
|
+
|
|
24
|
+
#include "../../MCInst.h"
|
|
25
|
+
#include "../../MCRegisterInfo.h"
|
|
26
|
+
#include "../../MathExtras.h"
|
|
27
|
+
#include "../../SStream.h"
|
|
28
|
+
#include "../../utils.h"
|
|
29
|
+
#include "TriCoreMapping.h"
|
|
30
|
+
#include "TriCoreLinkage.h"
|
|
31
|
+
|
|
32
|
+
static const char *getRegisterName(unsigned RegNo);
|
|
33
|
+
|
|
34
|
+
static void printInstruction(MCInst *, uint64_t, SStream *);
|
|
35
|
+
|
|
36
|
+
static void printOperand(MCInst *MI, int OpNum, SStream *O);
|
|
37
|
+
|
|
38
|
+
#define GET_INSTRINFO_ENUM
|
|
39
|
+
|
|
40
|
+
#include "TriCoreGenInstrInfo.inc"
|
|
41
|
+
|
|
42
|
+
#define GET_REGINFO_ENUM
|
|
43
|
+
|
|
44
|
+
#include "TriCoreGenRegisterInfo.inc"
|
|
45
|
+
|
|
46
|
+
static bool fill_mem(MCInst *MI, unsigned int reg, int32_t disp);
|
|
47
|
+
|
|
48
|
+
static inline void set_mem(cs_tricore_op *op, uint8_t base, int32_t disp)
|
|
49
|
+
{
|
|
50
|
+
op->type |= TRICORE_OP_MEM;
|
|
51
|
+
op->mem.base = base;
|
|
52
|
+
op->mem.disp = disp;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
static inline void fill_reg(MCInst *MI, uint32_t reg)
|
|
56
|
+
{
|
|
57
|
+
if (!detail_is_set(MI))
|
|
58
|
+
return;
|
|
59
|
+
cs_tricore_op *op = TriCore_get_detail_op(MI, 0);
|
|
60
|
+
op->type = TRICORE_OP_REG;
|
|
61
|
+
op->reg = reg;
|
|
62
|
+
TriCore_inc_op_count(MI);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
static inline void fill_imm(MCInst *MI, int32_t imm)
|
|
66
|
+
{
|
|
67
|
+
if (!detail_is_set(MI))
|
|
68
|
+
return;
|
|
69
|
+
cs_tricore *tricore = TriCore_get_detail(MI);
|
|
70
|
+
if (tricore->op_count >= 1) {
|
|
71
|
+
cs_tricore_op *op = TriCore_get_detail_op(MI, -1);
|
|
72
|
+
if (op->type == TRICORE_OP_REG && fill_mem(MI, op->reg, imm))
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
cs_tricore_op *op = TriCore_get_detail_op(MI, 0);
|
|
77
|
+
op->type = TRICORE_OP_IMM;
|
|
78
|
+
op->imm = imm;
|
|
79
|
+
tricore->op_count++;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
static bool fill_mem(MCInst *MI, unsigned int reg, int32_t disp)
|
|
83
|
+
{
|
|
84
|
+
if (!detail_is_set(MI))
|
|
85
|
+
return false;
|
|
86
|
+
switch (MI->flat_insn->id) {
|
|
87
|
+
case TRICORE_INS_LDMST:
|
|
88
|
+
case TRICORE_INS_LDLCX:
|
|
89
|
+
case TRICORE_INS_LD_A:
|
|
90
|
+
case TRICORE_INS_LD_B:
|
|
91
|
+
case TRICORE_INS_LD_BU:
|
|
92
|
+
case TRICORE_INS_LD_H:
|
|
93
|
+
case TRICORE_INS_LD_HU:
|
|
94
|
+
case TRICORE_INS_LD_D:
|
|
95
|
+
case TRICORE_INS_LD_DA:
|
|
96
|
+
case TRICORE_INS_LD_W:
|
|
97
|
+
case TRICORE_INS_LD_Q:
|
|
98
|
+
case TRICORE_INS_STLCX:
|
|
99
|
+
case TRICORE_INS_STUCX:
|
|
100
|
+
case TRICORE_INS_ST_A:
|
|
101
|
+
case TRICORE_INS_ST_B:
|
|
102
|
+
case TRICORE_INS_ST_H:
|
|
103
|
+
case TRICORE_INS_ST_D:
|
|
104
|
+
case TRICORE_INS_ST_DA:
|
|
105
|
+
case TRICORE_INS_ST_W:
|
|
106
|
+
case TRICORE_INS_ST_Q:
|
|
107
|
+
case TRICORE_INS_CACHEI_I:
|
|
108
|
+
case TRICORE_INS_CACHEI_W:
|
|
109
|
+
case TRICORE_INS_CACHEI_WI:
|
|
110
|
+
case TRICORE_INS_CACHEA_I:
|
|
111
|
+
case TRICORE_INS_CACHEA_W:
|
|
112
|
+
case TRICORE_INS_CACHEA_WI:
|
|
113
|
+
case TRICORE_INS_CMPSWAP_W:
|
|
114
|
+
case TRICORE_INS_SWAP_A:
|
|
115
|
+
case TRICORE_INS_SWAP_W:
|
|
116
|
+
case TRICORE_INS_SWAPMSK_W:
|
|
117
|
+
case TRICORE_INS_LEA:
|
|
118
|
+
case TRICORE_INS_LHA: {
|
|
119
|
+
switch (MCInst_getOpcode(MI)) {
|
|
120
|
+
case TRICORE_LDMST_abs:
|
|
121
|
+
case TRICORE_LDLCX_abs:
|
|
122
|
+
case TRICORE_LD_A_abs:
|
|
123
|
+
case TRICORE_LD_B_abs:
|
|
124
|
+
case TRICORE_LD_BU_abs:
|
|
125
|
+
case TRICORE_LD_H_abs:
|
|
126
|
+
case TRICORE_LD_HU_abs:
|
|
127
|
+
case TRICORE_LD_D_abs:
|
|
128
|
+
case TRICORE_LD_DA_abs:
|
|
129
|
+
case TRICORE_LD_W_abs:
|
|
130
|
+
case TRICORE_LD_Q_abs:
|
|
131
|
+
case TRICORE_STLCX_abs:
|
|
132
|
+
case TRICORE_STUCX_abs:
|
|
133
|
+
case TRICORE_ST_A_abs:
|
|
134
|
+
case TRICORE_ST_B_abs:
|
|
135
|
+
case TRICORE_ST_H_abs:
|
|
136
|
+
case TRICORE_ST_D_abs:
|
|
137
|
+
case TRICORE_ST_DA_abs:
|
|
138
|
+
case TRICORE_ST_W_abs:
|
|
139
|
+
case TRICORE_ST_Q_abs:
|
|
140
|
+
case TRICORE_SWAP_A_abs:
|
|
141
|
+
case TRICORE_SWAP_W_abs:
|
|
142
|
+
case TRICORE_LEA_abs:
|
|
143
|
+
case TRICORE_LHA_abs: {
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
cs_tricore_op *op = TriCore_get_detail_op(MI, -1);
|
|
148
|
+
op->type = 0;
|
|
149
|
+
set_mem(op, reg, disp);
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
static void printOperand(MCInst *MI, int OpNum, SStream *O)
|
|
157
|
+
{
|
|
158
|
+
if (OpNum >= MI->size)
|
|
159
|
+
return;
|
|
160
|
+
|
|
161
|
+
MCOperand *Op = MCInst_getOperand(MI, OpNum);
|
|
162
|
+
if (MCOperand_isReg(Op)) {
|
|
163
|
+
unsigned reg = MCOperand_getReg(Op);
|
|
164
|
+
SStream_concat0(O, getRegisterName(reg));
|
|
165
|
+
fill_reg(MI, reg);
|
|
166
|
+
} else if (MCOperand_isImm(Op)) {
|
|
167
|
+
int64_t Imm = MCOperand_getImm(Op);
|
|
168
|
+
printInt64Bang(O, Imm);
|
|
169
|
+
fill_imm(MI, (int32_t)Imm);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
static inline unsigned int get_msb(unsigned int value)
|
|
174
|
+
{
|
|
175
|
+
unsigned int msb = 0;
|
|
176
|
+
while (value > 0) {
|
|
177
|
+
value >>= 1; // Shift bits to the right
|
|
178
|
+
msb++; // Increment the position of the MSB
|
|
179
|
+
}
|
|
180
|
+
return msb;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
static inline int32_t sign_ext_n(int32_t imm, unsigned n)
|
|
184
|
+
{
|
|
185
|
+
n = get_msb(imm) > n ? get_msb(imm) : n;
|
|
186
|
+
int32_t mask = 1 << (n - 1);
|
|
187
|
+
int32_t sign_extended = (imm ^ mask) - mask;
|
|
188
|
+
return sign_extended;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
static void print_sign_ext(MCInst *MI, int OpNum, SStream *O, unsigned n)
|
|
192
|
+
{
|
|
193
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
194
|
+
if (MCOperand_isImm(MO)) {
|
|
195
|
+
int32_t imm = (int32_t)MCOperand_getImm(MO);
|
|
196
|
+
imm = sign_ext_n(imm, n);
|
|
197
|
+
printInt32Bang(O, imm);
|
|
198
|
+
fill_imm(MI, imm);
|
|
199
|
+
} else
|
|
200
|
+
printOperand(MI, OpNum, O);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static void off4_fixup(MCInst *MI, uint64_t *off4)
|
|
204
|
+
{
|
|
205
|
+
switch (MCInst_getOpcode(MI)) {
|
|
206
|
+
case TRICORE_LD_A_slro:
|
|
207
|
+
case TRICORE_LD_A_sro:
|
|
208
|
+
case TRICORE_LD_W_slro:
|
|
209
|
+
case TRICORE_LD_W_sro:
|
|
210
|
+
case TRICORE_ST_A_sro:
|
|
211
|
+
case TRICORE_ST_A_ssro:
|
|
212
|
+
case TRICORE_ST_W_sro:
|
|
213
|
+
case TRICORE_ST_W_ssro: {
|
|
214
|
+
*off4 *= 4;
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case TRICORE_LD_H_sro:
|
|
218
|
+
case TRICORE_LD_H_slro:
|
|
219
|
+
case TRICORE_ST_H_sro:
|
|
220
|
+
case TRICORE_ST_H_ssro: {
|
|
221
|
+
*off4 *= 2;
|
|
222
|
+
break;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
static void const8_fixup(MCInst *MI, uint64_t *const8)
|
|
228
|
+
{
|
|
229
|
+
switch (MCInst_getOpcode(MI)) {
|
|
230
|
+
case TRICORE_LD_A_sc:
|
|
231
|
+
case TRICORE_ST_A_sc:
|
|
232
|
+
case TRICORE_ST_W_sc:
|
|
233
|
+
case TRICORE_LD_W_sc: {
|
|
234
|
+
*const8 *= 4;
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
static void print_zero_ext(MCInst *MI, int OpNum, SStream *O, unsigned n)
|
|
241
|
+
{
|
|
242
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
243
|
+
if (MCOperand_isImm(MO)) {
|
|
244
|
+
uint64_t imm = MCOperand_getImm(MO);
|
|
245
|
+
for (unsigned i = n + 1; i < 32; ++i) {
|
|
246
|
+
imm &= ~(1 << i);
|
|
247
|
+
}
|
|
248
|
+
if (n == 4) {
|
|
249
|
+
off4_fixup(MI, &imm);
|
|
250
|
+
}
|
|
251
|
+
if (n == 8) {
|
|
252
|
+
const8_fixup(MI, &imm);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
printInt64Bang(O, imm);
|
|
256
|
+
fill_imm(MI, imm);
|
|
257
|
+
} else
|
|
258
|
+
printOperand(MI, OpNum, O);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
static void printOff18Imm(MCInst *MI, int OpNum, SStream *O)
|
|
262
|
+
{
|
|
263
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
264
|
+
if (MCOperand_isImm(MO)) {
|
|
265
|
+
uint32_t imm = (uint32_t)MCOperand_getImm(MO);
|
|
266
|
+
imm = ((imm & 0x3C000) << 14) | (imm & 0x3fff);
|
|
267
|
+
printUInt32Bang(O, imm);
|
|
268
|
+
fill_imm(MI, (int32_t)imm);
|
|
269
|
+
} else
|
|
270
|
+
printOperand(MI, OpNum, O);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
static void printDisp24Imm(MCInst *MI, int OpNum, SStream *O)
|
|
274
|
+
{
|
|
275
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
276
|
+
if (MCOperand_isImm(MO)) {
|
|
277
|
+
uint32_t disp = MCOperand_getImm(MO);
|
|
278
|
+
switch (MCInst_getOpcode(MI)) {
|
|
279
|
+
case TRICORE_CALL_b:
|
|
280
|
+
case TRICORE_FCALL_b: {
|
|
281
|
+
disp = (int32_t)MI->address + sign_ext_n(disp * 2, 24);
|
|
282
|
+
break;
|
|
283
|
+
}
|
|
284
|
+
case TRICORE_CALLA_b:
|
|
285
|
+
case TRICORE_FCALLA_b:
|
|
286
|
+
case TRICORE_JA_b:
|
|
287
|
+
case TRICORE_JLA_b:
|
|
288
|
+
// = {disp24[23:20], 7’b0000000, disp24[19:0], 1’b0};
|
|
289
|
+
disp = ((disp & 0xf00000) << 28) |
|
|
290
|
+
((disp & 0xfffff) << 1);
|
|
291
|
+
break;
|
|
292
|
+
case TRICORE_J_b:
|
|
293
|
+
case TRICORE_JL_b:
|
|
294
|
+
disp = (int32_t)MI->address + sign_ext_n(disp, 24) * 2;
|
|
295
|
+
break;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
printUInt32Bang(O, disp);
|
|
299
|
+
fill_imm(MI, disp);
|
|
300
|
+
} else
|
|
301
|
+
printOperand(MI, OpNum, O);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
static void printDisp15Imm(MCInst *MI, int OpNum, SStream *O)
|
|
305
|
+
{
|
|
306
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
307
|
+
if (MCOperand_isImm(MO)) {
|
|
308
|
+
uint32_t disp = MCOperand_getImm(MO);
|
|
309
|
+
switch (MCInst_getOpcode(MI)) {
|
|
310
|
+
case TRICORE_JEQ_brc:
|
|
311
|
+
case TRICORE_JEQ_brr:
|
|
312
|
+
case TRICORE_JEQ_A_brr:
|
|
313
|
+
case TRICORE_JGE_brc:
|
|
314
|
+
case TRICORE_JGE_brr:
|
|
315
|
+
case TRICORE_JGE_U_brc:
|
|
316
|
+
case TRICORE_JGE_U_brr:
|
|
317
|
+
case TRICORE_JLT_brc:
|
|
318
|
+
case TRICORE_JLT_brr:
|
|
319
|
+
case TRICORE_JLT_U_brc:
|
|
320
|
+
case TRICORE_JLT_U_brr:
|
|
321
|
+
case TRICORE_JNE_brc:
|
|
322
|
+
case TRICORE_JNE_brr:
|
|
323
|
+
case TRICORE_JNE_A_brr:
|
|
324
|
+
case TRICORE_JNED_brc:
|
|
325
|
+
case TRICORE_JNED_brr:
|
|
326
|
+
case TRICORE_JNEI_brc:
|
|
327
|
+
case TRICORE_JNEI_brr:
|
|
328
|
+
case TRICORE_JNZ_A_brr:
|
|
329
|
+
case TRICORE_JNZ_T_brn:
|
|
330
|
+
case TRICORE_JZ_A_brr:
|
|
331
|
+
case TRICORE_JZ_T_brn:
|
|
332
|
+
disp = (int32_t)MI->address + sign_ext_n(disp, 15) * 2;
|
|
333
|
+
break;
|
|
334
|
+
case TRICORE_LOOP_brr:
|
|
335
|
+
case TRICORE_LOOPU_brr:
|
|
336
|
+
disp = (int32_t)MI->address + sign_ext_n(disp * 2, 15);
|
|
337
|
+
break;
|
|
338
|
+
default:
|
|
339
|
+
// handle other cases, if any
|
|
340
|
+
break;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
printUInt32Bang(O, disp);
|
|
344
|
+
fill_imm(MI, disp);
|
|
345
|
+
} else
|
|
346
|
+
printOperand(MI, OpNum, O);
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
static void printDisp8Imm(MCInst *MI, int OpNum, SStream *O)
|
|
350
|
+
{
|
|
351
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
352
|
+
if (MCOperand_isImm(MO)) {
|
|
353
|
+
uint32_t disp = MCOperand_getImm(MO);
|
|
354
|
+
switch (MCInst_getOpcode(MI)) {
|
|
355
|
+
case TRICORE_CALL_sb:
|
|
356
|
+
disp = (int32_t)MI->address + sign_ext_n(2 * disp, 8);
|
|
357
|
+
break;
|
|
358
|
+
case TRICORE_J_sb:
|
|
359
|
+
case TRICORE_JNZ_sb:
|
|
360
|
+
case TRICORE_JZ_sb:
|
|
361
|
+
disp = (int32_t)MI->address + sign_ext_n(disp, 8) * 2;
|
|
362
|
+
break;
|
|
363
|
+
default:
|
|
364
|
+
// handle other cases, if any
|
|
365
|
+
break;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
printUInt32Bang(O, disp);
|
|
369
|
+
fill_imm(MI, disp);
|
|
370
|
+
} else
|
|
371
|
+
printOperand(MI, OpNum, O);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
static void printDisp4Imm(MCInst *MI, int OpNum, SStream *O)
|
|
375
|
+
{
|
|
376
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
377
|
+
if (MCOperand_isImm(MO)) {
|
|
378
|
+
uint32_t disp = MCOperand_getImm(MO);
|
|
379
|
+
switch (MCInst_getOpcode(MI)) {
|
|
380
|
+
case TRICORE_JEQ_sbc1:
|
|
381
|
+
case TRICORE_JEQ_sbr1:
|
|
382
|
+
case TRICORE_JGEZ_sbr:
|
|
383
|
+
case TRICORE_JGTZ_sbr:
|
|
384
|
+
case TRICORE_JLEZ_sbr:
|
|
385
|
+
case TRICORE_JLTZ_sbr:
|
|
386
|
+
case TRICORE_JNE_sbc1:
|
|
387
|
+
case TRICORE_JNE_sbr1:
|
|
388
|
+
case TRICORE_JNZ_sbr:
|
|
389
|
+
case TRICORE_JNZ_A_sbr:
|
|
390
|
+
case TRICORE_JNZ_T_sbrn:
|
|
391
|
+
case TRICORE_JZ_sbr:
|
|
392
|
+
case TRICORE_JZ_A_sbr:
|
|
393
|
+
case TRICORE_JZ_T_sbrn:
|
|
394
|
+
disp = (int32_t)MI->address + disp * 2;
|
|
395
|
+
break;
|
|
396
|
+
case TRICORE_JEQ_sbc2:
|
|
397
|
+
case TRICORE_JEQ_sbr2:
|
|
398
|
+
case TRICORE_JNE_sbc2:
|
|
399
|
+
case TRICORE_JNE_sbr2:
|
|
400
|
+
disp = (int32_t)MI->address + (disp + 16) * 2;
|
|
401
|
+
break;
|
|
402
|
+
case TRICORE_LOOP_sbr:
|
|
403
|
+
// {27b’111111111111111111111111111, disp4, 0};
|
|
404
|
+
disp = (int32_t)MI->address +
|
|
405
|
+
((0x7ffffff << 5) |
|
|
406
|
+
(disp << 1));
|
|
407
|
+
break;
|
|
408
|
+
default:
|
|
409
|
+
// handle other cases, if any
|
|
410
|
+
break;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
printUInt32Bang(O, disp);
|
|
414
|
+
fill_imm(MI, disp);
|
|
415
|
+
} else
|
|
416
|
+
printOperand(MI, OpNum, O);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
#define printSExtImm_(n) \
|
|
420
|
+
static void printSExtImm_##n(MCInst *MI, int OpNum, SStream *O) \
|
|
421
|
+
{ \
|
|
422
|
+
print_sign_ext(MI, OpNum, O, n); \
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
#define printZExtImm_(n) \
|
|
426
|
+
static void printZExtImm_##n(MCInst *MI, int OpNum, SStream *O) \
|
|
427
|
+
{ \
|
|
428
|
+
print_zero_ext(MI, OpNum, O, n); \
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// clang-format off
|
|
432
|
+
|
|
433
|
+
printSExtImm_(16)
|
|
434
|
+
printSExtImm_(10)
|
|
435
|
+
printSExtImm_(9)
|
|
436
|
+
printSExtImm_(4)
|
|
437
|
+
|
|
438
|
+
printZExtImm_(16)
|
|
439
|
+
printZExtImm_(9)
|
|
440
|
+
printZExtImm_(8)
|
|
441
|
+
printZExtImm_(4)
|
|
442
|
+
printZExtImm_(2);
|
|
443
|
+
|
|
444
|
+
// clang-format on
|
|
445
|
+
|
|
446
|
+
static void printOExtImm_4(MCInst *MI, int OpNum, SStream *O)
|
|
447
|
+
{
|
|
448
|
+
MCOperand *MO = MCInst_getOperand(MI, OpNum);
|
|
449
|
+
if (MCOperand_isImm(MO)) {
|
|
450
|
+
uint32_t imm = MCOperand_getImm(MO);
|
|
451
|
+
// {27b’111111111111111111111111111, disp4, 0};
|
|
452
|
+
imm = 0xffffffe0 | (imm << 1);
|
|
453
|
+
|
|
454
|
+
printInt32Bang(O, imm);
|
|
455
|
+
fill_imm(MI, imm);
|
|
456
|
+
} else
|
|
457
|
+
printOperand(MI, OpNum, O);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/// Returned by getMnemonic() of the AsmPrinters.
|
|
461
|
+
typedef struct {
|
|
462
|
+
const char *first; // Menmonic
|
|
463
|
+
uint64_t second; // Bits
|
|
464
|
+
} MnemonicBitsInfo;
|
|
465
|
+
|
|
466
|
+
static void set_mem_access(MCInst *MI, unsigned int access)
|
|
467
|
+
{
|
|
468
|
+
// TODO: TriCore
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
#include "TriCoreGenAsmWriter.inc"
|
|
472
|
+
|
|
473
|
+
const char *TriCore_LLVM_getRegisterName(unsigned int id)
|
|
474
|
+
{
|
|
475
|
+
#ifndef CAPSTONE_DIET
|
|
476
|
+
return getRegisterName(id);
|
|
477
|
+
#else
|
|
478
|
+
return NULL;
|
|
479
|
+
#endif
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
void TriCore_LLVM_printInst(MCInst *MI, uint64_t Address, SStream *O)
|
|
483
|
+
{
|
|
484
|
+
printInstruction(MI, Address, O);
|
|
485
|
+
TriCore_set_access(MI);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
#endif // CAPSTONE_HAS_TRICORE
|