svn commit: r344496 - stable/12/sys/powerpc/fpu
Justin Hibbits
jhibbits at FreeBSD.org
Sun Feb 24 20:15:17 UTC 2019
Author: jhibbits
Date: Sun Feb 24 20:15:16 2019
New Revision: 344496
URL: https://svnweb.freebsd.org/changeset/base/344496
Log:
MFC r343078:
powerpc: Fix FPU fsqrt emulation special case results
If fsqrts is emulated with +INF as its argument, the 0 return value causes a
NULL pointer dereference, panicking the system. Follow the PowerISA and
return +INF with no FP exception.
Modified:
stable/12/sys/powerpc/fpu/fpu_sqrt.c
Directory Properties:
stable/12/ (props changed)
Modified: stable/12/sys/powerpc/fpu/fpu_sqrt.c
==============================================================================
--- stable/12/sys/powerpc/fpu/fpu_sqrt.c Sun Feb 24 19:31:42 2019 (r344495)
+++ stable/12/sys/powerpc/fpu/fpu_sqrt.c Sun Feb 24 20:15:16 2019 (r344496)
@@ -226,12 +226,12 @@ fpu_sqrt(struct fpemu *fe)
return (x);
}
if (x->fp_sign) {
+ fe->fe_cx |= FPSCR_VXSQRT;
return (fpu_newnan(fe));
}
if (ISINF(x)) {
- fe->fe_cx |= FPSCR_VXSQRT;
- DUMPFPN(FPE_REG, 0);
- return (0);
+ DUMPFPN(FPE_REG, x);
+ return (x);
}
/*
More information about the svn-src-stable-12
mailing list