capstone icon indicating copy to clipboard operation
capstone copied to clipboard

Problems with access information for some TriCore operands

Open b1llow opened this issue 1 year ago • 3 comments

Originally posted by @Rot127 in https://github.com/capstone-engine/capstone/pull/2523#pullrequestreview-2395323823

Need to fix all fixme in tests/details/tricore.yaml

b1llow avatar Oct 26 '24 16:10 b1llow

Also note that when an operand of type TRICORE_OP_MEM is written, the access information is wrong.

Maybe need to construct a new Operand Class in the td file to fix this?

b1llow avatar Oct 26 '24 16:10 b1llow

Maybe need to construct a new Operand Class in the td file to fix this?

Yeah, this would be the way. Also we would need to mark all store/load instructions with mayLoad = 1 or mayStore = 1. The mapping table generator will add the read/write details for iPtr operands. So making the registers and immediate values of type iPtr might be even enough.

Rot127 avatar Oct 26 '24 21:10 Rot127

You can also add supplement information to the TriCore tables. Like here. It assumes that there is only a single memory operand (hopefully true for TriCore) and the mayStore, mayLoad attributes are set correctly. FIxing mayLoad, mauStore ins the TriCore files is way easier then changing operands.

Then you assign this access value whenever a memory operand is created.

Rot127 avatar Nov 10 '24 11:11 Rot127