From 98f013cb0f8529e02d9310223304ccfb9ecf744a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 25 Jan 2006 23:47:57 +0000 Subject: [PATCH] document the syntax of inline asm llvm-svn: 25624 --- llvm/docs/LangRef.html | 55 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/llvm/docs/LangRef.html b/llvm/docs/LangRef.html index 99b1e8a99571..b963208f8c2d 100644 --- a/llvm/docs/LangRef.html +++ b/llvm/docs/LangRef.html @@ -55,6 +55,11 @@
  • Constant Expressions
  • +
  • Other Values +
      +
    1. Inline Assembler Expressions +
    +
  • Instruction Reference
    1. Terminator Instructions @@ -1144,6 +1149,56 @@ following is the syntax for constant expressions:

      + + + + + + + +
      + +

      +LLVM supports inline assembler expressions (as opposed to +Module-Level Inline Assembly) 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: +

      + +
      +  int(int) asm "bswap $0", "=r,r"
      +
      + +

      +Inline assembler expressions may only be used as the callee operand of +a call instruction. Thus, typically we have: +

      + +
      +  %X = call int asm "bswap $0", "=r,r"(int %Y)
      +
      + +

      +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 +'sideeffect' keyword, like so: +

      + +
      +  call void asm sideeffect "eieio", ""()
      +
      + +

      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). +

      + +
      +