recog.c (ordered_comparison_operator): New.
2009-04-08 Paolo Bonzini <bonzini@gnu.org> * recog.c (ordered_comparison_operator): New. * gensupport.c (std_preds): Add it. * doc/md.texi (Machine-Independent Predicates): Document it. From-SVN: r145748
This commit is contained in:
parent
6d07ad9876
commit
c6963675eb
@ -1,3 +1,9 @@
|
||||
2009-04-08 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* recog.c (ordered_comparison_operator): New.
|
||||
* gensupport.c (std_preds): Add it.
|
||||
* doc/md.texi (Machine-Independent Predicates): Document it.
|
||||
|
||||
2009-04-08 Jan Hubicka <jh@suse.cz>
|
||||
|
||||
* tree-eh.c (cleanup_eh): When not optimizing, do not try EH merging.
|
||||
|
@ -860,7 +860,7 @@ valid for @var{mode}.
|
||||
@end defun
|
||||
|
||||
@noindent
|
||||
Finally, there is one generic operator predicate.
|
||||
Finally, there are two generic operator predicates.
|
||||
|
||||
@defun comparison_operator
|
||||
This predicate matches any expression which performs an arithmetic
|
||||
@ -868,6 +868,14 @@ comparison in @var{mode}; that is, @code{COMPARISON_P} is true for the
|
||||
expression code.
|
||||
@end defun
|
||||
|
||||
@defun ordered_comparison_operator
|
||||
This predicate matches any expression which performs an arithmetic
|
||||
comparison in @var{mode} and whose expression code is valid for integer
|
||||
modes; that is, the expression code will be one of @code{eq}, @code{ne},
|
||||
@code{lt}, @code{ltu}, @code{le}, @code{leu}, @code{gt}, @code{gtu},
|
||||
@code{ge}, @code{geu}.
|
||||
@end defun
|
||||
|
||||
@node Defining Predicates
|
||||
@subsection Defining Machine-Specific Predicates
|
||||
@cindex defining predicates
|
||||
|
@ -1367,6 +1367,9 @@ static const struct std_pred_table std_preds[] = {
|
||||
{"pop_operand", false, false, {MEM}},
|
||||
{"memory_operand", false, false, {SUBREG, MEM}},
|
||||
{"indirect_operand", false, false, {SUBREG, MEM}},
|
||||
{"ordered_comparison_operator", false, false, {EQ, NE,
|
||||
LE, LT, GE, GT,
|
||||
LEU, LTU, GEU, GTU}},
|
||||
{"comparison_operator", false, false, {EQ, NE,
|
||||
LE, LT, GE, GT,
|
||||
LEU, LTU, GEU, GTU,
|
||||
|
26
gcc/recog.c
26
gcc/recog.c
@ -1319,6 +1319,32 @@ indirect_operand (rtx op, enum machine_mode mode)
|
||||
&& general_operand (XEXP (op, 0), Pmode));
|
||||
}
|
||||
|
||||
/* Return 1 if this is an ordered comparison operator (not including
|
||||
ORDERED and UNORDERED). */
|
||||
|
||||
int
|
||||
ordered_comparison_operator (rtx op, enum machine_mode mode)
|
||||
{
|
||||
if (mode != VOIDmode && GET_MODE (op) != mode)
|
||||
return false;
|
||||
switch (GET_CODE (op))
|
||||
{
|
||||
case EQ:
|
||||
case NE:
|
||||
case LT:
|
||||
case LTU:
|
||||
case LE:
|
||||
case LEU:
|
||||
case GT:
|
||||
case GTU:
|
||||
case GE:
|
||||
case GEU:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return 1 if this is a comparison operator. This allows the use of
|
||||
MATCH_OPERATOR to recognize all the branch insns. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user