aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/vfp/vfpsingle.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/vfp/vfpsingle.c')
-rw-r--r--arch/arm/vfp/vfpsingle.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
index 14dd696ddeb1..4ac27f193934 100644
--- a/arch/arm/vfp/vfpsingle.c
+++ b/arch/arm/vfp/vfpsingle.c
@@ -632,6 +632,7 @@ static u32 vfp_single_ftosi(int sd, int unused, s32 m, u32 fpscr)
632 struct vfp_single vsm; 632 struct vfp_single vsm;
633 u32 d, exceptions = 0; 633 u32 d, exceptions = 0;
634 int rmode = fpscr & FPSCR_RMODE_MASK; 634 int rmode = fpscr & FPSCR_RMODE_MASK;
635 int tm;
635 636
636 vfp_single_unpack(&vsm, m); 637 vfp_single_unpack(&vsm, m);
637 vfp_single_dump("VSM", &vsm); 638 vfp_single_dump("VSM", &vsm);
@@ -639,10 +640,14 @@ static u32 vfp_single_ftosi(int sd, int unused, s32 m, u32 fpscr)
639 /* 640 /*
640 * Do we have a denormalised number? 641 * Do we have a denormalised number?
641 */ 642 */
643 tm = vfp_single_type(&vsm);
642 if (vfp_single_type(&vsm) & VFP_DENORMAL) 644 if (vfp_single_type(&vsm) & VFP_DENORMAL)
643 exceptions |= FPSCR_IDC; 645 exceptions |= FPSCR_IDC;
644 646
645 if (vsm.exponent >= 127 + 32) { 647 if (tm & VFP_NAN) {
648 d = 0;
649 exceptions |= FPSCR_IOC;
650 } else if (vsm.exponent >= 127 + 32) {
646 /* 651 /*
647 * m >= 2^31-2^7: invalid 652 * m >= 2^31-2^7: invalid
648 */ 653 */
@@ -1188,7 +1193,7 @@ u32 vfp_single_cpdo(u32 inst, u32 fpscr)
1188 pr_debug("VFP: vecstride=%u veclen=%u\n", vecstride, 1193 pr_debug("VFP: vecstride=%u veclen=%u\n", vecstride,
1189 (veclen >> FPSCR_LENGTH_BIT) + 1); 1194 (veclen >> FPSCR_LENGTH_BIT) + 1);
1190 1195
1191 fop = (op == FOP_EXT) ? fop_extfns[sn] : fop_fns[FOP_TO_IDX(op)]; 1196 fop = (op == FOP_EXT) ? fop_extfns[FEXT_TO_IDX(inst)] : fop_fns[FOP_TO_IDX(op)];
1192 if (!fop) 1197 if (!fop)
1193 goto invalid; 1198 goto invalid;
1194 1199