mzolotukhin created this revision.
mzolotukhin added reviewers: hfinkel, rsmith.
mzolotukhin added a subscriber: cfe-commits.

In r247104 I added the builtins for generating non-temporal memory operations,
but now I realized that they lack documentation. This patch adds some.

http://reviews.llvm.org/D12785

Files:
  docs/LanguageExtensions.rst

Index: docs/LanguageExtensions.rst
===================================================================
--- docs/LanguageExtensions.rst
+++ docs/LanguageExtensions.rst
@@ -1778,6 +1778,36 @@
 For these reasons the higher level atomic primitives should be preferred where
 possible.
 
+Non-temporal load/store builtins
+--------------------------------
+
+Clang provides overloaded builtins allowing to generate non-temporal memory
+accesses.
+
+.. code-block:: c
+
+  T __builtin_nontemporal_load(T *addr);
+  void __builtin_nontemporal_store(T value, T *addr);
+
+The types ``T`` currently supported are:
+
+* Integer types.
+* Floating-point types
+* Vector types.
+
+Note that the compiler does not guarantee that non-temporal loads or stores
+would be used.  Also, using non-temporal loads and stores might change program
+semantics on some targets, so the builtins should be used with care.
+
+For example, on AArch64 in the following code::
+
+  LDR X1, [X2]
+  LDNP X3, X4, [X1]
+
+the ``LDNP`` might be executed before the ``LDR``. In this case the load would
+be performed from a wrong address (see 6.3.8 in `Programmer's Guide for ARMv8-A
+<http://infocenter.arm.com/help/topic/com.arm.doc.den0024a/DEN0024A_v8_architecture_PG.pdf>`_).
+
 Non-standard C++11 Attributes
 =============================
 


Index: docs/LanguageExtensions.rst
===================================================================
--- docs/LanguageExtensions.rst
+++ docs/LanguageExtensions.rst
@@ -1778,6 +1778,36 @@
 For these reasons the higher level atomic primitives should be preferred where
 possible.
 
+Non-temporal load/store builtins
+--------------------------------
+
+Clang provides overloaded builtins allowing to generate non-temporal memory
+accesses.
+
+.. code-block:: c
+
+  T __builtin_nontemporal_load(T *addr);
+  void __builtin_nontemporal_store(T value, T *addr);
+
+The types ``T`` currently supported are:
+
+* Integer types.
+* Floating-point types
+* Vector types.
+
+Note that the compiler does not guarantee that non-temporal loads or stores
+would be used.  Also, using non-temporal loads and stores might change program
+semantics on some targets, so the builtins should be used with care.
+
+For example, on AArch64 in the following code::
+
+  LDR X1, [X2]
+  LDNP X3, X4, [X1]
+
+the ``LDNP`` might be executed before the ``LDR``. In this case the load would
+be performed from a wrong address (see 6.3.8 in `Programmer's Guide for ARMv8-A
+<http://infocenter.arm.com/help/topic/com.arm.doc.den0024a/DEN0024A_v8_architecture_PG.pdf>`_).
+
 Non-standard C++11 Attributes
 =============================
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to