From: "Emilio G. Cota" <cota@braap.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Alex Bennée" <alex.bennee@linaro.org>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Bastian Koppelmann" <kbastian@mail.uni-paderborn.de>
Subject: Re: [Qemu-devel] [PATCH] fpu/softfloat: check for Inf / x or 0 / x before /0
Date: Tue, 17 Apr 2018 17:27:10 -0400 [thread overview]
Message-ID: <20180417212710.GA10948@flamenco> (raw)
In-Reply-To: <CAFEAcA87BUwn96GY5esyNBtoGQY+myVAX9XoPW02gpaJbqyBzg@mail.gmail.com>
On Tue, Apr 17, 2018 at 21:54:03 +0100, Peter Maydell wrote:
> On 17 April 2018 at 20:04, Emilio G. Cota <cota@braap.org> wrote:
> > 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.
>
> I strongly suspect we do have a few cases where we get the answers
> wrong and/or don't report the flags right, so ideally we'd have
> a look at them in more detail...
>
> > Here is the report file with the 1049 failing test cases:
> > http://www.cs.columbia.edu/~cota/qemu/fp-test-after-inf-patch.txt
>
> Syntax for interpreting the report:
> https://www.research.ibm.com/haifa/projects/verification/fpgen/syntax.txt
>
> Here's the first one, am I reading it right?
>
> + 0xffc00000 0xffb00000, expected: 0xffc00000, returned: 0xffc00000,
> expected exceptions: none, returned: i
> error: flags mismatch for input @ ibm/Basic-Types-Inputs.fptest:1346:
> b32+ =0 Q S -> Q
>
> That's a float32 addition where the first input is a QNaN
> and the second an SNaN (presumably the test is configured
> for what in QEMU is snan_bit_is_one == 0), and it expects
> the result to be the QNaN, with no exceptions set. But
> we raise Invalid.
> =0 is the rounding mode, not relevant here.
Yes, you're reading it right.
> IEEE754-2008 s6.2 seems pretty clear that if there's
> an SNaN as an operand then operations like addition should
> signal Invalid. So this looks like a bug in the test case
> input. (Which is weird, because IBM must have tested this,
> so it's odd to see an obvious error in it.)
Yes sometimes the input files don't make much sense -- that's why
I ended up whitelisting some of them.
BTW I just checked with -t host on an IBM Power8, and we get
the same 1049 flag errors we get with -t soft plus two additional ones:
+A 0xffb00000, expected: 0x7fa00000, returned: 0x7fa00000, \
expected exceptions: i, returned: none
+error: flags mismatch for input @ ibm/Basic-Types-Inputs.fptest:382:
+b32A =0 S -> S i
(...)
+cff 0xffb00000, expected: 0x7ff8000000000000, returned: 0x7ff4000000000000, \
expected exceptions: i, returned: none
+error: flags mismatch for input @ ibm/Basic-Types-Inputs.fptest:26170:
+b32b64cff =0 S -> Q i
On x86 with -t host we again get a strict superset of what we get
with -t soft.
So yeah, I don't know what these test cases are about.
> Most of the "expected none, returned i" lines look
> like the same thing. We should look at the others, though.
Given the above, whitelisting the 1049 cases and forcing the flag
checks for all tests (as below) seems reasonable to me.
--- a/tests/fp/fp-test.c
+++ b/tests/fp/fp-test.c
@@ -247,7 +247,7 @@ static enum error tester_check(const struct test_op *t, uint64_t res64,
goto out;
}
}
- if (t->exceptions && flags != (t->exceptions | default_exceptions)) {
+ if (flags != (t->exceptions | default_exceptions)) {
err = ERROR_EXCEPTIONS;
goto out;
}
Thanks,
E.
next prev parent reply other threads:[~2018-04-17 21:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-16 13:54 [Qemu-devel] [PATCH] fpu/softfloat: check for Inf / x or 0 / x before /0 Alex Bennée
2018-04-16 14:16 ` Bastian Koppelmann
2018-04-16 14:42 ` Alex Bennée
2018-04-16 14:45 ` Peter Maydell
2018-04-16 19:39 ` Richard Henderson
2018-04-17 8:56 ` Peter Maydell
2018-04-17 8:57 ` Peter Maydell
2018-04-17 19:04 ` Emilio G. Cota
2018-04-17 20:54 ` Peter Maydell
2018-04-17 21:27 ` Emilio G. Cota [this message]
2018-04-17 21:45 ` Peter Maydell
2018-04-17 22:38 ` Emilio G. Cota
2018-04-17 22:49 ` Richard Henderson
2018-04-17 23:01 ` Peter Maydell
2018-04-17 23:08 ` Peter Maydell
2018-04-19 19:06 ` Richard Henderson
2018-04-19 19:12 ` Richard Henderson
2018-04-19 19:23 ` Peter Maydell
2018-04-20 8:20 ` Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180417212710.GA10948@flamenco \
--to=cota@braap.org \
--cc=alex.bennee@linaro.org \
--cc=aurelien@aurel32.net \
--cc=kbastian@mail.uni-paderborn.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).