From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47023) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUwQ-0003D5-3A for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:54:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGUwL-0004aw-Rf for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:54:05 -0500 Received: from static.88-198-71-155.clients.your-server.de ([88.198.71.155]:57909 helo=socrates.bennee.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUwL-0004aV-Lf for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:54:01 -0500 References: <1422456666-12270-1-git-send-email-libhu.so@gmail.com> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1422456666-12270-1-git-send-email-libhu.so@gmail.com> Date: Wed, 28 Jan 2015 15:54:10 +0000 Message-ID: <87h9va7vfh.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH] FMULX should flushes operators to zero when FZ is set. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Xiangyu Hu Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org Xiangyu Hu writes: > The difference between FMULX and FMUL is that FMULX will return 2.0f when one operator is > FPInfinity and the other one is FPZero, whilst FMUL will return a Default NaN. Without > this patch, the emulation would result in inconsistency. > > Signed-off-by: Xiangyu Hu > --- > target-arm/helper-a64.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/target-arm/helper-a64.c b/target-arm/helper-a64.c > index 81066ca..ebd9247 100644 > --- a/target-arm/helper-a64.c > +++ b/target-arm/helper-a64.c > @@ -135,6 +135,9 @@ float32 HELPER(vfp_mulxs)(float32 a, float32 b, void *fpstp) > { > float_status *fpst = fpstp; > > + a = float32_squash_input_denormal(a, fpst); > + b = float32_squash_input_denormal(b, fpst); > + > if ((float32_is_zero(a) && float32_is_infinity(b)) || > (float32_is_infinity(a) && float32_is_zero(b))) { > /* 2.0 with the sign bit set to sign(A) XOR sign(B) */ > @@ -148,6 +151,9 @@ float64 HELPER(vfp_mulxd)(float64 a, float64 b, void *fpstp) > { > float_status *fpst = fpstp; > > + a = float64_squash_input_denormal(a, fpst); > + b = float64_squash_input_denormal(b, fpst); > + > if ((float64_is_zero(a) && float64_is_infinity(b)) || > (float64_is_infinity(a) && float64_is_zero(b))) { > /* 2.0 with the sign bit set to sign(A) XOR sign(B) */ Do we have test cases that trip up here? It would be nice to include them in our testing as the random nature of RISU has obviously failed to trip up on this instruction. -- Alex Bennée