mirror of
https://github.com/hedge-dev/XenonRecomp.git
synced 2025-10-30 07:11:38 +00:00
| .. | ||
| 0001-capstone-riscv-patchs.patch | ||
| 0002-update-TableGen-for-generate-RISCV-port-inc-for-CAPS.patch | ||
| 0003-clear-old-patchs.patch | ||
| 0004-fix-riscv-registerclass-array-of-genregisterinfo.patch | ||
| 0005-fix-riscv-registerclass-array-of-genregisterinfo.patch | ||
| 0006-fix-output-TAB-for-riscv-capstone.patch | ||
| 0007-fix-riscv-alias-inst-output-useless-newline.patch | ||
| 0008-fix-riscv-inst-output-more-formal.patch | ||
| 0009-fix-riscv-asmwriter-variable-declaration-place.patch | ||
| 0010-fix-riscvgenasmwiter.inc-memory-leak.patch | ||
| 0011-using-static-array-contain-temp-string-for-riscv-asm.patch | ||
| README.md | ||
How to update RISCV tables.
- Checkout LLVM. Patches are tested on commit
b81d715c.git clone https://github.com/llvm/llvm-project.git git checkout b81d715c - Apply patches from the current directory.
- Run tablegen.
cd $LLVM mkdir build cd build cmake -DCMAKE_CXX_FLAGS=-DCAPSTONE -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="RISCV" .. make RISCVCommonTableGen - Copy
.incfiles.cp arch/RISCV/RISCVGenInsnNameMaps.inc \ arch/RISCV/RISCVGenInsnNameMaps.inc.old for inc in $(cd arch/RISCV && ls *.inc); do cp $LLVM/build/lib/Target/RISCV/$inc arch/RISCV/ done - Fixup
RISCVGenInsnNameMaps.inc.comm -1 -3 \ <(grep RISCV_INS_ <arch/RISCV/RISCVGenInsnNameMaps.inc.old \ | sort -u) \ <(grep RISCV_INS_ <arch/RISCV/RISCVGenInsnNameMaps.inc \ | sort -u) \ >arch/RISCV/RISCVGenInsnNameMaps.inc.new cat arch/RISCV/RISCVGenInsnNameMaps.inc.old \ arch/RISCV/RISCVGenInsnNameMaps.inc.new \ >arch/RISCV/RISCVGenInsnNameMaps.inc - Add new groups, insns, registers and formats.
include/capstone/RISCV.henum RISCV_insn:comm -1 -3 \ <(perl -ne 'if (/(RISCV_INS_.+),/) { print "\t$1,\n" }' \ <include/capstone/RISCV.h | sort -u) \ <(perl -ne 'if (/(RISCV_INS_.+),/) { print "\t$1,\n" }' \ <arch/RISCV/RISCVMappingInsn.inc | sort -u)enum RISCV_insn_group:perl -ne 'if (/(\{.RISCV_GRP_.*?\}),/) { print "\t$1,\n"; }' < \ arch/RISCV/RISCVMappingInsn.inc | sort -u
arch/RISCV/RISCVDisassembler.carch/RISCV/RISCVInstPrinter.carch/RISCV/RISCVMCTargetDesc.carch/RISCV/RISCVMCTargetDesc.harch/RISCV/RISCVMapping.cenum group_name_maps:perl -ne 'if (/(RISCV_GRP_(.*?)),/) { print "\t{ $1, \"" . lc($2) . "\" },\n"; }' \ arch/RISCV/RISCVMappingInsn.inc | sort -u