Skip to content

Redesign atomic store with hints intrinsics#432

Merged
Lukacma merged 4 commits into
ARM-software:mainfrom
Lukacma:main
May 7, 2026
Merged

Redesign atomic store with hints intrinsics#432
Lukacma merged 4 commits into
ARM-software:mainfrom
Lukacma:main

Conversation

@Lukacma
Copy link
Copy Markdown
Contributor

@Lukacma Lukacma commented Apr 16, 2026

This proposal is about redesigning atomic store with hint intrinsics, to make them more easily extensible.

Checklist: (mark with X those which apply)

  • If an issue reporting the bug exists, I have mentioned it in the
    PR (do not bother creating the issue if all you want to do is
    fixing the bug yourself).
  • [x ] I have added/updated the SPDX-FileCopyrightText lines on top
    of any file I have edited. Format is SPDX-FileCopyrightText: Copyright {year} {entity or name} <{contact informations}>
    (Please update existing copyright lines if applicable. You can
    specify year ranges with hyphen , as in 2017-2019, and use
    commas to separate gaps, as in 2018-2020, 2022).
  • [ x] I have updated the Copyright section of the sources of the
    specification I have edited (this will show up in the text
    rendered in the PDF and other output format supported). The
    format is the same described in the previous item.
  • I have run the CI scripts (if applicable, as they might be
    tricky to set up on non-*nix machines). The sequence can be
    found in the contribution
    guidelines
    . Don't
    worry if you cannot run these scripts on your machine, your
    patch will be automatically checked in the Actions of the pull
    request.
  • [x ] I have added an item that describes the changes I have
    introduced in this PR in the section Changes for next
    release
    of the section Change Control/Document history
    of the document. Create Changes for next release if it does
    not exist. Notice that changes that are not modifying the
    content and rendering of the specifications (both HTML and PDF)
    do not need to be listed.
  • [ x] When modifying content and/or its rendering, I have checked the
    correctness of the result in the PDF output (please refer to the
    instructions on how to build the PDFs
    locally
    ).
  • [ x] The variable draftversion is set to true in the YAML header
    of the sources of the specifications I have modified.
  • Please DO NOT add my GitHub profile to the list of contributors
    in the README page of the project.

@Lukacma Lukacma changed the title Redesign Redesign atomic store with hints intrinsics Redesign atomic store with hints intrinsics Apr 16, 2026
@CarolineConcatto CarolineConcatto self-requested a review April 16, 2026 15:36
Comment thread main/acle.md
| -------------------- | --------- | --------------------------------------------------------------------------------- |
| KEEP | 0 | Signals to retain the updated location in the local cache of the updating PE. |
| STRM | 1 | Signals to not retain the updated location in the local cache of the updating PE. |
The fourth argument `hint` selects the requested hint. The set of valid
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.

What will be the behaviour if hint is not valid?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I guess that is undefined behaviour and will be implementation based. For LLVM we will throw error and reject.

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.

Should it throw an error or just ignore and still do the atomic store?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I would throw error. This seems like a user mistake and we shouldn't just let it silently pass imo.

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.

I agree with throwing an error, the generic versions of these should be used when not using a hint

Copy link
Copy Markdown

@paulwalker-arm paulwalker-arm May 1, 2026

Choose a reason for hiding this comment

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

Given the point of this change is to make the builtin more generic, it doesn't make sense to then add barriers to future uses. We've already said a toolchain is free to ignore the hint and that's effectively what an older toolchain should do if given a hint that only newer toolchains support. If we want to help users spot potential typos then we can add an "unknown hint will be ignored" diagnostic.

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.

So for the atomic_store intrinsics here, it would be fine to have them work without the hint, however, for the atomic_fetch intrinsics added in #430, the assembly output is limited to the LSE variant as the hint does not work for other variants, so outline atomics will not be used. In that case we really don't want this to be seen as an alternative to using the non-hint atomics

Comment thread main/acle.md
Comment thread main/acle.md
@ricbal02 ricbal02 mentioned this pull request Apr 20, 2026
8 tasks
Comment thread main/acle.md
| KEEP | 0 | Signals to retain the updated location in the local cache of the updating PE. |
| STRM | 1 | Signals to not retain the updated location in the local cache of the updating PE. |
The fourth argument `hint` selects the requested hint. The set of valid
hint values depends on the architectural features supported by the
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.

Is it Hint or hint?

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.

What is the difference between Hint and hint besides the first letter being in capital or lower? Does it have different meaning for @sallyarmneale ?

@ricbal02
Copy link
Copy Markdown
Contributor

ricbal02 commented May 1, 2026

LGTM

Copy link
Copy Markdown
Contributor

@rockdreamer rockdreamer left a comment

Choose a reason for hiding this comment

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

LGTM otherwise

Comment thread main/acle.md Outdated
@kmclaughlin-arm kmclaughlin-arm self-requested a review May 5, 2026 14:01
Copy link
Copy Markdown
Contributor

@rockdreamer rockdreamer left a comment

Choose a reason for hiding this comment

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

LGTM

@Lukacma Lukacma merged commit 6b33645 into ARM-software:main May 7, 2026
3 of 4 checks passed
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.

7 participants