From e87d653da66f76b9f0e5b85c4e73e139f0cb73c2 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25624 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 55 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index 99b1e8a9957..b963208f8c2 100644 --- a/docs/LangRef.html +++ b/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). +

      + +
      + -- 2.34.1