diff options
author | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-31 23:08:52 +0000 |
---|---|---|
committer | kazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-31 23:08:52 +0000 |
commit | 7e5202bcdce0dfeb2599e6be3f4509b0c3d6978a (patch) | |
tree | 6dc3c19beea98cdd05aee44da8c777fac56cb779 /gcc/genrecog.c | |
parent | 73a1a86fe1c1ea2809c9bd277fa070066aba810c (diff) | |
download | gcc-7e5202bcdce0dfeb2599e6be3f4509b0c3d6978a.tar.gz |
* genrecog.c (decision_type): Add DT_const_int.
(write_cond) [DT_const_int]: Print a comparison against small
constant.
(write_node): Simplify comparisons against small constants
before printing tests.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@77055 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/genrecog.c')
-rw-r--r-- | gcc/genrecog.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/genrecog.c b/gcc/genrecog.c index dc756fe7644..8673de39a39 100644 --- a/gcc/genrecog.c +++ b/gcc/genrecog.c @@ -90,6 +90,7 @@ struct decision_test { DT_mode, DT_code, DT_veclen, DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe, + DT_const_int, DT_veclen_ge, DT_dup, DT_pred, DT_c_test, DT_accept_op, DT_accept_insn } type; @@ -1981,6 +1982,11 @@ write_cond (struct decision_test *p, int depth, print_host_wide_int (p->u.intval); break; + case DT_const_int: + printf ("x%d == const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", + depth, (int) p->u.intval); + break; + case DT_veclen_ge: printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen); break; @@ -2143,6 +2149,23 @@ write_node (struct decision *p, int depth, struct decision_test *test, *last_test; int uncond; + /* Scan the tests and simplify comparisons against small + constants. */ + for (test = p->tests; test; test = test->next) + { + if (test->type == DT_code + && test->u.code == CONST_INT + && test->next + && test->next->type == DT_elt_zero_wide_safe + && -MAX_SAVED_CONST_INT <= test->next->u.intval + && test->next->u.intval <= MAX_SAVED_CONST_INT) + { + test->type = DT_const_int; + test->u.intval = test->next->u.intval; + test->next = test->next->next; + } + } + last_test = test = p->tests; uncond = is_unconditional (test, subroutine_type); if (uncond == 0) |