Skip to content

Commit

Permalink
ARM: 8026/1: Fix emulation of multiply accumulate instructions
Browse files Browse the repository at this point in the history
The emulation for single and double precision multiply accumulate
instructions correctly normalised any denormal values in the operand
registers, but failed to normalise the destination (accumulator)
register.

This fixes https://bugzilla.kernel.org/show_bug.cgi?id=70501

Signed-off-by: Jay Foad <jay.foad@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Jay Foad authored and Russell King committed Apr 14, 2014
1 parent c39e1ef commit 244b478
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm/vfp/vfpdouble.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,8 @@ vfp_double_multiply_accumulate(int dd, int dn, int dm, u32 fpscr, u32 negate, ch
vdp.sign = vfp_sign_negate(vdp.sign);

vfp_double_unpack(&vdn, vfp_get_double(dd));
if (vdn.exponent == 0 && vdn.significand)
vfp_double_normalise_denormal(&vdn);
if (negate & NEG_SUBTRACT)
vdn.sign = vfp_sign_negate(vdn.sign);

Expand Down
2 changes: 2 additions & 0 deletions arch/arm/vfp/vfpsingle.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ vfp_single_multiply_accumulate(int sd, int sn, s32 m, u32 fpscr, u32 negate, cha
v = vfp_get_float(sd);
pr_debug("VFP: s%u = %08x\n", sd, v);
vfp_single_unpack(&vsn, v);
if (vsn.exponent == 0 && vsn.significand)
vfp_single_normalise_denormal(&vsn);
if (negate & NEG_SUBTRACT)
vsn.sign = vfp_sign_negate(vsn.sign);

Expand Down

0 comments on commit 244b478

Please sign in to comment.