uxmal / reko

Reko is a binary decompiler.
https://uxmal.github.io/reko
GNU General Public License v2.0
2.12k stars 251 forks source link

x87: magic cond() function used for fcom #964

Open rfalke opened 3 years ago

rfalke commented 3 years ago

Subject: https://github.com/rfalke/decompiler-subjects/blob/master/from_holdec/i386_x87_fpu/ia32_elf Output:

  word16 eax_16_16_60 = SLICE(printf("FCOM(pi,1):   should=0x0000 is=0x%04x\n", SEQ(eax_16_16_44, (word16) cond(3.14159265358979 - 1.0) << 8)), word16, 16);

Maybe __x87_compare_flag_values() or something like this is better than a generic "cond".

Maybe also expand this: x = (v1==v2)?someNumber1:(v1<v2?someNumber2:someNumber3). Or maybe model the individual Cx flag values.

rfalke commented 3 years ago

Also in FXAM.