Project

General

Profile

Actions

Emulator Issues #11778

open

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

Added by weihuoya over 4 years ago. Updated about 4 years 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.


Files

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
Actions #1

Updated by JMC4789 over 4 years ago

  • Status changed from New to Accepted

Thank you for the report :)

Actions #2

Updated by degasus over 4 years 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.

Updated by weihuoya over 4 years ago

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.

Actions #4

Updated by weihuoya over 4 years 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.

Actions #5

Updated by flacs about 4 years ago

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

Actions

Also available in: Atom PDF