diff options
author | Zack Weinberg <zackw@panix.com> | 2006-01-23 15:16:19 +0000 |
---|---|---|
committer | Zack Weinberg <zack@gcc.gnu.org> | 2006-01-23 15:16:19 +0000 |
commit | 6e7a4706fdf5641516cd85b20d5ac9070a348e15 (patch) | |
tree | ffc73708bd6be59b11ab8a71a9537d0d6289dced /gcc/doc/md.texi | |
parent | 6ff09968f1d0f5523b026701374f4a0386eb054c (diff) | |
download | gcc-6e7a4706fdf5641516cd85b20d5ac9070a348e15.zip gcc-6e7a4706fdf5641516cd85b20d5ac9070a348e15.tar.gz gcc-6e7a4706fdf5641516cd85b20d5ac9070a348e15.tar.bz2 |
r110130@banpei: zack | 2006-01-22 14:52:43 -0800
r110130@banpei: zack | 2006-01-22 14:52:43 -0800
* rtl.def (match_code): Add second argument.
* genpreds.c (write_extract_subexp): New function.
(write_match_code): Add path argument. Use write_extract_subexp.
(write_predicate_expr): Pass path to write_match_code.
(mark_mode_tests): MATCH_CODE applied to a subexpression does
not perform a mode test.
* genrecog.c (compute_predicate_codes): MATCH_CODE applied to
a subexpression does not constrain the top-level code set.
* read-rtl.c (read_rtx_variadic): New function.
(read_rtx_1): Use it; allow AND and IOR to be variadic.
* doc/md.texi: Document new notation.
* config/i386/predicates.md (cmpsi_operand_1): Fold into ...
(cmpsi_operand): ... here, using new notation.
From-SVN: r110126
Diffstat (limited to 'gcc/doc/md.texi')
-rw-r--r-- | gcc/doc/md.texi | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi index b6dd838..df16e93 100644 --- a/gcc/doc/md.texi +++ b/gcc/doc/md.texi @@ -898,9 +898,27 @@ limitations in @command{genrecog}, you can only refer to generic predicates and predicates that have already been defined. @item MATCH_CODE -This expression has one operand, a string constant containing a -comma-separated list of RTX code names (in lower case). It evaluates -to true if @var{op} has any of the listed codes. +This expression evaluates to true if @var{op} or a specified +subexpression of @var{op} has one of a given list of RTX codes. + +The first operand of this expression is a string constant containing a +comma-separated list of RTX code names (in lower case). These are the +codes for which the @code{MATCH_CODE} will be true. + +The second operand is a string constant which indicates what +subexpression of @var{op} to examine. If it is absent or the empty +string, @var{op} itself is examined. Otherwise, the string constant +must be a sequence of digits and/or lowercase letters. Each character +indicates a subexpression to extract from the current expression; for +the first character this is @var{op}, for the second and subsequent +characters it is the result of the previous character. A digit +@var{n} extracts @samp{@w{XEXP (@var{e}, @var{n})}}; a letter @var{l} +extracts @samp{@w{XVECEXP (@var{e}, 0, @var{n})}} where @var{n} is the +alphabetic ordinal of @var{l} (0 for `a', 1 for 'b', and so on). The +@code{MATCH_CODE} then examines the RTX code of the subexpression +extracted by the complete string. It is not possible to extract +components of an @code{rtvec} that is not at position 0 within its RTX +object. @item MATCH_TEST This expression has one operand, a string constant containing a C @@ -915,7 +933,10 @@ evaluates to true if the C expression evaluates to a nonzero value. @itemx IF_THEN_ELSE The basic @samp{MATCH_} expressions can be combined using these logical operators, which have the semantics of the C operators -@samp{&&}, @samp{||}, @samp{!}, and @samp{@w{? :}} respectively. +@samp{&&}, @samp{||}, @samp{!}, and @samp{@w{? :}} respectively. As +in Common Lisp, you may give an @code{AND} or @code{IOR} expression an +arbitrary number of arguments; this has exactly the same effect as +writing a chain of two-argument @code{AND} or @code{IOR} expressions. @end table @item |