Mitigate performance impact of respecting FP bit#136
Merged
Conversation
maximumspatium
left a comment
Collaborator
There was a problem hiding this comment.
Initial MSR state is CPU dependent. We need to account for that.
41d2344 to
30258b6
Compare
In dingusdev#135 we switched from a static OpcodeGrabber table to a curOpcodeGrabber pointer in ppc_main_opcode. This results in an extra indirection (as far as generated assembly having an additional load), which reduces execution speed. Switch to making the opcode grabber into a parameter to ppc_main_opcode, and make ppc_exec_inner keep it up to date (via an EXEF_OPCODE exception flag). Also fixes FPU instructions in ppctests - we now need to set the FP MSR bit when initializing the CPU.
30258b6 to
134339a
Compare
Contributor
Author
|
@maximumspatium OK, redid this to not make any assumptions about the initial state of the MSR field. Also fixed ppctests. |
mihaip
added a commit
to mihaip/pearpc
that referenced
this pull request
Jan 27, 2025
To make them throw NO_FPU exceptions when the MSR FP bit is not set, we switch between two different opcode tables (using the same approach as dingusdev/dingusppc#135 and dingusdev/dingusppc#136) Should be a no-op to a slight regression in the benchmark (since it has no FPU instructions and there's the slight overhead of checking for MSR changes), but instead it goes from ~442.5 to 460 MiB/s. ¯\_(ツ)_/¯
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In #135 we switched from a static
OpcodeGrabbertable to acurOpcodeGrabberpointer inppc_main_opcode. This results in an extra indirection (as far as generated assembly having an additional load), which reduces execution speed.Switch to making the opcode grabber into a parameter to
ppc_main_opcode, and makeppc_exec_innerkeep it up to date (via anEXEF_OPCODEexception flag).Also fixes FPU instructions in
ppctests- we now need to set the FP MSR bit when initializing the CPU.