diff --git a/src/core/cpu_core.cpp b/src/core/cpu_core.cpp index f7cd0f48a..9dbc09314 100644 --- a/src/core/cpu_core.cpp +++ b/src/core/cpu_core.cpp @@ -716,7 +716,7 @@ restart_instruction: const u32 add_value = ReadReg(inst.r.rt); const u32 new_value = old_value + add_value; if constexpr (pgxp_mode >= PGXPMode::CPU) - PGXP::CPU_ADDU(inst.bits, new_value, old_value, add_value); + PGXP::CPU_ADD(inst.bits, new_value, old_value, add_value); else if constexpr (pgxp_mode >= PGXPMode::Memory) { if (add_value == 0) @@ -752,7 +752,7 @@ restart_instruction: { const u32 new_value = ReadReg(inst.r.rs) - ReadReg(inst.r.rt); if constexpr (pgxp_mode >= PGXPMode::CPU) - PGXP::CPU_SUBU(inst.bits, new_value, ReadReg(inst.r.rs), ReadReg(inst.r.rt)); + PGXP::CPU_SUB(inst.bits, new_value, ReadReg(inst.r.rs), ReadReg(inst.r.rt)); WriteReg(inst.r.rd, new_value); } @@ -1009,7 +1009,7 @@ restart_instruction: const u32 new_value = old_value + add_value; if constexpr (pgxp_mode >= PGXPMode::CPU) - PGXP::CPU_ADDIU(inst.bits, new_value, ReadReg(inst.i.rs)); + PGXP::CPU_ADDI(inst.bits, new_value, ReadReg(inst.i.rs)); else if constexpr (pgxp_mode >= PGXPMode::Memory) { if (add_value == 0) diff --git a/src/core/pgxp.cpp b/src/core/pgxp.cpp index f78b60668..7d1e1527d 100644 --- a/src/core/pgxp.cpp +++ b/src/core/pgxp.cpp @@ -920,12 +920,6 @@ void CPU_ADDI(u32 instr, u32 rtVal, u32 rsVal) CPU_reg[rt(instr)].value = rtVal; } -void CPU_ADDIU(u32 instr, u32 rtVal, u32 rsVal) -{ - // Rt = Rs + Imm (signed) (unsafe?) - CPU_ADDI(instr, rtVal, rsVal); -} - void CPU_ANDI(u32 instr, u32 rtVal, u32 rsVal) { // Rt = Rs & Imm @@ -1112,12 +1106,6 @@ void CPU_ADD(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal) CPU_reg[rd(instr)] = ret; } -void CPU_ADDU(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal) -{ - // Rd = Rs + Rt (signed) (unsafe?) - CPU_ADD(instr, rdVal, rsVal, rtVal); -} - void CPU_SUB(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal) { // Rd = Rs - Rt (signed) @@ -1156,12 +1144,6 @@ void CPU_SUB(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal) CPU_reg[rd(instr)] = ret; } -void CPU_SUBU(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal) -{ - // Rd = Rs - Rt (signed) (unsafe?) - CPU_SUB(instr, rdVal, rsVal, rtVal); -} - void CPU_AND_(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal) { // Rd = Rs & Rt diff --git a/src/core/pgxp.h b/src/core/pgxp.h index 5bee366d6..7667fbb6e 100644 --- a/src/core/pgxp.h +++ b/src/core/pgxp.h @@ -56,7 +56,6 @@ void CPU_MOVE(u32 rd_and_rs, u32 rsVal); // Arithmetic with immediate value void CPU_ADDI(u32 instr, u32 rtVal, u32 rsVal); -void CPU_ADDIU(u32 instr, u32 rtVal, u32 rsVal); void CPU_ANDI(u32 instr, u32 rtVal, u32 rsVal); void CPU_ORI(u32 instr, u32 rtVal, u32 rsVal); void CPU_XORI(u32 instr, u32 rtVal, u32 rsVal); @@ -68,9 +67,7 @@ void CPU_LUI(u32 instr, u32 rtVal); // Register Arithmetic void CPU_ADD(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal); -void CPU_ADDU(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal); void CPU_SUB(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal); -void CPU_SUBU(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal); void CPU_AND_(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal); void CPU_OR_(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal); void CPU_XOR_(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal);