Browse Source

[dynarmic] Fix Sonic X shadow regression due to aggresive const prop discarding NZCV side ffects (#3534)

Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3534
Reviewed-by: DraVee <dravee@eden-emu.dev>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
lizzie/fix-rw-garten
lizzie 6 days ago
committed by crueter
parent
commit
07bc77c7e7
No known key found for this signature in database GPG Key ID: 425ACD2D4830EBC6
  1. 5
      src/dynarmic/src/dynarmic/ir/opt_passes.cpp

5
src/dynarmic/src/dynarmic/ir/opt_passes.cpp

@ -1042,6 +1042,11 @@ static void FoldZeroExtendXToLong(IR::Inst& inst) {
static void ConstantPropagation(IR::Block& block) {
for (auto& inst : block.instructions) {
auto const opcode = inst.GetOpcode();
// skip NZCV so we dont end up discarding side effects :)
// TODO(lizzie): hey stupid maybe fix the A64 codegen for folded constants AND
// redirect the mfer properly?!??! just saying :)
if (IR::MayGetNZCVFromOp(opcode) && inst.GetAssociatedPseudoOperation(IR::Opcode::GetNZCVFromOp))
continue;
switch (opcode) {
case Op::LeastSignificantWord:
FoldLeastSignificantWord(inst);

Loading…
Cancel
Save