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

Store IR instructions in a bump-allocated vector instead of loose allocations #19240

Merged
merged 7 commits into from
Jun 7, 2024

Conversation

hrydgard
Copy link
Owner

@hrydgard hrydgard commented Jun 4, 2024

This allows us to store the offset directly inside the pseudo instructions, instead of block numbers which require an extra lookup in the dispatcher, which is expensive enough to matter.

On PC, this is a 5-10% performance improvement in the IRInterpreter, which is very decent. Not benchmarked on Apple yet.

The IR JITs are still working.

TODO before merge:

  • We need to stop and reset once the offsets go beyond 24 bits. However, that is a lot of instructions so in practice this will be fine in 99% of games - still want to fix it though.
  • This crashed on iOS when switching games from GTA to Outrun. (have not seen this again)
  • Savestates don't seem to be working :(

@hrydgard hrydgard added the IRInterpreter Occurs with IR Interpreter but not with another CPU backend. label Jun 4, 2024
@hrydgard hrydgard added this to the v1.18.0 milestone Jun 4, 2024
@hrydgard hrydgard marked this pull request as ready for review June 7, 2024 08:16
@hrydgard
Copy link
Owner Author

hrydgard commented Jun 7, 2024

Fixed a bug, it seems pretty solid now. Let's get it in.

@hrydgard hrydgard merged commit 55fecce into master Jun 7, 2024
18 checks passed
@hrydgard hrydgard deleted the ir-arena branch June 7, 2024 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IRInterpreter Occurs with IR Interpreter but not with another CPU backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant