-
Notifications
You must be signed in to change notification settings - Fork 70
Add FEAT_CMH support #430
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
Open
ricbal02
wants to merge
1
commit into
ARM-software:main
Choose a base branch
from
ricbal02:FEAT_CMH
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+58
−0
Open
Add FEAT_CMH support #430
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1848,6 +1848,11 @@ execution state. Intrinsics for the use of these instructions are specified in | |
| data placement hints (FEAT_PCDPHINT) instructions and their associated | ||
| intrinsics are available on the target. | ||
|
|
||
| ### Contention Management hints | ||
|
|
||
| `__ARM_FEATURE_CMH` is defined to `1` if the Contention Management hints | ||
| (FEAT_CMH) instructions and their associated intrinsics are available on the target. | ||
|
|
||
| ## Floating-point and vector hardware | ||
|
|
||
| ### Hardware floating point | ||
|
|
@@ -2654,6 +2659,7 @@ be found in [[BA]](#BA). | |
| | [`__ARM_FEATURE_CDE`](#custom-datapath-extension) | Custom Datapath Extension | 0x01 | | ||
| | [`__ARM_FEATURE_CDE_COPROC`](#custom-datapath-extension) | Custom Datapath Extension | 0xf | | ||
| | [`__ARM_FEATURE_CLZ`](#clz) | CLZ instruction | 1 | | ||
| | [`__ARM_FEATURE_CMH`](#contention-management-hints) | Contention management hints | 1 | | ||
| | [`__ARM_FEATURE_COMPLEX`](#complex-number-intrinsics) | Armv8.3-A extension | 1 | | ||
| | [`__ARM_FEATURE_COPROC`](#coprocessor-intrinsics) | Coprocessor Intrinsics | 1 | | ||
| | [`__ARM_FEATURE_CRC32`](#crc32-extension) | CRC32 extension | 1 | | ||
|
|
@@ -4980,6 +4986,58 @@ The fourth argument can contain the following values: | |
| | 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. | | ||
|
|
||
| ## Atomic store with CMH intrinsics | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you please mark it with [Alpha state] |
||
|
|
||
| These intrinsics provide an atomic store, which will | ||
| make use of the `STCPH` or `SHUH` hint instructions immediately followed by the | ||
| associated store instruction. These intrinsics are type generic and | ||
| support scalar types from 8-64 bits and are available when | ||
| `__ARM_FEATURE_CMH` is defined. | ||
|
|
||
| To access these intrinsics, `<arm_acle.h>` should be included. | ||
|
|
||
| ``` c | ||
| void __arm_atomic_store_with_stcph(type *ptr, type data, int memory_order); | ||
|
ricbal02 marked this conversation as resolved.
|
||
| void __arm_atomic_store_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| ``` | ||
|
|
||
| The first argument in these intrinsics is a pointer `ptr` which is the location to store to. | ||
| The second argument `data` is the data which is to be stored. | ||
| The third argument `mem` can be one of 3 memory ordering variables supported by atomic_store: | ||
| __ATOMIC_RELAXED, __ATOMIC_SEQ_CST, and __ATOMIC_RELEASE. | ||
| The fourth argument `priority_hint` can be either 0 or 1. If set to 1 then if the next instruction in program order generates | ||
| an Explicit Memory Write Effect, then there is a performance benefit if that Explicit Memory Write Effect | ||
| is sequenced before Memory Effects from other threads of execution in the coherence order to the same | ||
| location. | ||
|
|
||
| ## Atomic fetch with CMH intrinsics | ||
|
|
||
| These intrinsics provide some atomic fetch operations, which will | ||
| make use of the `SHUH` hint instruction immediately followed by the | ||
| associated fetch instructions. These intrinsics are type generic and | ||
| support scalar types from 8-64 bits and are available when | ||
| `__ARM_FEATURE_CMH` is defined. | ||
|
|
||
| To access these intrinsics, `<arm_acle.h>` should be included. | ||
|
|
||
| ``` c | ||
| type __arm_atomic_fetch_add_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| type __arm_atomic_fetch_sub_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| type __arm_atomic_fetch_and_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| type __arm_atomic_fetch_xor_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| type __arm_atomic_fetch_or_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| type __arm_atomic_fetch_nand_with_shuh(type *ptr, type data, int memory_order, int priority_hint); | ||
| ``` | ||
|
|
||
| The first argument in these intrinsic is a pointer `ptr` which is the location to store to. | ||
| The second argument `data` is the data which is to be stored. | ||
| The third argument `mem` can be one of 6 memory ordering variables supported by atomic_fetch: | ||
| __ATOMIC_RELAXED, __ATOMIC_SEQ_CST, __ATOMIC_ACQUIRE, __ATOMIC_CONSUME, __ATOMIC_ACQ_REL and __ATOMIC_RELEASE. | ||
| The fourth argument `priority_hint` can be either 0 or 1. If set to 1 then if the next instruction in program order generates | ||
| an Explicit Memory Write Effect, then there is a performance benefit if that Explicit Memory Write Effect | ||
| is sequenced before Memory Effects from other threads of execution in the coherence order to the same | ||
| location. | ||
|
|
||
| # Custom Datapath Extension | ||
|
|
||
| The intrinsics in this section provide access to instructions in the | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
could you please mark it with [Alpha state]