summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-12 18:10:10 +0000
committerChris Lattner <sabre@nondot.org>2004-02-12 18:10:10 +0000
commitf30152e4808b8e1bd3f719c98a38d675d87ccd31 (patch)
tree614eff041ceacb73b2a69a1e2e9730d441ac5112
parente0ea5cff8a2ff3317dadfad3aefaacefe56dfda3 (diff)
downloadbcm5719-llvm-f30152e4808b8e1bd3f719c98a38d675d87ccd31.tar.gz
bcm5719-llvm-f30152e4808b8e1bd3f719c98a38d675d87ccd31.zip
Add support for the llvm.memmove intrinsic.
Patch graciously contributed by Reid Spencer! llvm-svn: 11354
-rw-r--r--llvm/docs/LangRef.html47
-rw-r--r--llvm/include/llvm/Intrinsics.h4
2 files changed, 50 insertions, 1 deletions
diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html
index 7b03c45511f..20436ede7e2 100644
--- a/llvm/docs/LangRef.html
+++ b/llvm/docs/LangRef.html
@@ -98,6 +98,7 @@
<li><a href="#int_libc">Standard C Library Intrinsics</a>
<ol>
<li><a href="#i_memcpy">'<tt>llvm.memcpy</tt>' Intrinsic</a></li>
+ <li><a href="#i_memmove">'<tt>llvm.memmove</tt>' Intrinsic</a></li>
</ol>
</li>
<li><a href="#int_debugger">Debugger intrinsics</a>
@@ -1790,6 +1791,52 @@ be set to 0 or 1.
</div>
+<!-- _______________________________________________________________________ -->
+<div class="doc_subsubsection">
+ <a name="i_memmove">'<tt>llvm.memmove</tt>' Intrinsic</a>
+</div>
+
+<div class="doc_text">
+
+<h5>Syntax:</h5>
+<pre>
+ call void (sbyte*, sbyte*, uint, uint)* %llvm.memmove(sbyte* &lt;dest&gt;, sbyte* &lt;src&gt;,
+ uint &lt;len&gt;, uint &lt;align&gt;)
+</pre>
+
+<h5>Overview:</h5>
+
+<p>
+The '<tt>llvm.memmove</tt>' intrinsic moves a block of memory from the source
+location to the destination location. It is similar to the '<tt>llvm.memcpy</tt>'
+intrinsic but allows the two memory locations to overlap.
+</p>
+
+<p>
+Note that, unlike the standard libc function, the <tt>llvm.memmove</tt> intrinsic
+does not return a value, and takes an extra alignment argument.
+</p>
+
+<h5>Arguments:</h5>
+
+<p>
+The first argument is a pointer to the destination, the second is a pointer to
+the source. The third argument is an (arbitrarily sized) integer argument
+specifying the number of bytes to copy, and the fourth argument is the alignment
+of the source and destination locations.
+</p>
+
+<h5>Semantics:</h5>
+
+<p>
+The '<tt>llvm.memmove</tt>' intrinsic copies a block of memory from the source
+location to the destination location, which may overlap. It
+copies "len" bytes of memory over. If the argument is known to be aligned to
+some boundary, this can be specified as the fourth argument, otherwise it should
+be set to 0 or 1.
+</p>
+</div>
+
<!-- ======================================================================= -->
<div class="doc_subsection">
diff --git a/llvm/include/llvm/Intrinsics.h b/llvm/include/llvm/Intrinsics.h
index 098d5d4abd2..125105dd303 100644
--- a/llvm/include/llvm/Intrinsics.h
+++ b/llvm/include/llvm/Intrinsics.h
@@ -45,7 +45,9 @@ namespace Intrinsic {
dbg_declare, // Declare a local object
// Standard libc functions...
- memcpy,
+ memcpy, // Used to copy non-overlapping memory blocks
+ memmove, // Used to copy overlapping memory blocks
+
// Standard libm functions...
OpenPOWER on IntegriCloud