Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vfpu branch in delay slot #1926

Closed
unknownbrackets opened this issue May 26, 2013 · 3 comments · Fixed by #3175
Closed

vfpu branch in delay slot #1926

unknownbrackets opened this issue May 26, 2013 · 3 comments · Fixed by #3175

Comments

@unknownbrackets
Copy link
Collaborator

I found a game (Disgaea 2) that does some vfpu stuff and then:

vcmp.q GT, C310, C300
bvt addr1(CC[0])
bvt addr1(CC[1])
bvt addr1(CC[2])
bvt addr1(CC[3])

---

We should probably test this. I did a quick search and there's a comment in JPCSP's code that says they insert a nop in between. But I wonder what order it actually executes in, if they are different addresses... or if they have to be the same or something.

-[Unknown]

@hrydgard
Copy link
Owner

Wow that's some scary code, I wonder what possessed them to write that...

I would also guess that inserting nops (ignoring the delay slots) is likely the way to go here, but yes, should definitely test.

@unknownbrackets
Copy link
Collaborator Author

So far only that game:
http://report.ppsspp.org/temp/recent/kind/161

But also:
http://report.ppsspp.org/temp/recent/kind/163

Here's another scary one (but maybe just a test since it doesn't have a game id):
http://report.ppsspp.org/temp/recent/kind/158

-[Unknown]

@unknownbrackets
Copy link
Collaborator Author

Armjit crashes when this happens (infinite loop.) Affects at least Zettai Hero Project and Disgaea 2 (#1679.)

-[Unknown]

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Jun 3, 2013
Otherwise we loop infinitely.

Workaround for hrydgard#1926.  Should fix hrydgard#1679.
unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Aug 15, 2013
Based on tests on a PSP, all branches are attempted.  The behavior is
technically undefined.

It seems to take the delay slot's target if they differ and both pass.
This is the behavior the interpreter has, but it's more work in jit.

Since only a couple games seem to do this, and clearly expect this
behavior, this fixes all known cases of hrydgard#1926.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants