Open gogo2464 opened 1 year ago
It is the bad branch. Anyway I plan to add api in https://github.com/capstone-engine/capstone/tree/master/include/capstone
It's related to the work being done by @Rot127, see https://github.com/capstone-engine/capstone/issues/1936#issuecomment-1336483495
@gogo2464 If I understand your problem correctly you need primarily information what bit in an instruction encodes what (regs, imms, opcode etc.) + certain constraints. It seems your issue is related to https://github.com/capstone-engine/capstone/issues/2031?
If you need access to the TableGen definitions in all its detail, I highly recommend to write a new backend for TableGen and generate the map there. Simply because there is no reasonable way to provide access to all records of the .td
files.
If you are still interested in this it is probably better to wait until the main auto-sync work is done (minimum requirement is https://github.com/capstone-engine/capstone/pull/2026) and then discuss how to add this info.
To learn how we generate code with the help of refactored TableGen backends, see the llvm-capstone docs.
I currently have hardcoded the statistics. This is very imprecise. Can I wait in order to overwrite my hardcoded value with more specific data please?
Yes, of cause. Feel free to come back to it when you find time.
@gogo2464 now that auto-sync code was refactored and merged, could you please check the code and if anything is missing.
@gogo2464 And please check if https://github.com/capstone-engine/capstone/pull/2296 was merged before. It is a refactor and clean up PR for the scripts. So use the code from there please.
I am writting a cryptanalysis library. I need to get statistics on opcodes repartition on the code. So I need to generate any valid assembled <-> disassembled instructions on a BiBTreeMap in rust.
I need to implement bindings for tablegen to this library : https://github.com/capstone-rust/capstone-rs/ and I imagine the library author needs an exposed library first.
Could you assign me to this issue please?
The files I want to edit are here: https://github.com/capstone-engine/capstone/tree/next/suite/synctools/tablegen