aboutsummaryrefslogtreecommitdiffstats
path: root/docs/LangRef.html
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-25 23:47:57 +0000
committerChris Lattner <sabre@nondot.org>2006-01-25 23:47:57 +0000
commite87d653da66f76b9f0e5b85c4e73e139f0cb73c2 (patch)
tree9128127f5a4f57eaa95ff06fc3c0de12e43c54a1 /docs/LangRef.html
parent677c4f2cbc7d77b53715ce26fe30ca82e48e644a (diff)
downloadexternal_llvm-e87d653da66f76b9f0e5b85c4e73e139f0cb73c2.zip
external_llvm-e87d653da66f76b9f0e5b85c4e73e139f0cb73c2.tar.gz
external_llvm-e87d653da66f76b9f0e5b85c4e73e139f0cb73c2.tar.bz2
document the syntax of inline asm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25624 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/LangRef.html')
-rw-r--r--docs/LangRef.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 99b1e8a..b963208 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -55,6 +55,11 @@
<li><a href="#constantexprs">Constant Expressions</a>
</ol>
</li>
+ <li><a href="#othervalues">Other Values</a>
+ <ol>
+ <li><a href="#inlineasm">Inline Assembler Expressions</a>
+ </ol>
+ </li>
<li><a href="#instref">Instruction Reference</a>
<ol>
<li><a href="#terminators">Terminator Instructions</a>
@@ -1145,6 +1150,56 @@ following is the syntax for constant expressions:</p>
</div>
<!-- *********************************************************************** -->
+<div class="doc_section"> <a name="othervalues">Other Values</a> </div>
+<!-- *********************************************************************** -->
+
+<!-- ======================================================================= -->
+<div class="doc_subsection">
+<a name="inlineasm">Inline Assembler Expressions</a>
+</div>
+
+<div class="doc_text">
+
+<p>
+LLVM supports inline assembler expressions (as opposed to <a href="#moduleasm">
+Module-Level Inline Assembly</a>) through the use of a special value. This
+value represents the inline assembler as a string (containing the instructions
+to emit), a list of operand constraints (stored as a string), and a flag that
+indicates whether or not the inline asm expression has side effects. An example
+inline assembler expression is:
+</p>
+
+<pre>
+ int(int) asm "bswap $0", "=r,r"
+</pre>
+
+<p>
+Inline assembler expressions may <b>only</b> be used as the callee operand of
+a <a href="#i_call"><tt>call</tt> instruction</a>. Thus, typically we have:
+</p>
+
+<pre>
+ %X = call int asm "<a href="#i_bswap">bswap</a> $0", "=r,r"(int %Y)
+</pre>
+
+<p>
+Inline asms with side effects not visible in the constraint list must be marked
+as having side effects. This is done through the use of the
+'<tt>sideeffect</tt>' keyword, like so:
+</p>
+
+<pre>
+ call void asm sideeffect "eieio", ""()
+</pre>
+
+<p>TODO: The format of the asm and constraints string still need to be
+documented here. Constraints on what can be done (e.g. duplication, moving, etc
+need to be documented).
+</p>
+
+</div>
+
+<!-- *********************************************************************** -->
<div class="doc_section"> <a name="instref">Instruction Reference</a> </div>
<!-- *********************************************************************** -->