GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — R5900: Use correct store width for cop0 count by Ziemas · Pull Request #15187 · PCSX2/pcsx2

Conversation

@Ziemas

@Ziemas Ziemas commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Description of Changes

ptr automatically infers store size from the operand, which had been changed from eax to rax causing a 64bit store to a 32bit field. Change it to the correct store width by using ptr32.

Rationale behind Changes

Fixes #15186 which was caused by #14105

Suggested Testing Steps

Straightforward fix, should just be fine. Maybe just smoke test.

Did you use AI to help find, test, or implement this issue or feature?

Not personally.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@TellowKrinkle

TellowKrinkle commented Nov 12, 2026

Copy link
Copy Markdown
Member

Why are you using rax at all? What you have here is rejected by an actual x86 assembler, and is only working here because our assembler is kind of terrible and doesn't validate that all the operands match.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refractionpcsx2

refractionpcsx2 commented Nov 12, 2026

Copy link
Copy Markdown
Member

is lastCOP0Cycle or cpu.cycle 64bit now? I think they are, which might explain why it's using rax, but that will need truncating down to 32bits for the cop count. I would assume that xADD(ptr[&cpuRegs.CP0.n.Count], eax) should be fine.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Ziemas

Ziemas commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Why are you using rax at all? What you have here is rejected by an actual x86 assembler, and is only working here because our assembler is kind of terrible and doesn't validate that all the operands match.

I see, I wasn't actually aware that it wasn't allowed. I just assumed that the pointer type was what mattered.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Ziemas
R5900: Use correct store width for cop0 count
cba4ba9
@Ziemas
Ziemas force-pushed the cop-count-fix branch from bc0489c to cba4ba9 Compare November 12, 2026 03:01
@Ziemas

Ziemas commented Nov 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Ok, made the register operand match.

is lastCOP0Cycle or cpu.cycle 64bit now? I think they are, which might explain why it's using rax, but that will need truncating down to 32bits for the cop count. I would assume that xADD(ptr[&cpuRegs.CP0.n.Count], eax) should be fine.

Yup, those are 64bit now.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

TellowKrinkle
TellowKrinkle approved these changes Nov 12, 2026
View reviewed changes
@F0bes
F0bes merged commit 82cac38 into PCSX2:master Nov 12, 2026
17 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Ziemas Ziemas mentioned this pull request Nov 12, 2026
Fix more 64bit cycle mistakes #15188
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@TellowKrinkle TellowKrinkle TellowKrinkle approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] EE recompiler increments CP0 EntryHi when Count overflows

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Ziemas @TellowKrinkle @refractionpcsx2 @F0bes
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.