nologic/idaref

duplicate mnemonics

mrexodia opened this issue · 4 comments

Just in case someone is wondering, if you run the SQL

SELECT
    mnem, description, COUNT(*)
FROM
    instructions
GROUP BY
    mnem
HAVING
    COUNT(*) > 1

You get the duplicate mnemonics, which are:

s

Not really an issue, but might come up.

yes, I've seen this as well. I'm not entirely sure why it happened (at least I don't remember now). I think it was because of the PDF->TEXT translation that created several topics. I've not seen an issue with using the first of the result set.

Okay I have done some more digging and it turns out that x86 is pretty weird.

MOV just explains various move operations. My solution is to merge them.

MOVSD is an ambiguous instruction. One forwards to the MOVS instruction (which is correct if MOVSD has no arguments). The other forwards to Move scalar double-precision floating point which is a completely different instruction with various arguments.

movsd ; dword ptr es:[edi],dword ptr ds:[esi]
movsd xmm1,xmm2

CMPSD and MOVQ are similar to MOVSD, for now my solution is to append the movsd xmm1,xmm2 to the MOVS instruction that MOVSD redirects to.

This should be fixed now. Thanks for pointing this out.

I will check out the fix but my fork is pretty out of sync so it will take some time...