tree 8269bb5c858aaa0a0483cb81759ca947e0b396c1
parent 858297509590ef4aa5690e30c2f5505077b4f369
author Catalin Marinas <[EMAIL PROTECTED]> Wed, 03 Aug 2005 19:53:25 +0100
committer Russell King <[EMAIL PROTECTED]> Wed, 03 Aug 2005 19:53:25 +0100

[PATCH] ARM: 2841/1: Fix VFP +/-0 case for doubles addition

Patch from Catalin Marinas

The IEEE 754 standard specifies that the result of (x - x), where x is
a valid number, should be -0 if the rounding mode is towards minus
infinity or +0 otherwise.

Signed-off-by: Catalin Marinas <[EMAIL PROTECTED]>
Signed-off-by: Russell King <[EMAIL PROTECTED]>

 arch/arm/vfp/vfpdouble.c |    3 +++
 1 files changed, 3 insertions(+)

diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -770,6 +770,9 @@ vfp_double_add(struct vfp_double *vdd, s
                if ((s64)m_sig < 0) {
                        vdd->sign = vfp_sign_negate(vdd->sign);
                        m_sig = -m_sig;
+               } else if (m_sig == 0) {
+                       vdd->sign = (fpscr & FPSCR_RMODE_MASK) ==
+                                     FPSCR_ROUND_MINUSINF ? 0x8000 : 0;
                }
        } else {
                m_sig += vdn->significand;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to