Skip to content

[rocjitsu][amdisa][add-atomic 1/5] Generalize codegen for s_atomic_* instructions - #13102

Merged
kuhar merged 1 commit into
developfrom
users/accauble/rj-generalize-s-atomic
Oct 21, 2026
Merged

kuhar merged 1 commit into
developfrom
users/accauble/rj-generalize-s-atomic

Conversation

@accauble

@accauble accauble commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

NOTE: Based on PR #12963 which has not merged yet. This will remain in draft until that gets merged because I couldn't not submit a PR to that branch.

PR #12963 added an s_atomic_dec implementation. The plan is to add the rest of the s_atomic_* instructions, so this PR generalizes that approach so all can be added. The intent of this PR is to generalize, not add additional behavior. That will be the next PRs in the stack.

Issue Tracking

Part of Issue #13025

@therock-pr-bot

therock-pr-bot Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@accauble
accauble added this pull request to stack #13105 October 8, 2026 13:42
@accauble accauble changed the title [rocjitsu][amdisa][add-atomic 1/4] Generalize codegen for s_atomic_* instructions [rocjitsu][amdisa][add-atomic 1/5] Generalize codegen for s_atomic_* instructions Oct 8, 2026

@atgutier atgutier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues from me, but an agent spotted a minor issue. So approving with a comment to address this:

[MINOR] GLC=0 s_atomic_dec triggers a false memory wait diagnostic. In the exact-head Release CI
run, all 12 cases of ReturnedRegisterRequiresLgkmWait failed the diagnostic-count assertion. The
functional value check passed: the non-returning atomic preserved s4, but reading s4 still produced
a wait warning. The precise point where the stale dependency entered the scoreboard was unresolved,
so confidence was medium in the defect and low in its internal cause.

The suggested fix was to suppress the result-register dependency when GLC=0 while retaining the
atomic’s LGKMCNT obligation. I found no other actionable issue. PR 12963 subsequently added GLC
dependent destination metadata and a regression test for this case; its reported rocjitsu CI checks
passed.

@kuhar
kuhar marked this pull request as ready for review October 14, 2026 18:56
@kuhar
kuhar requested a review from a team as a code owner October 14, 2026 18:57
Copilot AI balanced review requested due to automatic review settings October 14, 2026 18:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kuhar kuhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One thing I noticed

@accauble
accauble force-pushed the users/accauble/rj-generalize-s-atomic branch from dc7b4b3 to 4800bb4 Compare October 15, 2026 20:12
@accauble

Copy link
Copy Markdown
Contributor Author

Rebased and added a commit to address minor unresolved findings from PR #12963

@accauble
accauble requested a review from kuhar October 15, 2026 20:13

@kuhar kuhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Left an inline reply and a new comment

@accauble
accauble requested a review from kuhar October 19, 2026 20:47

@kuhar kuhar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@accauble
accauble force-pushed the users/accauble/rj-generalize-s-atomic branch 2 times, most recently from a44dd2f to 4fd3543 Compare October 20, 2026 20:04
* Get op from _ATOMIC_OP_ENUM
* Calculate width instead of assuming
* Add python tests

[rocjitsu][amdisa] Address #12963 review follow-ups

PR #12963 had some minor tweaks requested:

* Create a return-check helper for inst_.glc != 0
* Fold the scalar atomic mutation lambda into the L2 `atomic_rmw`
  callback
* Use constants and builders `scalar_atomic_test.cpp`

[rocjitsu][DBI] Set `elem_size` size and move test
@accauble
accauble force-pushed the users/accauble/rj-generalize-s-atomic branch from 4fd3543 to 4a48cd1 Compare October 20, 2026 20:39
@kuhar
kuhar merged commit 02d6cbc into develop Oct 21, 2026
74 checks passed
@kuhar
kuhar deleted the users/accauble/rj-generalize-s-atomic branch October 21, 2026 01:14
dgaliffiAMD pushed a commit that referenced this pull request Oct 21, 2026
…instructions (#13102)

## Motivation

NOTE: Based on PR #12963 which has not merged yet. This will remain in
draft until that gets merged because I couldn't not submit a PR to that
branch.

PR #12963 added an `s_atomic_dec` implementation. The plan is to add the
rest of the `s_atomic_*` instructions, so this PR generalizes that
approach so all can be added. The intent of this PR is to generalize,
not add additional behavior. That will be the next PRs in the stack.

## Issue Tracking

Part of Issue #13025
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants