OSDN Git Service

* xc16x.cpu (h-cr): New hardware.
[pf3gnuchains/pf3gnuchains4x.git] / cgen / doc / rtl.texi
index 2cf9bf2..c316fe7 100644 (file)
@@ -2109,7 +2109,35 @@ The machine encoding of the operand.
 An assertion of what values any instruction fields will or will not have
 in the containing instruction.
 
-??? A better name for this might be "constraint".
+@anchor{ifield-assertion-rtl}
+The syntax of the assertion is a restricted subset of RTL.
+It may only contain @samp{andif}, @samp{eq}, @samp{ne},
+and may only use scalar instruction fields
+@footnote{A scalar instruction field is a simple ifield
+(not a multi or derived ifield), or a multi-ifield consisting
+of only simple ifields.}
+and integers as operands.
+Furthermore, ifields must be specified in the first operand of
+@samp{eq}, @samp{ne}.
+
+As a degenerate case, a single non-zero integer, is also supported,
+meaning the assertion passes.
+
+In addition, the assertion may also use @samp{member}.
+
+Syntax: @code{(member ifield-name (number-list value1 [value2 ...]))}
+@footnote{Like all rtx, the full syntax is
+@code{(member [(options)] [member-mode] ifield-name (number-list [(options)] [numlist-mode] value1 [value2 ...]))},
+but @samp{options} and @samp{mode} are not really useful here.
+@samp{member-mode} is @samp{BI}, since the result is a boolean value.}
+
+The result of @samp{member} is one if the value of the ifield
+is a member of the list @code{(value1 [value2 ...])}.
+Otherwise the result is zero.
+
+If the result of the assertion is non-zero, the assertion passes.
+Otherwise it fails, and the instruction is not selected for that
+particular bit pattern.
 
 @subsection getter
 
@@ -2272,6 +2300,9 @@ Format elements can be any of:
 This is an expression with a boolean result that is run as the final
 part of instruction decoding to verify a match.
 
+The syntax of the assertion is a restricted subset of RTL.
+@xref{ifield-assertion-rtl}.
+
 @subsection semantics
 @cindex Semantics
 
@@ -2822,20 +2853,25 @@ an experiment and will probably change.
 Skip the next instruction if @samp{yes?} is non-zero. This rtx is
 an experiment and will probably change.
 
-@item (attr mode kind attr-name)
-Return the value of attribute @samp{attr-name} in mode
-@samp{mode}. @samp{kind} must currently be @samp{insn}: the current
-instruction.
-
 @item (symbol name)
 Return a symbol with value @samp{name}, for use in attribute
 processing. This is equivalent to @samp{quote} in Scheme but
 @samp{quote} sounds too jargonish.
 
-@item (eq-attr mode attr-name value)
-Return non-zero if the value of attribute @samp{attr-name} is
-@samp{value}. If @samp{value} is a list return ``true'' if
-@samp{attr-name} is any of the listed values.
+@item (int-attr mode object attr-name)
+Return the value of attribute @samp{attr-name} in mode @samp{mode}.
+@samp{object} must currently be @samp{(current-insn)}, the current instruction,
+or @samp{(current-mach)}, the current machine.
+The attribute's value must be representable as an integer.
+
+@item (eq-attr mode object attr-name value)
+Return non-zero if the value of attribute @samp{attr-name} of
+object @samp{object} is @samp{value}.
+
+@emph{NOTE:} List values of @samp{value} may be changed to allow use the
+@samp{number-list} rtx function.
+If @samp{value} is a list return ``true'' if the attribute is any of
+the listed values.  But this is not implemented yet.
 
 @item (index-of operand)
 Return the index of @samp{operand}. For registers this is the register number.