From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48602) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vy0Eu-0003pP-TO for qemu-devel@nongnu.org; Tue, 31 Dec 2013 09:24:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vy0Eq-0004pS-4n for qemu-devel@nongnu.org; Tue, 31 Dec 2013 09:24:12 -0500 Received: from mail-pa0-x22d.google.com ([2607:f8b0:400e:c03::22d]:51979) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vy0Ep-0004pM-TE for qemu-devel@nongnu.org; Tue, 31 Dec 2013 09:24:08 -0500 Received: by mail-pa0-f45.google.com with SMTP id fb1so12733352pad.18 for ; Tue, 31 Dec 2013 06:24:06 -0800 (PST) Sender: Richard Henderson Message-ID: <52C2D382.8040703@twiddle.net> Date: Tue, 31 Dec 2013 06:24:02 -0800 From: Richard Henderson MIME-Version: 1.0 References: <1388496958-3542-1-git-send-email-peter.maydell@linaro.org> <1388496958-3542-10-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1388496958-3542-10-git-send-email-peter.maydell@linaro.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 09/22] softfloat: Fix float64_to_uint32 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Tom Musta , Peter Crosthwaite , patches@linaro.org, Aurelien Jarno , Michael Matz , Alexander Graf , Claudio Fontana , Dirk Mueller , Will Newton , Laurent Desnogues , =?ISO-8859-1?Q?Alex_Benn=E9e?= , kvmarm@lists.cs.columbia.edu, Christoffer Dall On 12/31/2013 05:35 AM, Peter Maydell wrote: > From: Tom Musta > > The float64_to_uint32 has several flaws: > > - for numbers between 2**32 and 2**64, the inexact exception flag > may get incorrectly set. In this case, only the invalid flag > should be set. > > test pattern: 425F81378DC0CD1F / 0x1.f81378dc0cd1fp+38 > > - for numbers between 2**63 and 2**64, incorrect results may > be produced: > > test pattern: 43EAAF73F1F0B8BD / 0x1.aaf73f1f0b8bdp+63 > > This patch re-implements float64_to_uint32 to re-use the > float64_to_uint64 routine (instead of float64_to_int64). For the > saturation case, we ignore any flags which the conversion routine > has set and raise only the invalid flag. > > This contribution can be licensed under either the softfloat-2a or -2b > license. > > Signed-off-by: Tom Musta > Message-id: 1387397961-4894-5-git-send-email-tommusta@gmail.com > Signed-off-by: Peter Maydell > --- > fpu/softfloat.c | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) Reviewed-by: Richard Henderson r~