citra-emu
/
citra
Archived
1
0
Fork 0

video_core: optimize NaN check

This commit is contained in:
Tillmann Karras 2017-12-03 23:39:30 +00:00
parent 81fbe06915
commit 1c2750d5bd
1 changed files with 2 additions and 2 deletions

View File

@ -60,8 +60,8 @@ public:
Float<M, E> operator*(const Float<M, E>& flt) const { Float<M, E> operator*(const Float<M, E>& flt) const {
float result = value * flt.ToFloat32(); float result = value * flt.ToFloat32();
// PICA gives 0 instead of NaN when multiplying by inf // PICA gives 0 instead of NaN when multiplying by inf
if (!std::isnan(value) && !std::isnan(flt.ToFloat32())) if (std::isnan(result))
if (std::isnan(result)) if (!std::isnan(value) && !std::isnan(flt.ToFloat32()))
result = 0.f; result = 0.f;
return Float<M, E>::FromFloat32(result); return Float<M, E>::FromFloat32(result);
} }