Repository navigation
[rocjitsu][amdisa][add-atomic 2/5] Add the s_atomic_dec_x2 instruction - #13104
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
30b9795 to
5b4fb9f
Compare
kuhar
left a comment
There was a problem hiding this comment.
It would be useful to make the new test tables easier to read and extend in emulation/rocjitsu/tests/scalar_atomic_test.cpp (minor suggestions):
- At line 203, use
std::to_array<ReadModifyWriteCase>so the table length follows its entries. That removes the separately maintained15and avoids silently adding a default-initialized case when entries are removed. - At lines 520 and 543, give the observer record named fields such as
mnemonic,elements_per_lane, andreturns_value. The expected rows would then explain what2andfalsemean without referring back toemplace_back.
Could we extend FailedAtomicDoesNotWriteBackOrLeakCounter and FailedCompareExchangeDoesNotWriteBackOrLeakCounter over kDecrementForms, using the width-aware memory/register helpers? They still exercise only the 32-bit instruction at emulation/rocjitsu/tests/scalar_atomic_test.cpp:395 and :451.
The new X2 path returns two dwords and holds two LGKM tokens. Keeping both widths in these fault tests would protect the full register pair and counter cleanup on load/CAS failure. The new misalignment test exits before either operation, so it does not cover these cases.
5b4fb9f to
25fe0f9
Compare
|
I believe I have made the requested changes |
kuhar
left a comment
There was a problem hiding this comment.
Could we extend DecodedDependenciesFollowReturnBit at emulation/rocjitsu/tests/scalar_atomic_test.cpp:498 over kDecrementForms? It still decodes only s_atomic_dec and expects one data SGPR and one LGKM token. For X2, please assert the two-SGPR source and GLC-gated destination ranges, plus counter_increment() == 2 for both GLC values.
The runtime tests cover the counter and high-dword return, but do not directly check the X2 InstDefUse source range. Exercising both widths here would protect the decode metadata that this PR generalizes.
814129f to
e0aeaf9
Compare
e0aeaf9 to
ed6d4d1
Compare
ed6d4d1 to
185ec0c
Compare
* X2 atomics take 2 LGKM tokens * Report scalar atomic to plugins and debugger as one element of the access width, matching vector atomics
185ec0c to
c935dec
Compare
#13104) ## Motivation A previous PR added `s_atomic_dec` but not `s_atomic_dec_x2`. This PR adds the latter and makes sure that the generalization made earlier in this stack is enough. This adds functionality so I am giving its own PR. The rest of the `s_atomic_*` instructions will be added in the next PR. ## Issue Tracking Part of Issue #13025
TheRock Submodule Bump ActivityNewest first
|
Motivation
A previous PR added
s_atomic_decbut nots_atomic_dec_x2. This PR adds the latter and makes sure that the generalization made earlier in this stack is enough. This adds functionality so I am giving its own PR. The rest of thes_atomic_*instructions will be added in the next PR.Issue Tracking
Part of Issue #13025