summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2018-05-26 11:43:11 +0200
committerGitHub <noreply@github.com>2018-05-26 11:43:11 +0200
commit98e288cb4b1685979dfe4180312a960aa3ab4801 (patch)
tree461c5bb1915ee9231d7dd21092868dfdacbf2992 /Source/Core
parentf64cbc86b1975a6862042deba99aadae8eaf22d9 (diff)
parent3da751f054eea1da4113be7917c6832835051bd1 (diff)
Merge pull request #6966 from lioncash/fmul
Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_mul() is a signaling NaN
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h
index 70e0a01643..01847fbddc 100644
--- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h
+++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h
@@ -94,13 +94,17 @@ inline double MakeQuiet(double d)
inline double NI_mul(double a, double b)
{
- double t = a * b;
+ const double t = a * b;
if (std::isnan(t))
{
+ if (Common::IsSNAN(a) || Common::IsSNAN(b))
+ SetFPException(FPSCR_VXSNAN);
+
if (std::isnan(a))
return MakeQuiet(a);
if (std::isnan(b))
return MakeQuiet(b);
+
SetFPException(FPSCR_VXIMZ);
return PPC_NAN;
}