All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: Gerhard Wiesinger <lists@wiesinger.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Kevin O'Connor <kevin@koconnor.net>,
	seabios@seabios.org, qemu-devel@nongnu.org,
	Roy Tam <roytam@gmail.com>
Subject: Re: [Qemu-devel] Re: QEMU regression problems - Update FPU
Date: Thu, 24 Feb 2011 08:31:48 +0100	[thread overview]
Message-ID: <20110224073148.GG6703@hall.aurel32.net> (raw)
In-Reply-To: <alpine.LFD.2.02.1102240759010.11165@bbs.intern>

On Thu, Feb 24, 2011 at 08:03:02AM +0100, Gerhard Wiesinger wrote:
> On Wed, 23 Feb 2011, Peter Maydell wrote:
> 
> >On 18 February 2011 07:12, Gerhard Wiesinger <lists@wiesinger.com> wrote:
> >>Issue 1.) with FPU still present
> >>I tracked down the problematic code and it is a rounding error from double
> >>precision to 64bit floats: Any ideas how to fix such an issue in general?
> >>
> >>QEMU result in ST0: 0.42925860786976457 (wrong emulated)
> >>KVM result in ST0:  0.42925860786975449 (correct)
> >
> >This is an error when running QEMU in TCG mode, right?
> >At the moment x86 is the odd-one-out in that it doesn't
> >use CONFIG_SOFTFLOAT for its FPU emulation, so somebody
> >has made an explicit choice of preferring speed over
> >accuracy, and I am unsurprised that there are rounding
> >errors as a result.
> 
> Yes, QEMU not KVM. Regarding mode: I guess tcg mode because
> softfloat doesn't compile on x64 (AMD) (How to find out which mode
> is used, what other modes exist?).
> 
> But can't we use the float64 type and use the normal i386 (or
> higher) instructions and therefore we get:
> 1.) less accurate but correct emulated results
> 2.) Have the full speed
> 
> Second solution would be to use a more accurate type like now but to
> use rounding to e.g. float64 after each FPU operation.
> 
> Maybe we can also use a define or config switch for accuracy vs. speed.
> 

This is not something possible, x86 uses a 80-bit FPU, and floats are
rounded to 64-bit when moved to memory. That's actually probably why you
see a difference between TCG or native/KVM.

-- 
Aurelien Jarno	                        GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

      reply	other threads:[~2011-02-24  7:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-12  5:31 [Qemu-devel] QEMU regression problems Gerhard Wiesinger
2010-04-13  6:26 ` Roy Tam
2010-04-14  1:16   ` [SeaBIOS] " Kevin O'Connor
2010-04-19  6:19     ` Gerhard Wiesinger
2010-04-20  1:26       ` Kevin O'Connor
2010-04-21 19:16         ` Gerhard Wiesinger
2010-04-21 23:02           ` Kevin O'Connor
2010-04-22  6:16             ` Gerhard Wiesinger
2011-02-18  7:12 ` [Qemu-devel] Re: QEMU regression problems - Update FPU Gerhard Wiesinger
2011-02-23  7:09   ` Gerhard Wiesinger
2011-02-23  8:16   ` Peter Maydell
2011-02-23  9:45     ` Laurent Desnogues
2011-02-23 19:04       ` Aurelien Jarno
2011-02-24 11:10         ` Paolo Bonzini
2011-02-24 11:21           ` Laurent Desnogues
2011-02-24  7:03     ` Gerhard Wiesinger
2011-02-24  7:31       ` Aurelien Jarno [this message]

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=20110224073148.GG6703@hall.aurel32.net \
    --to=aurelien@aurel32.net \
    --cc=kevin@koconnor.net \
    --cc=lists@wiesinger.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=roytam@gmail.com \
    --cc=seabios@seabios.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.