Commit ccdc1703 by Kazu Hirata Committed by Kazu Hirata

genrecog.c (decision_type): Add DT_const_int.

	* 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.

From-SVN: r77055
parent aeba8f80
2004-01-31 Kazu Hirata <kazu@cs.umass.edu> 2004-01-31 Kazu Hirata <kazu@cs.umass.edu>
* 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.
2004-01-31 Kazu Hirata <kazu@cs.umass.edu>
* config/m32r/m32r.c (m32r_load_pic_register): Use GEN_INT * config/m32r/m32r.c (m32r_load_pic_register): Use GEN_INT
instead of gen_rtx_CONST_INT. instead of gen_rtx_CONST_INT.
......
...@@ -90,6 +90,7 @@ struct decision_test ...@@ -90,6 +90,7 @@ struct decision_test
{ {
DT_mode, DT_code, DT_veclen, DT_mode, DT_code, DT_veclen,
DT_elt_zero_int, DT_elt_one_int, DT_elt_zero_wide, DT_elt_zero_wide_safe, 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_veclen_ge, DT_dup, DT_pred, DT_c_test,
DT_accept_op, DT_accept_insn DT_accept_op, DT_accept_insn
} type; } type;
...@@ -1981,6 +1982,11 @@ write_cond (struct decision_test *p, int depth, ...@@ -1981,6 +1982,11 @@ write_cond (struct decision_test *p, int depth,
print_host_wide_int (p->u.intval); print_host_wide_int (p->u.intval);
break; 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: case DT_veclen_ge:
printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen); printf ("XVECLEN (x%d, 0) >= %d", depth, p->u.veclen);
break; break;
...@@ -2143,6 +2149,23 @@ write_node (struct decision *p, int depth, ...@@ -2143,6 +2149,23 @@ write_node (struct decision *p, int depth,
struct decision_test *test, *last_test; struct decision_test *test, *last_test;
int uncond; 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; last_test = test = p->tests;
uncond = is_unconditional (test, subroutine_type); uncond = is_unconditional (test, subroutine_type);
if (uncond == 0) if (uncond == 0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment