summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2014-03-26 12:52:28 +0000
committerRenato Golin <renato.golin@linaro.org>2014-03-26 12:52:28 +0000
commitc4b058f9e7145765783fb741ea280acc4fea1f94 (patch)
tree9bf30fddda52ba7983b841347023b07a10592147 /docs
parent159e7f40956437a2513f54e19b03772bd3a0e942 (diff)
downloadllvm-c4b058f9e7145765783fb741ea280acc4fea1f94.tar.gz
llvm-c4b058f9e7145765783fb741ea280acc4fea1f94.tar.bz2
llvm-c4b058f9e7145765783fb741ea280acc4fea1f94.tar.xz
Add @llvm.clear_cache builtin
Implementing the LLVM part of the call to __builtin___clear_cache which translates into an intrinsic @llvm.clear_cache and is lowered by each target, either to a call to __clear_cache or nothing at all incase the caches are unified. Updating LangRef and adding some tests for the implemented architectures. Other archs will have to implement the method in case this builtin has to be compiled for it, since the default behaviour is to bail unimplemented. A Clang patch is required for the builtin to be lowered into the llvm intrinsic. This will be done next. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204802 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r--docs/LangRef.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/docs/LangRef.rst b/docs/LangRef.rst
index c959f56ef1..d18d4ebac9 100644
--- a/docs/LangRef.rst
+++ b/docs/LangRef.rst
@@ -6939,6 +6939,36 @@ is lowered to a constant 0.
Note that runtime support may be conditional on the privilege-level code is
running at and the host platform.
+'``llvm.clear_cache``' Intrinsic
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+ declare void @llvm.clear_cache(i8*, i8*)
+
+Overview:
+"""""""""
+
+The '``llvm.clear_cache``' intrinsic provides access to the systemcall
+that flushes the cache at the range specified. Some targets need this
+to specifically flush the instruction cache when executable data changes
+in memory (self-modifying code). Other targets have unified intruction
+and data cache, so they don't need any calls.
+
+Semantics:
+""""""""""
+
+When directly supported, this intrinsic will either return a call to
+the appropriate cache clearing system call (usually ``__clear_cache``)
+when the caches are not unified (ARM, Mips) or just remove the call
+altogether when they are (ex. x86_64).
+
+Targets must implement it directly to have either behaviour, as the
+default is to bail with "Not Implemented" message.
+
Standard C Library Intrinsics
-----------------------------