Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10702 from Pokechu22/dsp-cmpaxh
DSP LLE: Rename CMPAR to CMPAXH
  • Loading branch information
lioncash committed May 28, 2022
2 parents 8728212 + ce4aba7 commit 2d6fe6a
Show file tree
Hide file tree
Showing 9 changed files with 349 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/DSP/DSPTables.cpp
Expand Up @@ -284,7 +284,7 @@ const std::array<DSPOPCTemplate, 230> s_opcodes =

//c-d
{"MULC", 0xc000, 0xe700, 1, 2, {{P_ACCM, 1, 0, 12, 0x1000}, {P_REG1A, 1, 0, 11, 0x0800}}, true, false, false, false, true}, // $prod = $acS.m * $axS.h
{"CMPAR", 0xc100, 0xe700, 1, 2, {{P_ACC, 1, 0, 11, 0x0800}, {P_REG1A, 1, 0, 12, 0x1000}}, true, false, false, false, true}, // FLAGS($acS - axR.h)
{"CMPAXH", 0xc100, 0xe700, 1, 2, {{P_ACC, 1, 0, 11, 0x0800}, {P_REG1A, 1, 0, 12, 0x1000}}, true, false, false, false, true}, // FLAGS($acS - axR.h)
{"MULCMVZ", 0xc200, 0xe600, 1, 3, {{P_ACCM, 1, 0, 12, 0x1000}, {P_REG1A, 1, 0, 11, 0x0800}, {P_ACC, 1, 0, 8, 0x0100}}, true, false, false, false, true}, // $acR.hm, $acR.l, $prod = $prod.hm, 0, $acS.m * $axS.h
{"MULCAC", 0xc400, 0xe600, 1, 3, {{P_ACCM, 1, 0, 12, 0x1000}, {P_REG1A, 1, 0, 11, 0x0800}, {P_ACC, 1, 0, 8, 0x0100}}, true, false, false, false, true}, // $acR, $prod = $acR + $prod, $acS.m * $axS.h
{"MULCMV", 0xc600, 0xe600, 1, 3, {{P_ACCM, 1, 0, 12, 0x1000}, {P_REG1A, 1, 0, 11, 0x0800}, {P_ACC, 1, 0, 8, 0x0100}}, true, false, false, false, true}, // $acR, $prod = $prod, $acS.m * $axS.h
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/DSP/Interpreter/DSPIntArithmetic.cpp
Expand Up @@ -124,12 +124,12 @@ void Interpreter::cmp(const UDSPInstruction)
ZeroWriteBackLog();
}

// CMPAR $acS axR.h
// CMPAXH $acS, $axR.h
// 110r s001 xxxx xxxx
// Compares accumulator $acS with accumulator $axR.h.
// Compares accumulator $acS with high part of secondary accumulator $axR.h.
//
// flags out: x-xx xxxx
void Interpreter::cmpar(const UDSPInstruction opc)
void Interpreter::cmpaxh(const UDSPInstruction opc)
{
const u8 rreg = (opc >> 12) & 0x1;
const u8 sreg = (opc >> 11) & 0x1;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/DSP/Interpreter/DSPIntTables.cpp
Expand Up @@ -178,7 +178,7 @@ constexpr std::array<InterpreterOpInfo, 125> s_opcodes

// C-D
{0xc000, 0xe700, &Interpreter::mulc},
{0xc100, 0xe700, &Interpreter::cmpar},
{0xc100, 0xe700, &Interpreter::cmpaxh},
{0xc200, 0xe600, &Interpreter::mulcmvz},
{0xc400, 0xe600, &Interpreter::mulcac},
{0xc600, 0xe600, &Interpreter::mulcmv},
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/DSP/Interpreter/DSPInterpreter.h
Expand Up @@ -70,7 +70,7 @@ class Interpreter
void clrl(UDSPInstruction opc);
void clrp(UDSPInstruction opc);
void cmp(UDSPInstruction opc);
void cmpar(UDSPInstruction opc);
void cmpaxh(UDSPInstruction opc);
void cmpi(UDSPInstruction opc);
void cmpis(UDSPInstruction opc);
void dar(UDSPInstruction opc);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/DSP/Jit/x64/DSPEmitter.h
Expand Up @@ -115,7 +115,7 @@ class DSPEmitter final : public JIT::DSPEmitter, public Gen::X64CodeBlock
void tst(UDSPInstruction opc);
void tstaxh(UDSPInstruction opc);
void cmp(UDSPInstruction opc);
void cmpar(UDSPInstruction opc);
void cmpaxh(UDSPInstruction opc);
void cmpi(UDSPInstruction opc);
void cmpis(UDSPInstruction opc);
void xorr(UDSPInstruction opc);
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/Core/DSP/Jit/x64/DSPJitArithmetic.cpp
Expand Up @@ -188,12 +188,12 @@ void DSPEmitter::cmp(const UDSPInstruction opc)
}
}

// CMPAR $acS axR.h
// CMPAXH $acS, $axR.h
// 110r s001 xxxx xxxx
// Compares accumulator $acS with accumulator $axR.h.
// Compares accumulator $acS with high part of secondary accumulator $axR.h.
//
// flags out: x-xx xxxx
void DSPEmitter::cmpar(const UDSPInstruction opc)
void DSPEmitter::cmpaxh(const UDSPInstruction opc)
{
if (FlagsNeeded())
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/DSP/Jit/x64/DSPJitTables.cpp
Expand Up @@ -178,7 +178,7 @@ const std::array<JITOpInfo, 125> s_opcodes =

// C-D
{0xc000, 0xe700, &DSPEmitter::mulc},
{0xc100, 0xe700, &DSPEmitter::cmpar},
{0xc100, 0xe700, &DSPEmitter::cmpaxh},
{0xc200, 0xe600, &DSPEmitter::mulcmvz},
{0xc400, 0xe600, &DSPEmitter::mulcac},
{0xc600, 0xe600, &DSPEmitter::mulcmv},
Expand Down

0 comments on commit 2d6fe6a

Please sign in to comment.