Skip to content

Commit 244b478

Browse files
jayfoadRussell King
authored andcommitted
ARM: 8026/1: Fix emulation of multiply accumulate instructions
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>
1 parent c39e1ef commit 244b478

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

‎arch/arm/vfp/vfpdouble.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,8 @@ vfp_double_multiply_accumulate(int dd, int dn, int dm, u32 fpscr, u32 negate, ch
866866
vdp.sign = vfp_sign_negate(vdp.sign);
867867

868868
vfp_double_unpack(&vdn, vfp_get_double(dd));
869+
if (vdn.exponent == 0 && vdn.significand)
870+
vfp_double_normalise_denormal(&vdn);
869871
if (negate & NEG_SUBTRACT)
870872
vdn.sign = vfp_sign_negate(vdn.sign);
871873

‎arch/arm/vfp/vfpsingle.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,8 @@ vfp_single_multiply_accumulate(int sd, int sn, s32 m, u32 fpscr, u32 negate, cha
915915
v = vfp_get_float(sd);
916916
pr_debug("VFP: s%u = %08x\n", sd, v);
917917
vfp_single_unpack(&vsn, v);
918+
if (vsn.exponent == 0 && vsn.significand)
919+
vfp_single_normalise_denormal(&vsn);
918920
if (negate & NEG_SUBTRACT)
919921
vsn.sign = vfp_sign_negate(vsn.sign);
920922

0 commit comments

Comments
 (0)