All of lore.kernel.org
 help / color / mirror / Atom feed
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 18:38:37 -0400	[thread overview]
Message-ID: <20180417223837.GA25085@flamenco> (raw)
In-Reply-To: <CAFEAcA9PS2FNSq0VFgO652RaemTViGKzOQStiycqFB8DDhy_ig@mail.gmail.com>

On Tue, Apr 17, 2018 at 22:45:51 +0100, Peter Maydell wrote:
> On 17 April 2018 at 22:27, Emilio G. Cota <cota@braap.org> wrote:
> > 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
> 
> That's Abs of an SNaN; the test expects Invalid, which is wrong,
> because IEEE754 says absolute-value is a "quiet-computational
> operation" that never signals an exception.
> 
> What's odd is that we don't report that error for the softfloat
> implementation! I also don't understand why the expected value
> isn't just the input value with the sign bit flipped.

With -t soft we don't handle "abs" and we don't get the error -- we get
a "not handled" instead.
Is there a function that we could use for abs? The only ones I've seen
are floatX_abs() which mask out the sign bit and do nothing else.

> > (...)
> > +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
> 
> SNaN conversion from 32 bit to 64 bit. Here I agree
> with the test -- we should quieten the NaN and raise
> Invalid -- which implies that the hardware is wrong ?!?

This passes on an Intel host, and fails on both Power7 and 8 hosts I have
access to. I don't have the Power ISA spec in front of me, but I hope
there's something about this specified in it.

		E.

  reply	other threads:[~2018-04-17 22:38 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
2018-04-17 21:45       ` Peter Maydell
2018-04-17 22:38         ` Emilio G. Cota [this message]
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=20180417223837.GA25085@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.