aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazu Hirata <kazu@cs.umass.edu>2002-09-27 12:37:15 +0000
committerKazu Hirata <kazu@gcc.gnu.org>2002-09-27 12:37:15 +0000
commitb9b575e6b5d26806b2d45c1d5c392fa2c2734de2 (patch)
treebf4f7ad9f03820a7a6d8029d981ed7a42aace0d8
parent87b8359e65be50ee79b2ededa72fe0eb592d625f (diff)
downloadgcc-b9b575e6b5d26806b2d45c1d5c392fa2c2734de2.zip
gcc-b9b575e6b5d26806b2d45c1d5c392fa2c2734de2.tar.gz
gcc-b9b575e6b5d26806b2d45c1d5c392fa2c2734de2.tar.bz2
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
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/h8300/h8300.c31
2 files changed, 20 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3fb28e5..997e37e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
PR optimization/7335
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 2d3c3f4..0f276de 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -444,7 +444,7 @@ compute_saved_regs ()
int regno;
/* 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))
saved_regs |= 1 << regno;
@@ -2401,37 +2401,32 @@ get_shift_alg (shift_type, shift_mode, count, info)
unsigned int count;
struct shift_info *info;
{
- int cpu;
+ enum h8_cpu cpu;
/* Find the target CPU. */
if (TARGET_H8300)
- cpu = 0;
+ cpu = H8_300;
else if (TARGET_H8300H)
- cpu = 1;
+ cpu = H8_300H;
else
- cpu = 2;
+ cpu = H8_S;
/* Find the shift algorithm. */
+ info->alg = SHIFT_LOOP;
switch (shift_mode)
{
case QIshift:
- if (GET_MODE_BITSIZE (QImode) <= count)
- info->alg = SHIFT_LOOP;
- else
+ if (count < GET_MODE_BITSIZE (QImode))
info->alg = shift_alg_qi[cpu][shift_type][count];
break;
case HIshift:
- if (GET_MODE_BITSIZE (HImode) <= count)
- info->alg = SHIFT_LOOP;
- else
+ if (count < GET_MODE_BITSIZE (HImode))
info->alg = shift_alg_hi[cpu][shift_type][count];
break;
case SIshift:
- if (GET_MODE_BITSIZE (SImode) <= count)
- info->alg = SHIFT_LOOP;
- else
+ if (count < GET_MODE_BITSIZE (SImode))
info->alg = shift_alg_si[cpu][shift_type][count];
break;
@@ -2773,7 +2768,7 @@ h8300_shift_needs_scratch_p (count, mode)
int count;
enum machine_mode mode;
{
- int cpu;
+ enum h8_cpu cpu;
int a, lr, ar;
if (GET_MODE_BITSIZE (mode) <= count)
@@ -2781,11 +2776,11 @@ h8300_shift_needs_scratch_p (count, mode)
/* Find out the target CPU. */
if (TARGET_H8300)
- cpu = 0;
+ cpu = H8_300;
else if (TARGET_H8300H)
- cpu = 1;
+ cpu = H8_300H;
else
- cpu = 2;
+ cpu = H8_S;
/* Find the shift algorithm. */
switch (mode)