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

Midnight Club 3 - JIT cache getting cleared repeatedly #17290

Closed
hrydgard opened this issue Apr 15, 2023 · 6 comments · Fixed by #17291
Closed

Midnight Club 3 - JIT cache getting cleared repeatedly #17290

hrydgard opened this issue Apr 15, 2023 · 6 comments · Fixed by #17291
Labels
Savestate Save state related issues.
Milestone

Comments

@hrydgard
Copy link
Owner

hrydgard commented Apr 15, 2023

About every four seconds When a rewind snapshot is taken and rounding modes are used, the jit cache gets cleared. Looking at the log, it looks really silly:

04-15 23:37:57.059 15248 15492 W PPSSPP  : [JIT] Detected rounding mode usage, rebuilding jit with checks
04-15 23:37:57.059 15248 15492 I PPSSPP  : [JIT] ARM64Jit: Clearing the cache!
04-15 23:38:01.081 15248 15492 W PPSSPP  : [JIT] Detected rounding mode usage, rebuilding jit with checks
04-15 23:38:01.081 15248 15492 I PPSSPP  : [JIT] ARM64Jit: Clearing the cache!
04-15 23:38:05.374 15248 15492 W PPSSPP  : [JIT] Detected rounding mode usage, rebuilding jit with checks
04-15 23:38:05.374 15248 15492 I PPSSPP  : [JIT] ARM64Jit: Clearing the cache!
04-15 23:38:09.111 15248 15492 W PPSSPP  : [JIT] Detected rounding mode usage, rebuilding jit with checks
04-15 23:38:09.111 15248 15492 I PPSSPP  : [JIT] ARM64Jit: Clearing the cache!
04-15 23:38:13.133 15248 15492 W PPSSPP  : [JIT] Detected rounding mode usage, rebuilding jit with checks
04-15 23:38:13.133 15248 15492 I PPSSPP  : [JIT] ARM64Jit: Clearing the cache!
  • We should probably remember the rounding mode state across jit clears within a game, right?
@hrydgard hrydgard added this to the v1.15.0 milestone Apr 15, 2023
@hrydgard hrydgard added the arm64jit Occurs with JIT on 64-bit ARM devices, but not another CPU backend. label Apr 15, 2023
@hrydgard
Copy link
Owner Author

Actually this is caused by rewind snapshots, we must be doing something bad.

@hrydgard hrydgard added Savestate Save state related issues. and removed arm64jit Occurs with JIT on 64-bit ARM devices, but not another CPU backend. CPU emulation labels Apr 15, 2023
@unknownbrackets
Copy link
Collaborator

This doesn't look right:

	Do(p, js.startDefaultPrefix);
	if (s >= 2) {
		Do(p, js.hasSetRounding);
		js.lastSetRounding = 0;
	} else {
		js.hasSetRounding = 1;
	}

-[Unknown]

@hrydgard
Copy link
Owner Author

Ah, we had already fixed that on x86 it seems, assuming this is right:

	Do(p, js.startDefaultPrefix);
	if (s >= 2) {
		Do(p, js.hasSetRounding);
		if (p.mode == PointerWrap::MODE_READ) {
			js.lastSetRounding = 0;
		}
	} else {
		js.hasSetRounding = 1;
	}

@unknownbrackets
Copy link
Collaborator

I guess that was only fixed in 718cb9e.

-[Unknown]

@hrydgard
Copy link
Owner Author

Yup, oversight by me.

@hrydgard
Copy link
Owner Author

Maybe should create a jitcommon base class, instead of just having those pure interfaces - this function can be the same in all of them. But I don't think I wanna do that right now, so I'll just submit a PR that fixes them all individually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Savestate Save state related issues.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants