diff options
author | JF Bastien <jfb@google.com> | 2015-12-17 22:09:19 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2015-12-17 22:09:19 +0000 |
commit | d1fb58538ff3e9fd1a89dc4a840a48c337414027 (patch) | |
tree | 4042008c68475f23fd077fa822b08e27468f6cbc /llvm/docs | |
parent | 762a6ac0b5c7565e08b78f3bd6fef7c5c9b49d5d (diff) | |
download | bcm5719-llvm-d1fb58538ff3e9fd1a89dc4a840a48c337414027.tar.gz bcm5719-llvm-d1fb58538ff3e9fd1a89dc4a840a48c337414027.zip |
Polish atomic pointers
Summary:
I didn't realize that we already allowed atomic load/store of pointers,
it was added in 2012 by r162146. This patch updates the documentation
and tightens the verifier by using DataLayout to make sure that the
stored size is byte-sized and power-of-two. DataLayout is also used for
integers, and while I'm here I updated the corresponding code for
cmpxchg and rmw.
See the following discussion for context and upcoming changes to
add floating-point and vector atomics:
https://groups.google.com/forum/#!topic/llvm-dev/Nh0P_E3CRoo/discussion
Reviewers: reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D15512
llvm-svn: 255931
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 43 |
1 files changed, 20 insertions, 23 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index c968818acf2..103d876b3ce 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -6847,17 +6847,16 @@ then the optimizer is not allowed to modify the number or order of execution of this ``load`` with other :ref:`volatile operations <volatile>`. -If the ``load`` is marked as ``atomic``, it takes an extra -:ref:`ordering <ordering>` and optional ``singlethread`` argument. The -``release`` and ``acq_rel`` orderings are not valid on ``load`` -instructions. Atomic loads produce :ref:`defined <memmodel>` results -when they may see multiple atomic stores. The type of the pointee must -be an integer or floating point type whose bit width is a power of two, -greater than or equal to eight, and less than or equal to a -target-specific size limit. ``align`` must be explicitly specified on -atomic loads, and the load has undefined behavior if the alignment is -not set to a value which is at least the size in bytes of the pointee. -``!nontemporal`` does not have any defined semantics for atomic loads. +If the ``load`` is marked as ``atomic``, it takes an extra :ref:`ordering +<ordering>` and optional ``singlethread`` argument. The ``release`` and +``acq_rel`` orderings are not valid on ``load`` instructions. Atomic loads +produce :ref:`defined <memmodel>` results when they may see multiple atomic +stores. The type of the pointee must be an integer, pointer, or floating-point +type whose bit width is a power of two greater than or equal to eight and less +than or equal to a target-specific size limit. ``align`` must be explicitly +specified on atomic loads, and the load has undefined behavior if the alignment +is not set to a value which is at least the size in bytes of the +pointee. ``!nontemporal`` does not have any defined semantics for atomic loads. The optional constant ``align`` argument specifies the alignment of the operation (that is, the alignment of the memory address). A value of 0 @@ -6972,18 +6971,16 @@ then the optimizer is not allowed to modify the number or order of execution of this ``store`` with other :ref:`volatile operations <volatile>`. -If the ``store`` is marked as ``atomic``, it takes an extra -:ref:`ordering <ordering>` and optional ``singlethread`` argument. The -``acquire`` and ``acq_rel`` orderings aren't valid on ``store`` -instructions. Atomic loads produce :ref:`defined <memmodel>` results -when they may see multiple atomic stores. The type of the pointee must -be an integer or floating point type whose bit width is a power of two, -greater than or equal to eight, and less than or equal to a -target-specific size limit. ``align`` must be explicitly specified -on atomic stores, and the store has undefined behavior if the alignment -is not set to a value which is at least the size in bytes of the -pointee. ``!nontemporal`` does not have any defined semantics for -atomic stores. +If the ``store`` is marked as ``atomic``, it takes an extra :ref:`ordering +<ordering>` and optional ``singlethread`` argument. The ``acquire`` and +``acq_rel`` orderings aren't valid on ``store`` instructions. Atomic loads +produce :ref:`defined <memmodel>` results when they may see multiple atomic +stores. The type of the pointee must be an integer, pointer, or floating-point +type whose bit width is a power of two greater than or equal to eight and less +than or equal to a target-specific size limit. ``align`` must be explicitly +specified on atomic stores, and the store has undefined behavior if the +alignment is not set to a value which is at least the size in bytes of the +pointee. ``!nontemporal`` does not have any defined semantics for atomic stores. The optional constant ``align`` argument specifies the alignment of the operation (that is, the alignment of the memory address). A value of 0 |