On Mon, Apr 16, 2018 at 14:54:42 +0100, Alex Bennée wrote: > The re-factoring of div_floats changed the order of checking meaning > an operation like -inf/0 erroneously raises the divbyzero flag. > IEEE-754 (2008) specifies this should only occur for operations on > finite operands. > > We fix this by moving the check on the dividend being Inf/0 to before > the divisor is zero check. > > Signed-off-by: Alex Bennée <alex.ben...@linaro.org> > Cc: Bastian Koppelmann <kbast...@mail.uni-paderborn.de>
I can confirm this fixes the issue -- just checked with a modified version of fp-test, see below. Note that in fp-test I am not checking for flags that are raised when none are expected, because doing so gives quite a few errors. Just noticed that enabling this check yields 1049 of these errors for v2.11, and before this patch that number was 1087. After this patch, it is again brought down to 1049. IOW, the test cases in fp-test raise exactly the same flags as v2.11, which is good to know. The 1049 errors are probably false positives -- at least a big chunk of them should be, given that "-t host" gives even more errors. I am tempted to keep the flag check and whitelist these errors though, which would catch regressions such as the one we're fixing here. Here is the report file with the 1049 failing test cases: http://www.cs.columbia.edu/~cota/qemu/fp-test-after-inf-patch.txt Thanks, Emilio