nepx / halfix

x86 PC emulator that runs both natively and in the browser, via WebAssembly
https://nepx.github.io/halfix-demo/
GNU General Public License v3.0
681 stars 87 forks source link

Possible bug in FPREM1 implementation #6

Closed DCNick3 closed 4 years ago

DCNick3 commented 4 years ago

As far as I can tell there is typo:

https://github.com/nepx/halfix/blob/1d942ac9a49aa2ddedb2d2af5c00681b2b414fd1/src/cpu/fpu.c#L950

Usage of flags makes no sense here. Maybe temp2 > 0 should be placed there (as it indicates that the remainder found is a partial one as far as I can tell).

nepx commented 4 years ago

Good catch! You're absolutely right. temp2 holds the flags from floatx80_ieee754_remainder, and I guess I got confused and put flags (opcode flags, nothing to do with the remainder) instead.

Thanks for reporting, it has been fixed.