diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2018-05-27 10:21:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-27 10:21:20 +0200 |
| commit | e9ce75ccc41938f81b7e4e36a7b4ab72f9007c3d (patch) | |
| tree | 1ac0b34828c6ec942a1f415f9caf1563fbc9d458 /Source/Core | |
| parent | 8f003f995b7a15c8526e15a6c13117cd4697728f (diff) | |
| parent | 054c1b32eb4bbde226de6fd70c70c25bd0cf5535 (diff) | |
Merge pull request #6977 from lioncash/add
Interpreter_FPUtils: Set FPSCR.VXSNAN if either operand to NI_add() is a signaling NaN
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h index 01847fbddc..2d16cbea84 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h @@ -137,16 +137,22 @@ inline double NI_div(double a, double b) inline double NI_add(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_VXISI); return PPC_NAN; } + return t; } |
