-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8356159: RISC-V: Add Zabha #25252
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
8356159: RISC-V: Add Zabha #25252
Conversation
|
👋 Welcome back rehn! A progress list of the required criteria for merging this PR into |
|
@robehn This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
RealFYang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice cleanup! Some minor comments after a cursory look. Thanks.
|
I witnessed performance regressions after this change on two of my OoO machines (around 7%-10% on P550 and SG2042) when doing a quick specjbb2005 test. There are no Zacas or Zabha extensions. This issue disappear if I revert changes in file |
Hmz.. that makes no sense to me :) |
|
Seems there is a difference of encoding of Is this correct? |
|
Yes, Rs2 is at 20->24 : https://riscv-software-src.github.io/riscv-unified-db/manual/html/isa/isa_20240411/insts/sc.w.html I don't understand why this is not seen in the gtests, i.e. if there some issue here. I'll investigat, thanks! |
|
I found it! lr/sc had relaxed as default memory ordering while other atomics had aqrl, I accidentaly upgraded to aqrl. Which explains why it's working, but slower! Thanks! EDIT: amocas have now default aqrl which seems wrong to have different ordering on cas than lr/sc default. |
I think I know what's going on here. |
Seems you can default to |
That is why they are already swapped in signature: Otherwise gtests wouldn't work. |
Ah, I see. Maybe it's better to change the caller's param passing to reflect this? |
Yes I can change in caller instead. I didn't either find any uses of default memory I'll remove default as no-one uses it. I'm going to diff assembly see if I find something for the performance issue. |
|
I think I got all. I also took the oppertunity to change the default on lr/sc as we don't use the default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The performance issue is gone after the update. Several minor comments remain. Thanks.
RealFYang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more minor comments. Looks good otherwise.
|
Thanks for keeping review! Let me know! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Latest version looks good to me. Thanks for the update.
RealFYang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still good. Thanks!
Thank you for your review and patience! |
feilongjiang
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
|
/integrate |
|
Thanks @feilongjiang @RealFYang |
|
Going to push as commit dc96160.
Your commit was automatically rebased without conflicts. |
Hi, please consider.
This adds the byte and halfword atomic memory operations (Zabha) - https://github.com/riscv/riscv-zabha.
All amo-instructions, except load-reserve and store-conditional, can also be performed on natural aligned half-words and bytes. (i.e. the extension do not add lr.h/b or sc.h/b) This includes amocas if zacas extension is present.
The majority of this patch is to support amocas.h/b. We are now starting to really feel the pain of all these extensions, as CAS:ing 16/8-bits can now be done in three different ways:
There is no hwprobe support yet.
Ran t1-3 with Zacas+Zabha and t1 without Zabha in qemu.
Thanks, Robbin
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25252/head:pull/25252$ git checkout pull/25252Update a local copy of the PR:
$ git checkout pull/25252$ git pull https://git.openjdk.org/jdk.git pull/25252/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25252View PR using the GUI difftool:
$ git pr show -t 25252Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25252.diff
Using Webrev
Link to Webrev Comment