Project

General

Profile

Emulator Issues #11778

ARM64 JIT Bug: SD Gundam - Scad Hammers hangs after Level 1 dialogue

Added by weihuoya 7 months ago. Updated 10 days ago.

Status:
Accepted
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

RSDJAF - SD Gundam: Scad Hammers hangs after Level 1 dialogue, and random hangs in other level after dialogue.

void JitArm64::fcmpX(UGeckoInstruction inst) function doesn't work correctly.(fcmpo, Floating Compare Ordered)

I replace JitArm64::fcmpX with JitArm64::FallBackToInterpreter and it work fine.

flush in the beginning.jpg (183 KB) flush in the beginning.jpg weihuoya, 06/26/2019 08:39 AM
fallback to interpreter.jpg (506 KB) fallback to interpreter.jpg weihuoya, 06/26/2019 08:39 AM
game hangs.jpg (633 KB) game hangs.jpg weihuoya, 06/26/2019 08:39 AM
7487
7488
7489

History

#1 Updated by JMC4789 7 months ago

  • Status changed from New to Accepted

Thank you for the report :)

#2 Updated by degasus 7 months ago

weihuoya, may you do me a favor and debug a bit more within this instruction?

First, let's check if there is an dependency on the former or the later intstructions. So please insert in https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp#L255 this code once in the beginning and in a second test in the end:
gpr.Flush(FlushMode::FLUSH_ALL);
fpr.Flush(FlushMode::FLUSH_ALL);

If flushing the register cache in the begin of the instruction fixes the issue, the bug is likely within some special cases within this instruction.
If flushing in the end of the instruction fixes it, the bug is within another instruction and the bisecting to fcmp is wrong.
If the bug still happens with both flushing, the bug must be within this instruction. So this should be easy to fix.

Afterwards, especially in the first and last case, I'd like to check which of the cases within the instruction are affected. So may you please add in line 267 this code:

FALLBACK_IF(a != b);

or

FALLBACK_IF(singles);

even better would be the full combination of

FALLBACK_IF(a != b && singles);

This should highlight where to search for the issue.

Thanks a lot.

#3 Updated by weihuoya 7 months ago

7487
7488
7489

flush in the beginning: black screen.

flush in the end: nothing changes.

with FALLBACK_IF(singles && a != b && inst.SUBOP10 == 32); in the beginning, fix issue.

#4 Updated by weihuoya 7 months ago

FALLBACK_IF(singles && a != b && inst.SUBOP10 == 32); wiil cause metroid prime black screen. https://www.youtube.com/watch?v=8V_0z_5y7WA&feature=youtu.be

change to

FALLBACK_IF(a != b && inst.SUBOP10 == 32); fix metroid prime.

#5 Updated by flacs 10 days ago

Not sure this is the same bug but fcmpX() does not seem to distinguish between fcmpo and fcmpu.

Also available in: Atom PDF