Commit b9b575e6 by Kazu Hirata Committed by Kazu Hirata

h8300.c (compute_saved_regs): Use a macro instead of a hard register number.

	* config/h8300/h8300.c (compute_saved_regs): Use a macro
	instead of a hard register number.
	(get_shift_alg): Use an enumerated type instead of numbers.
	(h8300_shift_needs_scratch_p): Likewise.

From-SVN: r57586
parent 87b8359e
2002-09-27 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300.c (compute_saved_regs): Use a macro
instead of a hard register number.
(get_shift_alg): Use an enumerated type instead of numbers.
(h8300_shift_needs_scratch_p): Likewise.
2002-09-26 David S. Miller <davem@redhat.com> 2002-09-26 David S. Miller <davem@redhat.com>
PR optimization/7335 PR optimization/7335
......
...@@ -444,7 +444,7 @@ compute_saved_regs () ...@@ -444,7 +444,7 @@ compute_saved_regs ()
int regno; int regno;
/* Construct a bit vector of registers to be pushed/popped. */ /* Construct a bit vector of registers to be pushed/popped. */
for (regno = 0; regno <= 6; regno++) for (regno = 0; regno <= FRAME_POINTER_REGNUM; regno++)
{ {
if (WORD_REG_USED (regno)) if (WORD_REG_USED (regno))
saved_regs |= 1 << regno; saved_regs |= 1 << regno;
...@@ -2401,37 +2401,32 @@ get_shift_alg (shift_type, shift_mode, count, info) ...@@ -2401,37 +2401,32 @@ get_shift_alg (shift_type, shift_mode, count, info)
unsigned int count; unsigned int count;
struct shift_info *info; struct shift_info *info;
{ {
int cpu; enum h8_cpu cpu;
/* Find the target CPU. */ /* Find the target CPU. */
if (TARGET_H8300) if (TARGET_H8300)
cpu = 0; cpu = H8_300;
else if (TARGET_H8300H) else if (TARGET_H8300H)
cpu = 1; cpu = H8_300H;
else else
cpu = 2; cpu = H8_S;
/* Find the shift algorithm. */ /* Find the shift algorithm. */
info->alg = SHIFT_LOOP;
switch (shift_mode) switch (shift_mode)
{ {
case QIshift: case QIshift:
if (GET_MODE_BITSIZE (QImode) <= count) if (count < GET_MODE_BITSIZE (QImode))
info->alg = SHIFT_LOOP;
else
info->alg = shift_alg_qi[cpu][shift_type][count]; info->alg = shift_alg_qi[cpu][shift_type][count];
break; break;
case HIshift: case HIshift:
if (GET_MODE_BITSIZE (HImode) <= count) if (count < GET_MODE_BITSIZE (HImode))
info->alg = SHIFT_LOOP;
else
info->alg = shift_alg_hi[cpu][shift_type][count]; info->alg = shift_alg_hi[cpu][shift_type][count];
break; break;
case SIshift: case SIshift:
if (GET_MODE_BITSIZE (SImode) <= count) if (count < GET_MODE_BITSIZE (SImode))
info->alg = SHIFT_LOOP;
else
info->alg = shift_alg_si[cpu][shift_type][count]; info->alg = shift_alg_si[cpu][shift_type][count];
break; break;
...@@ -2773,7 +2768,7 @@ h8300_shift_needs_scratch_p (count, mode) ...@@ -2773,7 +2768,7 @@ h8300_shift_needs_scratch_p (count, mode)
int count; int count;
enum machine_mode mode; enum machine_mode mode;
{ {
int cpu; enum h8_cpu cpu;
int a, lr, ar; int a, lr, ar;
if (GET_MODE_BITSIZE (mode) <= count) if (GET_MODE_BITSIZE (mode) <= count)
...@@ -2781,11 +2776,11 @@ h8300_shift_needs_scratch_p (count, mode) ...@@ -2781,11 +2776,11 @@ h8300_shift_needs_scratch_p (count, mode)
/* Find out the target CPU. */ /* Find out the target CPU. */
if (TARGET_H8300) if (TARGET_H8300)
cpu = 0; cpu = H8_300;
else if (TARGET_H8300H) else if (TARGET_H8300H)
cpu = 1; cpu = H8_300H;
else else
cpu = 2; cpu = H8_S;
/* Find the shift algorithm. */ /* Find the shift algorithm. */
switch (mode) switch (mode)
......
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