mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
PGXP: Combine instr and rtVal parameters for CPU_LUI
This commit is contained in:
parent
bc021ddfd9
commit
1b881fc60b
|
@ -939,7 +939,7 @@ restart_instruction:
|
|||
WriteReg(inst.i.rt, value);
|
||||
|
||||
if constexpr (pgxp_mode >= PGXPMode::CPU)
|
||||
PGXP::CPU_LUI(inst.bits, value);
|
||||
PGXP::CPU_LUI(inst.bits);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -2274,16 +2274,11 @@ bool CodeGenerator::Compile_lui(const CodeBlockInstruction& cbi)
|
|||
{
|
||||
InstructionPrologue(cbi, 1);
|
||||
|
||||
if (g_settings.UsingPGXPCPUMode())
|
||||
EmitFunctionCall(nullptr, &PGXP::CPU_LUI, Value::FromConstantU32(cbi.instruction.bits));
|
||||
|
||||
// rt <- (imm << 16)
|
||||
const u32 value = cbi.instruction.i.imm_zext32() << 16;
|
||||
|
||||
if (g_settings.UsingPGXPCPUMode())
|
||||
{
|
||||
// TODO: rtVal can be skipped here, and probably worthwhile given this is a common instruction.
|
||||
EmitFunctionCall(nullptr, &PGXP::CPU_LUI, Value::FromConstantU32(cbi.instruction.bits),
|
||||
Value::FromConstantU32(value));
|
||||
}
|
||||
|
||||
m_register_cache.WriteGuestRegister(cbi.instruction.i.rt, Value::FromConstantU32(value));
|
||||
SpeculativeWriteReg(cbi.instruction.i.rt, value);
|
||||
|
||||
|
|
|
@ -1045,13 +1045,13 @@ void CPU_SLTIU(u32 instr, u32 rtVal, u32 rsVal)
|
|||
////////////////////////////////////
|
||||
// Load Upper
|
||||
////////////////////////////////////
|
||||
void CPU_LUI(u32 instr, u32 rtVal)
|
||||
void CPU_LUI(u32 instr)
|
||||
{
|
||||
// Rt = Imm << 16
|
||||
CPU_reg[rt(instr)] = PGXP_value_zero;
|
||||
CPU_reg[rt(instr)].y = (float)(s16)imm(instr);
|
||||
CPU_reg[rt(instr)].hFlags = VALID_HALF;
|
||||
CPU_reg[rt(instr)].value = rtVal;
|
||||
CPU_reg[rt(instr)].value = static_cast<u32>(imm(instr)) << 16;
|
||||
CPU_reg[rt(instr)].flags = VALID_01;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ void CPU_SLTI(u32 instr, u32 rtVal, u32 rsVal);
|
|||
void CPU_SLTIU(u32 instr, u32 rtVal, u32 rsVal);
|
||||
|
||||
// Load Upper
|
||||
void CPU_LUI(u32 instr, u32 rtVal);
|
||||
void CPU_LUI(u32 instr);
|
||||
|
||||
// Register Arithmetic
|
||||
void CPU_ADD(u32 instr, u32 rdVal, u32 rsVal, u32 rtVal);
|
||||
|
|
Loading…
Reference in a new issue