Support x86 opcodes for basic int math
rfalke opened this issue · comments
Version: d03c2d6
Files: https://github.com/rfalke/decompiler-subjects/tree/master/from_holdec/int_math_with_constants
There are still some opcodes missing which makes the correct decompilation of this subject impossible.
Note that the clang compiler emits some over more fancy code. But this is a problem for another day.
$ cd from_holdec/int_math_with_constants
$ grep asm $(find . -name 'by_snowman.c'| grep -v clang) | cut -d":" -f2- | sed -e 's/^ *//' -e 's/ $//' | sort | uniq -c | sort -n
5 __asm__("bsr ebp, eax");
5 __asm__("bsr ebp, ebx");
5 __asm__("bsr edi, ebx");
5 __asm__("bsr edi, esi");
8 __asm__("shld edx, eax, 0x1");
10 __asm__("hlt ");
10 __asm__("shld edx, eax, 0x2");
10 __asm__("shld edx, eax, 0x3");
10 __asm__("shld edx, eax, 0x4");
10 __asm__("shld edx, eax, 0x5");
10 __asm__("shld edx, eax, 0x6");
10 __asm__("shld edx, eax, 0x7");
10 __asm__("shld edx, eax, 0x8");
10 __asm__("shld edx, eax, 0x9");
10 __asm__("shld edx, eax, 0xa");
10 __asm__("shrd eax, edx, 0x1");
10 __asm__("shrd eax, edx, 0x2");
10 __asm__("shrd eax, edx, 0x3");
10 __asm__("shrd eax, edx, 0x4");
10 __asm__("shrd eax, edx, 0x5");
10 __asm__("shrd eax, edx, 0x6");
10 __asm__("shrd eax, edx, 0x7");
10 __asm__("shrd eax, edx, 0x8");
10 __asm__("shrd eax, edx, 0x9");
10 __asm__("shrd eax, edx, 0xa");
6310 __asm__("cdq ");