Skip to content

Commit

Permalink
[PATCH] ARM: 2841/1: Fix VFP +/-0 case for doubles addition
Browse files Browse the repository at this point in the history
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 <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Catalin Marinas authored and Russell King committed Aug 3, 2005
1 parent 8582975 commit 7b1fbf2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/arm/vfp/vfpdouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,9 @@ vfp_double_add(struct vfp_double *vdd, struct vfp_double *vdn,
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;
Expand Down

0 comments on commit 7b1fbf2

Please sign in to comment.