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. MFC after: 1 week
This commit is contained in:
parent
73f6ccd9e7
commit
bd326619e8
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user