Merge pull request #6518 from lioncash/namespace

Interpreter: Don't dump the MathUtils namespace into scope in Interpreter_FloatingPoint and Interpreter_Paired
This commit is contained in:
Léo Lam 2018-03-25 11:24:24 +02:00 committed by GitHub
commit e9976c27c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 12 deletions

View File

@ -11,8 +11,6 @@
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h" #include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
#include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PowerPC.h"
using namespace MathUtil;
// Extremely rare - actually, never seen. // Extremely rare - actually, never seen.
// Star Wars : Rogue Leader spams that at some point :| // Star Wars : Rogue Leader spams that at some point :|
void Interpreter::Helper_UpdateCR1() void Interpreter::Helper_UpdateCR1()
@ -27,7 +25,7 @@ void Interpreter::Helper_FloatCompareOrdered(UGeckoInstruction inst, double fa,
if (std::isnan(fa) || std::isnan(fb)) if (std::isnan(fa) || std::isnan(fb))
{ {
compareResult = FPCC::FU; compareResult = FPCC::FU;
if (IsSNAN(fa) || IsSNAN(fb)) if (MathUtil::IsSNAN(fa) || MathUtil::IsSNAN(fb))
{ {
SetFPException(FPSCR_VXSNAN); SetFPException(FPSCR_VXSNAN);
if (FPSCR.VE == 0) if (FPSCR.VE == 0)
@ -67,7 +65,7 @@ void Interpreter::Helper_FloatCompareUnordered(UGeckoInstruction inst, double fa
{ {
compareResult = FPCC::FU; compareResult = FPCC::FU;
if (IsSNAN(fa) || IsSNAN(fb)) if (MathUtil::IsSNAN(fa) || MathUtil::IsSNAN(fb))
{ {
SetFPException(FPSCR_VXSNAN); SetFPException(FPSCR_VXSNAN);
} }
@ -371,7 +369,7 @@ void Interpreter::fdivsx(UGeckoInstruction inst)
void Interpreter::fresx(UGeckoInstruction inst) void Interpreter::fresx(UGeckoInstruction inst)
{ {
double b = rPS0(inst.FB); double b = rPS0(inst.FB);
rPS0(inst.FD) = rPS1(inst.FD) = ApproximateReciprocal(b); rPS0(inst.FD) = rPS1(inst.FD) = MathUtil::ApproximateReciprocal(b);
if (b == 0.0) if (b == 0.0)
{ {
@ -397,7 +395,7 @@ void Interpreter::frsqrtex(UGeckoInstruction inst)
SetFPException(FPSCR_ZX); SetFPException(FPSCR_ZX);
} }
rPS0(inst.FD) = ApproximateReciprocalSquareRoot(b); rPS0(inst.FD) = MathUtil::ApproximateReciprocalSquareRoot(b);
PowerPC::UpdateFPRF(rPS0(inst.FD)); PowerPC::UpdateFPRF(rPS0(inst.FD));
if (inst.Rc) if (inst.Rc)

View File

@ -10,8 +10,6 @@
#include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h" #include "Core/PowerPC/Interpreter/Interpreter_FPUtils.h"
#include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PowerPC.h"
using namespace MathUtil;
// These "binary instructions" do not alter FPSCR. // These "binary instructions" do not alter FPSCR.
void Interpreter::ps_sel(UGeckoInstruction inst) void Interpreter::ps_sel(UGeckoInstruction inst)
{ {
@ -125,8 +123,8 @@ void Interpreter::ps_res(UGeckoInstruction inst)
SetFPException(FPSCR_ZX); SetFPException(FPSCR_ZX);
} }
rPS0(inst.FD) = ApproximateReciprocal(a); rPS0(inst.FD) = MathUtil::ApproximateReciprocal(a);
rPS1(inst.FD) = ApproximateReciprocal(b); rPS1(inst.FD) = MathUtil::ApproximateReciprocal(b);
PowerPC::UpdateFPRF(rPS0(inst.FD)); PowerPC::UpdateFPRF(rPS0(inst.FD));
if (inst.Rc) if (inst.Rc)
@ -145,8 +143,8 @@ void Interpreter::ps_rsqrte(UGeckoInstruction inst)
SetFPException(FPSCR_VXSQRT); SetFPException(FPSCR_VXSQRT);
} }
rPS0(inst.FD) = ForceSingle(ApproximateReciprocalSquareRoot(rPS0(inst.FB))); rPS0(inst.FD) = ForceSingle(MathUtil::ApproximateReciprocalSquareRoot(rPS0(inst.FB)));
rPS1(inst.FD) = ForceSingle(ApproximateReciprocalSquareRoot(rPS1(inst.FB))); rPS1(inst.FD) = ForceSingle(MathUtil::ApproximateReciprocalSquareRoot(rPS1(inst.FB)));
PowerPC::UpdateFPRF(rPS0(inst.FD)); PowerPC::UpdateFPRF(rPS0(inst.FD));