Espresso: fix stwcx. CR0[SO] update and make IML instructions trivially copyable

- stwcx. loaded the summary-overflow source from CR0[SO] instead of XER[SO], making the subsequent CR0[SO] assignment a no-op. Other compare paths already read XER[SO] correctly.

- Default the IMLReg/IMLInstruction copy constructors so IMLInstruction becomes trivially copyable, letting the IML instruction vectors relocate with memmove instead of per-element copies.
This commit is contained in:
1e1 2026-06-30 22:57:24 +02:00
parent 44c19af7db
commit 70e92b8850
2 changed files with 3 additions and 6 deletions

View File

@ -47,7 +47,7 @@ public:
//m_raw |= (uint32)regId;
}
IMLReg(const IMLReg& other) : m_raw(other.m_raw) {}
IMLReg(const IMLReg& other) = default;
IMLRegFormat GetBaseFormat() const
{
@ -351,10 +351,7 @@ struct IMLUsedRegisters
struct IMLInstruction
{
IMLInstruction() {}
IMLInstruction(const IMLInstruction& other)
{
memcpy(this, &other, sizeof(IMLInstruction));
}
IMLInstruction(const IMLInstruction& other) = default;
uint8 type;
uint8 operation;

View File

@ -1545,7 +1545,7 @@ bool PPCRecompilerImlGen_STWCX(ppcImlGenContext_t* ppcImlGenContext, uint32 opco
IMLReg regCrGT = _GetRegCR(ppcImlGenContext, 0, Espresso::CR_BIT_INDEX_GT);
IMLReg regCrEQ = _GetRegCR(ppcImlGenContext, 0, Espresso::CR_BIT_INDEX_EQ);
IMLReg regCrSO = _GetRegCR(ppcImlGenContext, 0, Espresso::CR_BIT_INDEX_SO);
IMLReg regXerSO = _GetRegCR(ppcImlGenContext, 0, Espresso::CR_BIT_INDEX_SO);
IMLReg regXerSO = PPCRecompilerImlGen_loadRegister(ppcImlGenContext, PPCREC_NAME_XER_SO);
ppcImlGenContext->emitInst().make_r_s32(PPCREC_IML_OP_ASSIGN, regCrLT, 0);
ppcImlGenContext->emitInst().make_r_s32(PPCREC_IML_OP_ASSIGN, regCrGT, 0);
ppcImlGenContext->emitInst().make_r_r(PPCREC_IML_OP_ASSIGN, regCrSO, regXerSO);