1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

Fix intermediate truncation in vector FP fused multiply-add.

This commit is contained in:
Andrew Church 2015-01-18 07:05:38 +09:00
parent 3eb3f66e96
commit 9a310c312e

View File

@ -865,7 +865,7 @@ private:
CPU.VPR[vd]._f[w] = (float)FPR_NAN;
else
{
CPU.VPR[vd]._f[w] = a * c + b;
CPU.VPR[vd]._f[w] = fmaf(a, c, b);
if (std::isnan(CPU.VPR[vd]._f[w]))
CPU.VPR[vd]._f[w] = (float)FPR_NAN;
}
@ -1288,7 +1288,7 @@ private:
CPU.VPR[vd]._f[w] = (float)FPR_NAN;
else
{
CPU.VPR[vd]._f[w] = -(a * c - b);
CPU.VPR[vd]._f[w] = -fmaf(a, c, -b);
if (std::isnan(CPU.VPR[vd]._f[w]))
CPU.VPR[vd]._f[w] = (float)FPR_NAN;
}