GaloisInc / dismantle

A library of assemblers and disassemblers derived from LLVM TableGen data
24 stars 5 forks source link

[dismantle-arm-xml]: Order operands based on their bit-position #29

Open danmatichuk opened 4 years ago

danmatichuk commented 4 years ago

Currently the ordering of the operand list is somewhat arbitrary for each generated opcode, as it is simply flattening a map (from names to 'Field's) into a list.

Each 'Field' know its bit position, so this list could easily be sorted based on that instead:

Reordering the 'immediates' list of 'Operand's will affect all of the subsequent computed encodings.

https://github.com/travitch/dismantle/blob/21c5d44d2fdfe5bfbed6278668ddd433668218a9/dismantle-arm-xml/src/Dismantle/ARM/XML.hs#L807