From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUlq-0004x4-Jh for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:43:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGUll-0000G4-8O for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:43:10 -0500 Received: from mail-pa0-x231.google.com ([2607:f8b0:400e:c03::231]:33626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGUlk-0000Fp-T0 for qemu-devel@nongnu.org; Wed, 28 Jan 2015 10:43:05 -0500 Received: by mail-pa0-f49.google.com with SMTP id fa1so26580570pad.8 for ; Wed, 28 Jan 2015 07:43:04 -0800 (PST) Content-Type: multipart/alternative; boundary="Apple-Mail=_BE61DCD9-AE1F-45C5-9BB2-ECC79D9C7D58" Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.4\)) From: Xiangyu Hu In-Reply-To: Date: Wed, 28 Jan 2015 23:42:53 +0800 Message-Id: <6A6F6FD2-893C-47E6-BCE5-6AA86F578875@gmail.com> References: <1422456666-12270-1-git-send-email-libhu.so@gmail.com> 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: Peter Maydell Cc: QEMU Developers --Apple-Mail=_BE61DCD9-AE1F-45C5-9BB2-ECC79D9C7D58 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Thanks Peter.=20 I have sent another patch with updated commit message. - xiangyu > On 28 Jan, 2015, at 10:54 pm, Peter Maydell = wrote: >=20 > On 28 January 2015 at 14:51, Xiangyu Hu > wrote: >> 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. >>=20 >> Signed-off-by: Xiangyu Hu >> --- >> target-arm/helper-a64.c | 6 ++++++ >> 1 file changed, 6 insertions(+) >>=20 >> 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 =3D fpstp; >>=20 >> + a =3D float32_squash_input_denormal(a, fpst); >> + b =3D 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 =3D fpstp; >>=20 >> + a =3D float64_squash_input_denormal(a, fpst); >> + b =3D 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) */ >=20 > I think this code change is correct but the commit message doesn't > do a very good job of describing what the change is or why it is > needed... (in particular the difference between FMULX and FMUL is > completely irrelevant to the need for this fix, but it is pretty > much the only thing the commit message talks about). >=20 > thanks > -- PMM --Apple-Mail=_BE61DCD9-AE1F-45C5-9BB2-ECC79D9C7D58 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii Thanks Peter. 

I have sent another patch with updated commit message.

- xiangyu

On 28 Jan, 2015, at 10:54 pm, Peter Maydell <peter.maydell@linaro.org> wrote:

On 28 January 2015 at 14:51, Xiangyu Hu = <libhu.so@gmail.com> wrote:
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 <libhu.so@gmail.com>
---
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 =3D = fpstp;

+    a =3D = float32_squash_input_denormal(a, fpst);
+ =    b =3D float32_squash_input_denormal(b, fpst);
+
    if = ((float32_is_zero(a) && float32_is_infinity(b)) ||
        (float32_is_inf= inity(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 =3D fpstp;

+    a =3D = float64_squash_input_denormal(a, fpst);
+ =    b =3D float64_squash_input_denormal(b, fpst);
+
    if = ((float64_is_zero(a) && float64_is_infinity(b)) ||
        (float64_is_inf= inity(a) && float64_is_zero(b))) {
        /* 2.0 with = the sign bit set to sign(A) XOR sign(B) */

I think this code change is correct but the = commit message doesn't
do a very good job of = describing what the change is or why it is
needed... (in particular the difference between = FMULX and FMUL is
completely irrelevant to = the need for this fix, but it is pretty
much the only thing the commit message talks = about).

thanks
-- PMM

= --Apple-Mail=_BE61DCD9-AE1F-45C5-9BB2-ECC79D9C7D58--