Repository navigation
Add feature detection macros for SB and DIT - #475
dingxiangfei2009 wants to merge 1 commit into
Conversation
a9b5250 to
1c39477
Compare
|
@AlfieRichardsArm @CarolineConcatto would you mind a look? |
|
I have prepared a patch to LLVM to expose the predefined macros, if that is the concern. I will follow up with GCC later. |
|
Hi, sorry for the delay, the feature macros look very reasonable to me. I am not an expert on speculation barriers so don't feel qualified to comment on the speculation barrier API. Specifically, I am very uncertain what API contract the intrinsic could have in regards to optimizations? I guess it can operate similarly to a memory barrier and we will prevent any memory reads or writes being moved over it, but is that enough? |
|
Thank you for looking into this @AlfieRichardsArm. Sorry I got sick unfortunately so I am slowly catching up with emails. I realized, conceptually all three of I would propose the wording for |
- SB has existed in ARMv8 for some time and has not received a detection macro assignment. This feature would certainly be more useful if compilers understand its semantics and apply the appropriate value barriers. - DIT has been added in ARMv8.4 and and become mandatory in ARMv8.5-A. A feature detection macro would also be useful due to the history. Signed-off-by: Xiangfei Ding <xfding@google.com>
1c39477 to
2e74ac3
Compare
| The `__sb()` intrinsic also acts as a compiler barrier of the appropriate | ||
| type. In the narrowest sense, this intrinsic poses as a memory barrier | ||
| so that memory loads and store do not reorder across it; and a scheduling | ||
| barrier so that surrounding code in program order should not be reordered | ||
| across it. |
There was a problem hiding this comment.
This is the new wording on the expectation on the compiler implementation.
Fix #463
name: Pull request
about: feature proposal
Thank you for submitting a pull request!
If this PR is about a bugfix:
Please use the bugfix label and make sure to go through the checklist below.
If this PR is about a proposal:
We are looking forward to evaluate your proposal, and if possible to
make it part of the Arm C Language Extension (ACLE) specifications.
We would like to encourage you reading through the contribution
guidelines, in particular the section on submitting
a proposal.
Please use the proposal label.
As for any pull request, please make sure to go through the below
checklist.
Checklist: (mark with
Xthose which apply)PR (do not bother creating the issue if all you want to do is
fixing the bug yourself).
SPDX-FileCopyrightTextlines on topof 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 usecommas to separate gaps, as in
2018-2020, 2022).Copyrightsection of the sources of thespecification 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.
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.
introduced in this PR in section Changelog for year 20xx (this year)
of section Preface/About this document.
Create Changelog for year 20xx 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.
correctness of the result in the PDF output (please refer to the
instructions on how to build the PDFs
locally).
in the README page of the project.