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

PPCAnalyst: Don't treat blr as writing to CR #10284

Merged
merged 1 commit into from Jan 1, 2022

Conversation

JosJuice
Copy link
Member

This piece of code is rather hard to understand, but my best guess at what it's trying to do is that it tries to create opportunities to skip writing CRs back to ppcState if we know that there are no CR instructions (or branch instructions, etc) between an instruction that writes to a CR register and the next blr. This is technically inaccurate emulation, but as long as games don't do anything too weird with their ABIs, I suppose it doesn't break anything.

So why do I want to get rid of it? Well, other than breaking some hypothetical weird game, I imagine it could trip up people trying to debug a game who are looking at the CR contents. And the code is just plain confusing. (blr clearly doesn't write to CRs!)

This piece of code is rather hard to understand, but my best guess
at what it's trying to do is that it tries to create opportunities
to skip writing CRs back to ppcState if we know that there are no
CR instructions (or branch instructions, etc) between an instruction
that writes to a CR register and the next blr. This is technically
inaccurate emulation, but as long as games don't do anything too
weird with their ABIs, I suppose it doesn't break anything.

So why do I want to get rid of it? Well, other than breaking some
hypothetical weird game, I imagine it could trip up people trying
to debug a game who are looking at the CR contents. And the code
is just plain confusing. (blr clearly doesn't write to CRs!)
@leoetlino leoetlino merged commit dc7ea16 into dolphin-emu:master Jan 1, 2022
10 checks passed
@JosJuice JosJuice deleted the no-blr-cr branch January 1, 2022 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants