Commit 23568fa0 by Nick Clifton Committed by Nick Clifton

Replace (GET_RTX_CLASS(GET_CODE()) == 'i') with INSN_P()

From-SVN: r33949
parent eaef69ce
2000-05-16 Nick Clifton <nickc@cygnus.com>
* config/m32r/m32r.c (small_insn_p): Use INSN_P() to replace
GET_RTX_CLASS (GET_CODE ()) == 'i'.
(large_insn_p): Ditto.
(m32r_is_insn): New function: Return true if the insn contains
an executable instruction.
(m32r_adjust_insn): Use m32r_is_insn.
(m32r_sched_reorder): Use m32r_is_insn.
(m32r_sched_variable_issue): Use m32r_is_insn.
2000-05-16 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> 2000-05-16 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
* rs6000/rs6000.c (rs6000_select_section): Treat CONSTRUCTOR like * rs6000/rs6000.c (rs6000_select_section): Treat CONSTRUCTOR like
......
...@@ -961,7 +961,7 @@ small_insn_p (op, mode) ...@@ -961,7 +961,7 @@ small_insn_p (op, mode)
if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0) if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0)
return 1; return 1;
if (GET_RTX_CLASS (GET_CODE (op)) != 'i') if (! INSN_P (op))
return 0; return 0;
return get_attr_length (op) == 2; return get_attr_length (op) == 2;
...@@ -974,7 +974,7 @@ large_insn_p (op, mode) ...@@ -974,7 +974,7 @@ large_insn_p (op, mode)
rtx op; rtx op;
enum machine_mode mode ATTRIBUTE_UNUSED; enum machine_mode mode ATTRIBUTE_UNUSED;
{ {
if (GET_RTX_CLASS (GET_CODE (op)) != 'i') if (! INSN_P (op))
return 0; return 0;
return get_attr_length (op) != 2; return get_attr_length (op) != 2;
...@@ -1484,27 +1484,29 @@ m32r_adjust_cost (insn, link, dep_insn, cost) ...@@ -1484,27 +1484,29 @@ m32r_adjust_cost (insn, link, dep_insn, cost)
} }
/* A C statement (sans semicolon) to update the integer scheduling /* Return true if INSN is real instruction bearing insn. */
priority `INSN_PRIORITY(INSN)'. Reduce the priority to execute
the INSN earlier, increase the priority to execute INSN later.
Do not define this macro if you do not need to adjust the
scheduling priorities of insns.
On the m32r, increase the priority of long instructions so that static int
the short instructions are scheduled ahead of the long ones. */ m32r_is_insn (insn)
rtx insn;
{
return (INSN_P (insn)
&& GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER
&& GET_CODE (PATTERN (insn)) != ADDR_VEC);
}
/* Increase the priority of long instructions so that the
short instructions are scheduled ahead of the long ones. */
int int
m32r_adjust_priority (insn, priority) m32r_adjust_priority (insn, priority)
rtx insn; rtx insn;
int priority; int priority;
{ {
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i') if (m32r_is_insn (insn)
{ && get_attr_insn_size (insn) != INSN_SIZE_SHORT)
enum rtx_code code = GET_CODE (PATTERN (insn)); priority <<= 3;
if (code != USE && code != CLOBBER && code != ADDR_VEC
&& get_attr_insn_size (insn) != INSN_SIZE_SHORT)
priority <<= 3;
}
return priority; return priority;
} }
...@@ -1560,11 +1562,9 @@ m32r_sched_reorder (stream, verbose, ready, n_ready) ...@@ -1560,11 +1562,9 @@ m32r_sched_reorder (stream, verbose, ready, n_ready)
rtx insn = ready[i]; rtx insn = ready[i];
enum rtx_code code; enum rtx_code code;
if (GET_RTX_CLASS (GET_CODE (insn)) != 'i' if (! m32r_is_insn (insn))
|| (code = GET_CODE (PATTERN (insn))) == USE
|| code == CLOBBER || code == ADDR_VEC)
{ {
/* Dump all current short/long insns just in case */ /* Dump all current short/long insns just in case. */
while (long_head != long_tail) while (long_head != long_tail)
*new_tail-- = *long_head++; *new_tail-- = *long_head++;
...@@ -1619,9 +1619,8 @@ m32r_sched_reorder (stream, verbose, ready, n_ready) ...@@ -1619,9 +1619,8 @@ m32r_sched_reorder (stream, verbose, ready, n_ready)
enum rtx_code code; enum rtx_code code;
fprintf (stream, " %d", INSN_UID (ready[i])); fprintf (stream, " %d", INSN_UID (ready[i]));
if (GET_RTX_CLASS (GET_CODE (insn)) != 'i'
|| (code = GET_CODE (PATTERN (insn))) == USE if (! m32r_is_insn (insn))
|| code == CLOBBER || code == ADDR_VEC)
fputs ("(?)", stream); fputs ("(?)", stream);
else if (get_attr_insn_size (insn) != INSN_SIZE_SHORT) else if (get_attr_insn_size (insn) != INSN_SIZE_SHORT)
...@@ -1654,12 +1653,7 @@ m32r_sched_variable_issue (stream, verbose, insn, how_many) ...@@ -1654,12 +1653,7 @@ m32r_sched_variable_issue (stream, verbose, insn, how_many)
how_many--; how_many--;
if (how_many > 0 && !TARGET_DEBUG) if (how_many > 0 && !TARGET_DEBUG)
{ {
if (GET_RTX_CLASS (GET_CODE (insn)) != 'i') if (! m32r_is_insn (insn))
how_many++;
else if (GET_CODE (PATTERN (insn)) == USE
|| GET_CODE (PATTERN (insn)) == CLOBBER
|| GET_CODE (PATTERN (insn)) == ADDR_VEC)
how_many++; how_many++;
else if (get_attr_insn_size (insn) != INSN_SIZE_SHORT) else if (get_attr_insn_size (insn) != INSN_SIZE_SHORT)
......
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