Am 28.06.2012 01:00, schrieb Catalin Patulea:
Hey guys,
I've been hacking up the FPREM and FPREM1 i386 instructions (without KVM) to be
implemented using SoftFloat only. This was motivated by some correctness issues
that we noticed with the current implementation which follows the AMD datasheet.I believe
the datasheet explains the operation as if intermediate results had "infinite"
precision, but in this case intermediate rounding causes a loss of precision at the final
output.
My reference was TestFloat [1], specifically the floatx80_rem suite, which
tests the FPREM instruction quite thoroughly (FPREM1 is technically untested
but very similar). The current code fails about half the suite; with the patch,
all tests pass.
There are still lots of dark corners - the code originates from Bochs' copy of
SoftFloat and I tried to port the Bochs exception handling logic as much as I
could. Many details still elude me though (see comments in the code). TestFloat
does test some of the exception logic but not as thoroughly as I would have
liked. If anyone can offer some guidance here, I am happy to fix up the patch.
That's about it.. let me know what you think.
Catalin
[1] http://www.jhauser.us/arithmetic/TestFloat.html
Hi Catalin,
could you please check your patch using the latest scripts/checkpatch.pl?
There are several style issues which should be fixed. I suggest to fix them
even in code which was copied from Bochs.
Thanks,
Stefan W.