qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Joseph Myers <joseph@codesourcery.com>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org, ehabkost@redhat.com,
	rth@twiddle.net
Subject: Re: [PATCH 2/2] target/i386: fix IEEE x87 floating-point exception raising
Date: Tue, 19 May 2020 11:24:27 -0700	[thread overview]
Message-ID: <76d7fa28-5dd9-3af4-f663-d251bbdbf4f4@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.21.2005191757210.10766@digraph.polyomino.org.uk>

On 5/19/20 11:12 AM, Joseph Myers wrote:
> On Tue, 19 May 2020, Richard Henderson wrote:
> 
>> To retain the hard float fast path, we need to leave float_flag_invalid set
>> when the accrued exception bit is set.  To me this suggests keep all of the
>> FPUS_* bits in fp_status and only convert to FPUS_* when we read the fp status
>> word.
> 
> There is no hard float fast path that I can see for floatx80.  The issue 
> of the fast path might be relevant for fixing SSE exception handling 
> (which has some similar issues to x87), but not for floatx80.

Oops, yes.  Wasn't thinking for a moment.

> Note that another bug in the x87 emulation is the lack of setting C1 for 
> most instructions with inexact results based on the direction of rounding 
> (which will require a new feature to be added to the softfloat code to 
> record that information so the x87 emulation can use it).

Wow, I don't believe I ever knew about that detail.

This looks similar to the indication that PPC gives (and qemu does not
implement) in FPSCR.FR ("The last instruction incremented the fraction during
rounding").

I guess it's not quite the same -- ppc indicates the fraction was incremented,
while x87 indicates that the value rounded up.  Which could be computed from
(fraction incremented) ^ sign, I suppose.


r~


  reply	other threads:[~2020-05-19 18:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 21:19 [PATCH 0/2] target/i386: x87 exceptions fixes Joseph Myers
2020-05-15 21:20 ` [PATCH 1/2] target/i386: fix fisttpl, fisttpll handling of out-of-range values Joseph Myers
2020-05-15 21:21 ` [PATCH 2/2] target/i386: fix IEEE x87 floating-point exception raising Joseph Myers
2020-05-19 17:43   ` Richard Henderson
2020-05-19 18:12     ` Joseph Myers
2020-05-19 18:24       ` Richard Henderson [this message]
2020-05-19 18:28         ` Joseph Myers
2021-05-20 17:38   ` Peter Maydell

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=76d7fa28-5dd9-3af4-f663-d251bbdbf4f4@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=ehabkost@redhat.com \
    --cc=joseph@codesourcery.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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).