# How to update SystemZ tables. * Checkout LLVM. Patches are tested on commit `c13d5969^`, because `c13d5969` changed the decode table format. * Apply patches from the current directory. * Run tablegen. ``` cd $LLVM mkdir build cd build cmake -DCMAKE_CXX_FLAGS=-DCAPSTONE .. make SystemZCommonTableGen -j$(getconf _NPROCESSORS_ONLN) ``` * Copy `.inc` files. ``` cp arch/SystemZ/SystemZGenInsnNameMaps.inc \ arch/SystemZ/SystemZGenInsnNameMaps.inc.old for inc in $(cd arch/SystemZ && ls *.inc); do cp $LLVM/build/lib/Target/SystemZ/$inc arch/SystemZ/ done ``` * Fixup `SystemZGenInsnNameMaps.inc`. ``` comm -1 -3 \ <(grep SYSZ_INS_ arch/SystemZ/SystemZGenInsnNameMaps.inc.new cat arch/SystemZ/SystemZGenInsnNameMaps.inc.old \ arch/SystemZ/SystemZGenInsnNameMaps.inc.new \ >arch/SystemZ/SystemZGenInsnNameMaps.inc ``` * Add new groups, insns, registers and formats. * `include/capstone/systemz.h` * `enum sysz_insn`: ``` comm -1 -3 \ <(perl -ne 'if (/(SYSZ_INS_.+),/) { print "\t$1,\n" }' \