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.
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