Move cr update to StoreRelease - prevents extra block.
This commit is contained in:
parent
5162d69ab2
commit
b6046b1860
|
@ -712,8 +712,7 @@ XEEMITTER(stdcx, 0x7C0001AD, X)(PPCHIRBuilder& f, InstrData& i) {
|
||||||
// CR0[LT GT EQ SO] = 0b00 || n || XER[SO]
|
// CR0[LT GT EQ SO] = 0b00 || n || XER[SO]
|
||||||
Value* ea = CalculateEA_0(f, i.X.RA, i.X.RB);
|
Value* ea = CalculateEA_0(f, i.X.RA, i.X.RB);
|
||||||
Value* rt = f.ByteSwap(f.LoadGPR(i.X.RT));
|
Value* rt = f.ByteSwap(f.LoadGPR(i.X.RT));
|
||||||
Value* stored = f.StoreRelease(ea, rt);
|
f.StoreRelease(ea, rt); // also updates cr0
|
||||||
f.StoreContext(offsetof(PPCContext, cr0.cr0_eq), stored);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,8 +728,7 @@ XEEMITTER(stwcx, 0x7C00012D, X)(PPCHIRBuilder& f, InstrData& i) {
|
||||||
// CR0[LT GT EQ SO] = 0b00 || n || XER[SO]
|
// CR0[LT GT EQ SO] = 0b00 || n || XER[SO]
|
||||||
Value* ea = CalculateEA_0(f, i.X.RA, i.X.RB);
|
Value* ea = CalculateEA_0(f, i.X.RA, i.X.RB);
|
||||||
Value* rt = f.ByteSwap(f.Truncate(f.LoadGPR(i.X.RT), INT32_TYPE));
|
Value* rt = f.ByteSwap(f.Truncate(f.LoadGPR(i.X.RT), INT32_TYPE));
|
||||||
Value* stored = f.StoreRelease(ea, rt);
|
f.StoreRelease(ea, rt); // also updates cr0
|
||||||
f.StoreContext(offsetof(PPCContext, cr0.cr0_eq), stored);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -341,6 +341,7 @@ Value* PPCHIRBuilder::StoreRelease(Value* address, Value* value,
|
||||||
LoadContext(offsetof(PPCContext, reserve_address), INT64_TYPE),
|
LoadContext(offsetof(PPCContext, reserve_address), INT64_TYPE),
|
||||||
LoadZero(INT32_TYPE));
|
LoadZero(INT32_TYPE));
|
||||||
Value* eq = CompareEQ(Truncate(address, INT32_TYPE), old_address);
|
Value* eq = CompareEQ(Truncate(address, INT32_TYPE), old_address);
|
||||||
|
StoreContext(offsetof(PPCContext, cr0.cr0_eq), eq);
|
||||||
auto skip_label = NewLabel();
|
auto skip_label = NewLabel();
|
||||||
BranchFalse(eq, skip_label, BRANCH_UNLIKELY);
|
BranchFalse(eq, skip_label, BRANCH_UNLIKELY);
|
||||||
Store(address, value, store_flags);
|
Store(address, value, store_flags);
|
||||||
|
|
Loading…
Reference in New Issue