aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2026-02-13 16:10:09 +0100
committercrueter <crueter@eden-emu.dev>2026-02-13 16:10:09 +0100
commit07bc77c7e7aead75c5a71a1e6f63c6d03090b716 (patch)
treef6b6ff0fb5e58c365d7dd63c9b1d031526c8f2c2 /src
parent72973fe5825b0927ab854445e0aa07d58fc75941 (diff)
[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>
Diffstat (limited to 'src')
-rw-r--r--src/dynarmic/src/dynarmic/ir/opt_passes.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp b/src/dynarmic/src/dynarmic/ir/opt_passes.cpp
index 15edc05bec..ee68a0bcfc 100644
--- a/src/dynarmic/src/dynarmic/ir/opt_passes.cpp
+++ b/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);