Date: Sun, 24 Feb 2019 20:15:16 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r344496 - stable/12/sys/powerpc/fpu Message-ID: <201902242015.x1OKFGE6014818@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902242015.x1OKFGE6014818>