From e87d653da66f76b9f0e5b85c4e73e139f0cb73c2 Mon Sep 17 00:00:00 2001
From: Chris Lattner
+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). +
+ +