Received: from [140.186.70.92] (port=41590 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PsVEs-0000KY-Tr for qemu-devel@nongnu.org; Thu, 24 Feb 2011 02:03:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PsVEr-0006uM-I6 for qemu-devel@nongnu.org; Thu, 24 Feb 2011 02:03:50 -0500 Received: from chello084112167138.7.11.vie.surfer.at ([84.112.167.138]:44439 helo=wiesinger.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PsVEr-0006uE-6u for qemu-devel@nongnu.org; Thu, 24 Feb 2011 02:03:49 -0500 Date: Thu, 24 Feb 2011 08:03:02 +0100 (CET) From: Gerhard Wiesinger Subject: Re: [Qemu-devel] Re: QEMU regression problems - Update FPU In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="-1463811584-1700431479-1298530983=:11165" List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Kevin O'Connor , seabios@seabios.org, qemu-devel@nongnu.org, Aurelien Jarno , Roy Tam This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1463811584-1700431479-1298530983=:11165 Content-Type: TEXT/PLAIN; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by wiesinger.com id p1O733dh012056 On Wed, 23 Feb 2011, Peter Maydell wrote: > On 18 February 2011 07:12, Gerhard Wiesinger wrot= e: >> Issue 1.) with FPU still present >> I tracked down the problematic code and it is a rounding error from do= uble >> precision to 64bit floats: Any ideas how to fix such an issue in gener= al? >> >> QEMU result in ST0: 0.42925860786976457 (wrong emulated) >> KVM result in ST0: =C2=A00.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=20 doesn't compile on x64 (AMD) (How to find out which mode is used, what=20 other modes exist?). But can't we use the float64 type and use the normal i386 (or higher)=20 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=20 rounding to e.g. float64 after each FPU operation. Maybe we can also use a define or config switch for accuracy vs. speed. What do you think? Ciao, Gerhard -- http://www.wiesinger.com/ ---1463811584-1700431479-1298530983=:11165--