Skip to content
Permalink
Browse files
Merge pull request #6495 from lioncash/namespace
PowerPC: Namespace all header contents for PowerPC.h
  • Loading branch information
delroth committed Mar 23, 2018
2 parents 27ffc8a + 4c97deb commit 894d4c9
Show file tree
Hide file tree
Showing 19 changed files with 187 additions and 183 deletions.
@@ -21,7 +21,7 @@ double HLE::SystemVABI::VAList::GetFPR(u32 fpr) const
HLE::SystemVABI::VAListStruct::VAListStruct(u32 address)
: VAList(0), m_va_list{PowerPC::HostRead_U8(address), PowerPC::HostRead_U8(address + 1),
PowerPC::HostRead_U32(address + 4), PowerPC::HostRead_U32(address + 8)},
m_address(address), m_has_fpr_area(GetCRBit(6) == 1)
m_address(address), m_has_fpr_area(PowerPC::GetCRBit(6) == 1)
{
m_stack = m_va_list.overflow_arg_area;
m_gpr += m_va_list.gpr;
@@ -450,7 +450,7 @@ static void gdb_read_register()
wbe32hex(reply, MSR);
break;
case 66:
wbe32hex(reply, GetCR());
wbe32hex(reply, PowerPC::GetCR());
break;
case 67:
wbe32hex(reply, LR);
@@ -497,7 +497,7 @@ static void gdb_read_registers()
bufptr += 32 * 8;
wbe32hex(bufptr, PC); bufptr += 4;
wbe32hex(bufptr, MSR); bufptr += 4;
wbe32hex(bufptr, GetCR()); bufptr += 4;
wbe32hex(bufptr, PowerPC::GetCR()); bufptr += 4;
wbe32hex(bufptr, LR); bufptr += 4;
@@ -553,7 +553,7 @@ static void gdb_write_register()
MSR = re32hex(bufptr);
break;
case 66:
SetCR(re32hex(bufptr));
PowerPC::SetCR(re32hex(bufptr));
break;
case 67:
LR = re32hex(bufptr);
@@ -39,7 +39,7 @@ void Interpreter::bcx(UGeckoInstruction inst)
const bool only_condition_check = ((inst.BO >> 2) & 1);
int ctr_check = ((CTR != 0) ^ (inst.BO >> 1)) & 1;
bool counter = only_condition_check || ctr_check;
bool condition = only_counter_check || (GetCRBit(inst.BI) == u32(true_false));
bool condition = only_counter_check || (PowerPC::GetCRBit(inst.BI) == u32(true_false));

if (counter && condition)
{
@@ -78,7 +78,7 @@ void Interpreter::bcctrx(UGeckoInstruction inst)
DEBUG_ASSERT_MSG(POWERPC, inst.BO_2 & BO_DONT_DECREMENT_FLAG,
"bcctrx with decrement and test CTR option is invalid!");

int condition = ((inst.BO_2 >> 4) | (GetCRBit(inst.BI_2) == ((inst.BO_2 >> 3) & 1))) & 1;
int condition = ((inst.BO_2 >> 4) | (PowerPC::GetCRBit(inst.BI_2) == ((inst.BO_2 >> 3) & 1))) & 1;

if (condition)
{
@@ -96,7 +96,7 @@ void Interpreter::bclrx(UGeckoInstruction inst)
CTR--;

int counter = ((inst.BO_2 >> 2) | ((CTR != 0) ^ (inst.BO_2 >> 1))) & 1;
int condition = ((inst.BO_2 >> 4) | (GetCRBit(inst.BI_2) == ((inst.BO_2 >> 3) & 1))) & 1;
int condition = ((inst.BO_2 >> 4) | (PowerPC::GetCRBit(inst.BI_2) == ((inst.BO_2 >> 3) & 1))) & 1;

if (counter & condition)
{
@@ -17,7 +17,7 @@ using namespace MathUtil;
// Star Wars : Rogue Leader spams that at some point :|
void Interpreter::Helper_UpdateCR1()
{
SetCRField(1, (FPSCR.FX << 3) | (FPSCR.FEX << 2) | (FPSCR.VX << 1) | FPSCR.OX);
PowerPC::SetCRField(1, (FPSCR.FX << 3) | (FPSCR.FEX << 2) | (FPSCR.VX << 1) | FPSCR.OX);
}

void Interpreter::Helper_FloatCompareOrdered(UGeckoInstruction inst, double fa, double fb)
@@ -56,7 +56,7 @@ void Interpreter::Helper_FloatCompareOrdered(UGeckoInstruction inst, double fa,
// Clear and set the FPCC bits accordingly.
FPSCR.FPRF = (FPSCR.FPRF & ~0xF) | compareResult;

SetCRField(inst.CRFD, compareResult);
PowerPC::SetCRField(inst.CRFD, compareResult);
}

void Interpreter::Helper_FloatCompareUnordered(UGeckoInstruction inst, double fa, double fb)
@@ -88,7 +88,7 @@ void Interpreter::Helper_FloatCompareUnordered(UGeckoInstruction inst, double fa
// Clear and set the FPCC bits accordingly.
FPSCR.FPRF = (FPSCR.FPRF & ~0xF) | compareResult;

SetCRField(inst.CRFD, compareResult);
PowerPC::SetCRField(inst.CRFD, compareResult);
}

void Interpreter::fcmpo(UGeckoInstruction inst)
@@ -278,7 +278,7 @@ void Interpreter::frspx(UGeckoInstruction inst) // round to single
double rounded = ForceSingle(b);
SetFI(b != rounded);
FPSCR.FR = fabs(rounded) > fabs(b);
UpdateFPRF(rounded);
PowerPC::UpdateFPRF(rounded);
rPS0(inst.FD) = rPS1(inst.FD) = rounded;

if (inst.Rc)
@@ -290,7 +290,7 @@ void Interpreter::fmulx(UGeckoInstruction inst)
rPS0(inst.FD) = ForceDouble(NI_mul(rPS0(inst.FA), rPS0(inst.FC)));
FPSCR.FI = 0; // are these flags important?
FPSCR.FR = 0;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -303,7 +303,7 @@ void Interpreter::fmulsx(UGeckoInstruction inst)
// FPSCR.FI = d_value != rPS0(_inst.FD);
FPSCR.FI = 0;
FPSCR.FR = 0;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -313,7 +313,7 @@ void Interpreter::fmaddx(UGeckoInstruction inst)
{
double result = ForceDouble(NI_madd(rPS0(inst.FA), rPS0(inst.FC), rPS0(inst.FB)));
rPS0(inst.FD) = result;
UpdateFPRF(result);
PowerPC::UpdateFPRF(result);

if (inst.Rc)
Helper_UpdateCR1();
@@ -326,7 +326,7 @@ void Interpreter::fmaddsx(UGeckoInstruction inst)
rPS0(inst.FD) = rPS1(inst.FD) = ForceSingle(d_value);
FPSCR.FI = d_value != rPS0(inst.FD);
FPSCR.FR = 0;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -335,15 +335,15 @@ void Interpreter::fmaddsx(UGeckoInstruction inst)
void Interpreter::faddx(UGeckoInstruction inst)
{
rPS0(inst.FD) = ForceDouble(NI_add(rPS0(inst.FA), rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
}
void Interpreter::faddsx(UGeckoInstruction inst)
{
rPS0(inst.FD) = rPS1(inst.FD) = ForceSingle(NI_add(rPS0(inst.FA), rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -352,7 +352,7 @@ void Interpreter::faddsx(UGeckoInstruction inst)
void Interpreter::fdivx(UGeckoInstruction inst)
{
rPS0(inst.FD) = ForceDouble(NI_div(rPS0(inst.FA), rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

// FR,FI,OX,UX???
if (inst.Rc)
@@ -361,7 +361,7 @@ void Interpreter::fdivx(UGeckoInstruction inst)
void Interpreter::fdivsx(UGeckoInstruction inst)
{
rPS0(inst.FD) = rPS1(inst.FD) = ForceSingle(NI_div(rPS0(inst.FA), rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -378,7 +378,7 @@ void Interpreter::fresx(UGeckoInstruction inst)
SetFPException(FPSCR_ZX);
}

UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -398,7 +398,7 @@ void Interpreter::frsqrtex(UGeckoInstruction inst)
}

rPS0(inst.FD) = ApproximateReciprocalSquareRoot(b);
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -407,7 +407,7 @@ void Interpreter::frsqrtex(UGeckoInstruction inst)
void Interpreter::fmsubx(UGeckoInstruction _inst)
{
rPS0(_inst.FD) = ForceDouble(NI_msub(rPS0(_inst.FA), rPS0(_inst.FC), rPS0(_inst.FB)));
UpdateFPRF(rPS0(_inst.FD));
PowerPC::UpdateFPRF(rPS0(_inst.FD));

if (_inst.Rc)
Helper_UpdateCR1();
@@ -417,7 +417,7 @@ void Interpreter::fmsubsx(UGeckoInstruction inst)
{
double c_value = Force25Bit(rPS0(inst.FC));
rPS0(inst.FD) = rPS1(inst.FD) = ForceSingle(NI_msub(rPS0(inst.FA), c_value, rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -427,7 +427,7 @@ void Interpreter::fnmaddx(UGeckoInstruction inst)
{
double result = ForceDouble(NI_madd(rPS0(inst.FA), rPS0(inst.FC), rPS0(inst.FB)));
rPS0(inst.FD) = std::isnan(result) ? result : -result;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -438,7 +438,7 @@ void Interpreter::fnmaddsx(UGeckoInstruction inst)
double c_value = Force25Bit(rPS0(inst.FC));
double result = ForceSingle(NI_madd(rPS0(inst.FA), c_value, rPS0(inst.FB)));
rPS0(inst.FD) = rPS1(inst.FD) = std::isnan(result) ? result : -result;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -448,7 +448,7 @@ void Interpreter::fnmsubx(UGeckoInstruction inst)
{
double result = ForceDouble(NI_msub(rPS0(inst.FA), rPS0(inst.FC), rPS0(inst.FB)));
rPS0(inst.FD) = std::isnan(result) ? result : -result;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -459,7 +459,7 @@ void Interpreter::fnmsubsx(UGeckoInstruction inst)
double c_value = Force25Bit(rPS0(inst.FC));
double result = ForceSingle(NI_msub(rPS0(inst.FA), c_value, rPS0(inst.FB)));
rPS0(inst.FD) = rPS1(inst.FD) = std::isnan(result) ? result : -result;
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -468,7 +468,7 @@ void Interpreter::fnmsubsx(UGeckoInstruction inst)
void Interpreter::fsubx(UGeckoInstruction inst)
{
rPS0(inst.FD) = ForceDouble(NI_sub(rPS0(inst.FA), rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();
@@ -477,7 +477,7 @@ void Interpreter::fsubx(UGeckoInstruction inst)
void Interpreter::fsubsx(UGeckoInstruction inst)
{
rPS0(inst.FD) = rPS1(inst.FD) = ForceSingle(NI_sub(rPS0(inst.FA), rPS0(inst.FB)));
UpdateFPRF(rPS0(inst.FD));
PowerPC::UpdateFPRF(rPS0(inst.FD));

if (inst.Rc)
Helper_UpdateCR1();

0 comments on commit 894d4c9

Please sign in to comment.