This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Document %c0 syntax in extended asm


The syntax '%c0' in extended asm instruction templates is documented in the internals manual, but not in the user's manual.

(I don't have a copyright assignment, but most of this patch was copied from the internals manual)

2006-09-28 Avi Kivity <avi@qumranet.com>

* doc/extend.texi (Extended Asm): Document %c0 syntax and friends.

Index: doc/extend.texi
===================================================================
--- doc/extend.texi	(revision 117274)
+++ doc/extend.texi	(working copy)
@@ -3951,6 +3951,32 @@
existing C symbols, but you must ensure that no two operands within the same
assembler construct use the same symbolic name.

+The instruction template refers to operands by using the syntax
+@samp{%@var{digit}} or @samp{%[@var{name}]}, where @samp{digit} refers
+to the operand's position in the operand list.  The instruction template
+may modify the way the operand is inserted into the instruction:
+
+@samp{%c@var{digit}} can be used to substitute an operand that is a
+constant value without the syntax that normally indicates an immediate
+operand.
+
+@samp{%n@var{digit}} is like @samp{%c@var{digit}} except that the value of
+the constant is negated before printing.
+
+@samp{%a@var{digit}} can be used to substitute an operand as if it were a
+memory reference, with the actual operand treated as the address.  This may
+be useful when outputting a ``load address'' instruction, because often the
+assembler syntax for such an instruction requires you to write the operand
+as if it were a memory reference.
+
+@samp{%l@var{digit}} is used to substitute a @code{label_ref} into a jump
+instruction.
+
+@samp{%=} outputs a number which is unique to each instruction in the
+entire compilation.  This is useful for making local labels to be
+referred to more than once in a single template that generates multiple
+assembler instructions.
+
Output operand expressions must be lvalues; the compiler can check this.
The input operands need not be lvalues.  The compiler cannot check
whether the operands have data types that are reasonable for the





--
error compiling committee.c: too many arguments to function


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]