qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] softfloat: Handle float_muladd_negate_c when produc


From: Richard Sandiford
Subject: [Qemu-devel] [PATCH] softfloat: Handle float_muladd_negate_c when product is zero
Date: Mon, 21 Jan 2013 21:32:37 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Honour float_muladd_negate_c in the case where the product is zero and
c is nonzero.  Previously we would fail to negate c.

Seen in (and tested against) the gfortran testsuite on MIPS.

Signed-off-by: Richard Sandiford <address@hidden>
---
 fpu/softfloat.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index ac3d150..0028415 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -2234,6 +2234,9 @@ float32 float32_muladd(float32 a, float32 b, float32 c, 
int flags STATUS_PARAM)
             }
         }
         /* Zero plus something non-zero : just return the something */
+        if (flags & float_muladd_negate_c) {
+            signflip ^= 1;
+        }
         return make_float32(float32_val(c) ^ (signflip << 31));
     }
 
@@ -3787,6 +3790,9 @@ float64 float64_muladd(float64 a, float64 b, float64 c, 
int flags STATUS_PARAM)
             }
         }
         /* Zero plus something non-zero : just return the something */
+        if (flags & float_muladd_negate_c) {
+            signflip ^= 1;
+        }
         return make_float64(float64_val(c) ^ ((uint64_t)signflip << 63));
     }
 
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]