vmt / udis86

Disassembler Library for x86 and x86-64
http://udis86.sourceforge.net
BSD 2-Clause "Simplified" License
1.01k stars 296 forks source link

Ordering of instructions in optable.xml is random from SSSE 3 on #33

Open ghghost opened 11 years ago

ghghost commented 11 years ago

Instructions through SSE 3 are in alpha order by mnemonic within each group, but from SSSE 3 on, they seem to be in random order. I'd like to put every group in alpha order. Comments?

ghghost commented 11 years ago

Having looked more carefully through the existing optable.xml, I think the intent is to organize each section alphabetically by functional mnemonic and then by increasing operand width within each functional mnemonic. For example, this leads to the ordering and, andps, andpd, andnps, andnpd ('and' and 'andn' being distinct functional mnemonics) rather than and, andnpd, andnps, andpd, andps. I am going to go ahead and reorder the SSE sections according to this structure.

vmt commented 11 years ago

The intent so far has been to order by functional mnemonic within a section. Going forward I'd like drop these section/grouping and take one of two approaches

(a) Order by functional mnemonic only. Use class tags for information about the instructions for the reader.

(b) Split the optable.xml into .xml: sse.xml, sse2.xml, avx.xml

I don't like the groupings and they serve little purpose. Also, I'd discourage hand editing for re-orderings. The best approach would be to add the relevant class tags, and then script the re-orderings.

ghghost commented 11 years ago

Sounds good to me. I like (a) better than (b). Please discard the reordering patch I sent.