-
Notifications
You must be signed in to change notification settings - Fork 60
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
Make intrinsics available in function scope #214
base: main
Are you sure you want to change the base?
Conversation
GCC today already works like this PR. |
2729064
to
555a6cb
Compare
main/acle.md
Outdated
@@ -1427,15 +1435,15 @@ instruction set only. This can be tested for using the following test: | |||
|
|||
`__ARM_FEATURE_CRC32` is defined to 1 if the CRC32 instructions are | |||
supported and the intrinsics defined in [CRC32 intrinsics](#crc32-intrinsics) | |||
are available. These instructions include CRC32B, CRC32H and others. | |||
are unconditionally usable. These instructions include CRC32B, CRC32H and others. |
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.
I'm not sure about this kind of change. The statement “feature macro X indicates that Y is available” is still true. I think the difference is that feature macros are no longer the only indication of whether Y is available.
Also, #pragma GCC target
changes the feature macros (although this doesn't work well when preprocessing the source as a separate step).
I suppose this is mostly aimed at functions with the target_version
attribute. Should we require that, if an implementation supports target_version
, and if it recognises a given feature F for the target_version
string, it must:
- provide any ACLE header files associated with F
- make the intrinsics for feature F available in a
target_version
function that enables feature F, if the associated header files have been included.
(Not suggested wording)
Perhaps it would help to add a mapping from target_version
feature names to feature macros.
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.
I'm not sure about this kind of change. The statement “feature macro X indicates that Y is available” is still true. I think the difference is that feature macros are no longer the only indication of whether Y is available.
Correct, I'm happy drop these changes from the PR. The Intrinsics section could be extended further.
Also, #pragma GCC target changes the feature macros (although this doesn't work well when preprocessing the source as a separate step).
I suppose this is mostly aimed at functions with the target_version attribute. Should we require that, if an implementation supports target_version, and if it recognises a given feature F for the target_version string, it must:
provide any ACLE header files associated with F
make the intrinsics for feature F available in a target_version function that enables feature F, if the associated header files have been included.
(Not suggested wording)
I'll add something like this to the Intrinsics section.
Perhaps it would help to add a mapping from target_version feature names to feature macros.
unfortunately right now the feature names in the compilers are not standardised and different.
I'll do a separate PR for this.
Add a note when features just enabled in function scope the intrinsics must be usable.
555a6cb
to
d4b79fd
Compare
A given arch feature might enabled by a pragma or a function attribute so in this cases would be nice to use intrinsics. Today GCC offers the intrinsics without the march flag[1]. PR[2] for ACLE to clarify the intention and remove the need for -march flag for a given intrinsics. This is going to be more useful when D127812 lands. [1] https://godbolt.org/z/bxcMhav3z [2] ARM-software/acle#214 Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D133359
Hi, Issue #200 states that we should make all intrinsics available regardless of whether particular feature macros are defined or not. On the other hand, my understanding is that this PR here maintains the way it is now. But it adds that intrinsics might be made available by the use of 'target' function attribute in spite of the corresponding feature macro not being defined. What is the reason not to go all the way as the original issue proposes? If we did, intrinsics would be available at function scope by the simple virtue of unconditioned availability, with no differentiation between functions with or without the function attribute. Thanks and sorry if I am missing something obvious. |
This is how today GCC and LLVM work.
Would be nicer to tightly control the availability of the intrinsics but practically not worth the effort/complexity. I'd be happy with the original, but maybe I'm biased. |
Perhaps we need to agree on a common meaning of “available”. I suspect we're saying the same thing in terms of how things work, but using different words to describe it. In GCC it works like this:
Is that the functionality that we want? Or, instead of the final bullet point, do we want |
Addresses PR #200.
As for any pull request, please make sure to go through the below
checklist.
Checklist: (mark with
X
those which apply)PR (do not bother creating the issue if all you want to do is
fixing the bug yourself).
SPDX-FileCopyrightText
lines 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
).Copyright
section 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 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.
correctness of the result in the PDF output (please refer to the
instructions on how to build the PDFs
locally).
draftversion
is set totrue
in the YAML headerof the sources of the specifications I have modified.
in the README page of the project.