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

Add PAUSE hint #398

Merged
merged 11 commits into from
Feb 11, 2021
Merged

Add PAUSE hint #398

merged 11 commits into from
Feb 11, 2021

Conversation

aswaterman
Copy link
Member

Closes #43

Copy link
Member

@palmer-dabbelt palmer-dabbelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now we use div X, X, x0 as the stand-in for pause in Linux, and that's probably propagated elsewhere. I think this is a better bet: it doesn't require M and it's actually a NOP. I don't think it's even worth commenting in the ISA manual, though, as it'll just cause confusion.

I think we've had this argument before, but I'd prefer to indicate this as a fence with both an I/O bit set and an R/W bit set. This allows us to later disambiguate I/O pauses from memory pauses. I think I have a coherent argument here, LMK if you want to talk about it -- I'm not sure it's worth the time :)

@aswaterman
Copy link
Member Author

I’m probably just rehashing the discussion we already had, but: I don’t think there’s much benefit from distinguishing the two, as the processor can just unstall when either event (IO or memory) occurs, and there’s likely no loss in efficiency in practice. In fact, given the likelihood of misuse, it might perform better this way around ;)

I would view the predecessor field as just another opcode field when the successor field is zero. It doesn’t really matter if the bits line up with their usual purpose, as they are feeding into different control logic (or so I claim without proof).

I’m not outright opposed to the change, but I need a stronger argument to change my mind.

@palmer-dabbelt
Copy link
Member

palmer-dabbelt commented Jun 25, 2019 via email

@aswaterman
Copy link
Member Author

aswaterman commented Jun 25, 2019 via email

aswaterman added a commit to riscv-non-isa/riscv-asm-manual that referenced this pull request Oct 9, 2020
Merge whenever riscv/riscv-isa-manual#398 is merged.
@aswaterman
Copy link
Member Author

@gfavor this is rebased and ready for merging whenever we deem appropriate.

@nick-knight
Copy link
Contributor

Minor suggestion: perhaps the enhancements to the HINT discussion could be separated from the addition of the PAUSE discussion. (I suggest this only because there has been some contention about PAUSE on the mailing lists.)

@David-Horner
Copy link
Contributor

David-Horner commented Dec 16, 2020 via email

@aswaterman
Copy link
Member Author

aswaterman commented Dec 16, 2020

@knightsifive If the PAUSE discussion drags on, I'll separate these changes into two PRs. I kept them together because redoing these LaTeX tables is time-consuming, and the changes are coupled.

@aswaterman aswaterman deleted the pause branch February 11, 2021 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Guidance requested: instruction for spin-wait loops
5 participants