Patchwork Hookize TARGET_CLASS_MAX_NREGS

login
register
mail settings
Submitter Anatoly Sokolov
Date July 12, 2011, 8:51 p.m.
Message ID <415382762.20110713005149@post.ru>
Download mbox | patch
Permalink /patch/104435/
State New
Headers show

Comments

Anatoly Sokolov - July 12, 2011, 8:51 p.m.
Hello.

  This patch turns TARGET_CLASS_MAX_NREGS macro into a hook.

  The patch has been bootstrapped on and regression tested on
x86_64-unknown-linux-gnu and  v850-unknown-elf for c.

  Changes for other platforms is obvious and similar changes in v850 target.

  This patch is pre-approved and should be committed within a week if no
objections.

        * target.def (class_max_nregs): New hook.
        * doc/tm.texi.in (TARGET_CLASS_MAX_NREGS): Document.
        * doc/tm.texi: Regenerate.
        * targhooks.c (default_class_max_nregs): New function.
        * targhooks.h (default_class_max_nregs): Declare.
        * ira.h (target_ira): Change type x_ira_reg_class_max_nregs and
        x_ira_reg_class_min_nregs arrays to unsigned char.
        * ira.c (setup_reg_class_nregs): Use TARGET_CLASS_MAX_NREGS target
        hook instead of CLASS_MAX_NREGS macro.
        * reginfo.c (restore_register_info): Ditto.
        * ira-conflicts.c (process_regs_for_copy): Use
        ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro.
        Change type rclass and aclass vars to reg_class_t.
        * ira-costs.c (record_reg_classes): Use ira_reg_class_max_nregs
        array instead of CLASS_MAX_NREGS macro. Change type rclass var to
        reg_class_t.
        * reload.c (combine_reloads, find_reloads, find_reloads_address_1):
        Use ira_reg_class_max_nregs array instead of CLASS_MAX_NREGS macro.

        * config/i386/i386.h (CLASS_MAX_NREGS): Remove.
        * config/i386/i386.c (ix86_class_max_nregs): New function.
        (ix86_register_move_cost): Use TARGET_CLASS_MAX_NREGS target hook
        instead of CLASS_MAX_NREGS macro.
        (TARGET_CLASS_MAX_NREGS): Define.
        * config/avr/avr.h (CLASS_MAX_NREGS): Remove.
        * config/avr/avr-protos.h (class_max_nregs): Remove declaration.
        * config/avr/avr.c (class_max_nregs): Remove function.
        * config/alpha/alpha.h (CLASS_MAX_NREGS): Remove.
        * config/spu/spu.h (CLASS_MAX_NREGS): Remove.
        * config/mep/mep.h (CLASS_MAX_NREGS): Remove.
        * config/m32r/m32r.h (CLASS_MAX_NREGS): Remove.
        * config/microblaze/microblaze.h (CLASS_MAX_NREGS): Remove.
        * config/xtensa/xtensa.h (CLASS_MAX_NREGS): Remove.
        * config/stormy16/stormy16.h (CLASS_MAX_NREGS): Remove.
        * config/lm32/lm32.h (CLASS_MAX_NREGS): Remove.
        * config/moxie/moxie.h (CLASS_MAX_NREGS): Remove.
        * config/iq2000/iq2000.h (CLASS_MAX_NREGS): Remove.
        * config/mn10300/mn10300.h (CLASS_MAX_NREGS): Remove.
        * config/score/score.h (CLASS_MAX_NREGS): Remove.
        * config/vax/vax.h (CLASS_MAX_NREGS): Remove.
        * config/h8300/h8300.h (CLASS_MAX_NREGS): Remove.
        * config/v850/v850.h (CLASS_MAX_NREGS): Remove.





Anatoly.

Patch

Index: gcc/doc/tm.texi
===================================================================
--- gcc/doc/tm.texi     (revision 176209)
+++ gcc/doc/tm.texi     (working copy)
@@ -2846,6 +2846,23 @@ 
 allocation.
 @end deftypefn
 
+@deftypefn {Target Hook} {unsigned char} TARGET_CLASS_MAX_NREGS (reg_class_t @var{rclass}, enum machine_mode @var{mode})
+A target hook returns the maximum number of consecutive registers
+of class @var{rclass} needed to hold a value of mode @var{mode}.
+
+This is closely related to the macro @code{HARD_REGNO_NREGS}.  In fact,
+the value returned by @code{TERGET_CLASS_MAX_NREGS (@var{rclass},
+@var{mode})} target hook should be the maximum value of
+@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}
+values in the class @var{rclass}.
+
+This target hook helps control the handling of multiple-word values
+in the reload pass.
+
+The default version of this target hook returns the size of @var{mode}
+in words.
+@end deftypefn
+
 @defmac CLASS_MAX_NREGS (@var{class}, @var{mode})
 A C expression for the maximum number of consecutive registers
 of class @var{class} needed to hold a value of mode @var{mode}.
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in  (revision 176209)
+++ gcc/doc/tm.texi.in  (working copy)
@@ -2832,6 +2832,23 @@ 
 allocation.
 @end deftypefn
 
+@hook TARGET_CLASS_MAX_NREGS
+A target hook returns the maximum number of consecutive registers
+of class @var{rclass} needed to hold a value of mode @var{mode}.
+
+This is closely related to the macro @code{HARD_REGNO_NREGS}.  In fact,
+the value returned by @code{TERGET_CLASS_MAX_NREGS (@var{rclass},
+@var{mode})} target hook should be the maximum value of
+@code{HARD_REGNO_NREGS (@var{regno}, @var{mode})} for all @var{regno}
+values in the class @var{rclass}.
+
+This target hook helps control the handling of multiple-word values
+in the reload pass.
+
+The default version of this target hook returns the size of @var{mode}
+in words.
+@end deftypefn
+
 @defmac CLASS_MAX_NREGS (@var{class}, @var{mode})
 A C expression for the maximum number of consecutive registers
 of class @var{class} needed to hold a value of mode @var{mode}.
Index: gcc/ira-conflicts.c
===================================================================
--- gcc/ira-conflicts.c	(revision 176209)
+++ gcc/ira-conflicts.c	(working copy)
@@ -393,7 +393,7 @@ 
   int allocno_preferenced_hard_regno, cost, index, offset1, offset2;
   bool only_regs_p;
   ira_allocno_t a;
-  enum reg_class rclass, aclass;
+  reg_class_t rclass, aclass;
   enum machine_mode mode;
   ira_copy_t cp;
 
@@ -438,7 +438,7 @@ 
   mode = ALLOCNO_MODE (a);
   aclass = ALLOCNO_CLASS (a);
   if (only_regs_p && insn != NULL_RTX
-      && reg_class_size[rclass] <= (unsigned) CLASS_MAX_NREGS (rclass, mode))
+      && reg_class_size[rclass] <= ira_reg_class_max_nregs [rclass][mode])
     /* It is already taken into account in ira-costs.c.  */
     return false;
   index = ira_class_hard_reg_index[aclass][allocno_preferenced_hard_regno];
Index: gcc/targhooks.c
===================================================================
--- gcc/targhooks.c     (revision 176209)
+++ gcc/targhooks.c     (working copy)
@@ -1309,6 +1309,19 @@ 
   return (reg_class_size[(int) rclass] == 1);
 }
 
+/* The default implementation of TARGET_CLASS_MAX_NREGS.  */
+
+unsigned char
+default_class_max_nregs (reg_class_t rclass ATTRIBUTE_UNUSED,
+                        enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+#ifdef CLASS_MAX_NREGS
+  return (unsigned char) CLASS_MAX_NREGS ((enum reg_class) rclass, mode);
+#else
+  return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
+#endif
+}
+
 /* Determine the debugging unwind mechanism for the target.  */
 
 enum unwind_info_type
Index: gcc/targhooks.h
===================================================================
--- gcc/targhooks.h     (revision 176209)
+++ gcc/targhooks.h     (working copy)
@@ -163,6 +163,7 @@ 
 extern reg_class_t default_preferred_output_reload_class (rtx, reg_class_t);
 extern reg_class_t default_preferred_rename_class (reg_class_t rclass);
 extern bool default_class_likely_spilled_p (reg_class_t);
+extern unsigned char default_class_max_nregs (reg_class_t, enum machine_mode);
 
 extern enum unwind_info_type default_debug_unwind_info (void);
 
Index: gcc/target.def
===================================================================
--- gcc/target.def      (revision 176209)
+++ gcc/target.def      (working copy)
@@ -2236,7 +2236,15 @@ 
  bool, (reg_class_t rclass),
  default_class_likely_spilled_p)
 
+/* Return the maximum number of consecutive registers
+   needed to represent mode MODE in a register of class RCLASS.  */
 DEFHOOK
+(class_max_nregs,
+ "",
+ unsigned char, (reg_class_t rclass, enum machine_mode mode),
+ default_class_max_nregs)
+
+DEFHOOK
 (preferred_rename_class,
  "A target hook that places additional preference on the register\
  class to use when it is necessary to rename a register in class\
Index: gcc/reload.c
===================================================================
--- gcc/reload.c        (revision 176209)
+++ gcc/reload.c        (working copy)
@@ -1767,9 +1767,9 @@ 
        && rld[i].when_needed != RELOAD_FOR_OUTPUT_ADDRESS
        && rld[i].when_needed != RELOAD_FOR_OUTADDR_ADDRESS
        && rld[i].when_needed != RELOAD_OTHER
-       && (CLASS_MAX_NREGS (rld[i].rclass, rld[i].inmode)
-           == CLASS_MAX_NREGS (rld[output_reload].rclass,
-                               rld[output_reload].outmode))
+       && (ira_reg_class_max_nregs [(int)rld[i].rclass][(int) rld[i].inmode]
+           == ira_reg_class_max_nregs [(int) rld[output_reload].rclass]
+                                      [(int) rld[output_reload].outmode])
        && rld[i].inc == 0
        && rld[i].reg_rtx == 0
 #ifdef SECONDARY_MEMORY_NEEDED
@@ -4542,7 +4542,7 @@ 
               > GET_MODE_SIZE (rld[i].inmode)))
          ? rld[i].outmode : rld[i].inmode;
 
-      rld[i].nregs = CLASS_MAX_NREGS (rld[i].rclass, rld[i].mode);
+      rld[i].nregs = ira_reg_class_max_nregs [rld[i].rclass][rld[i].mode];
     }
 
   /* Special case a simple move with an input reload and a
@@ -5991,8 +5991,8 @@ 
          else
            {
              enum reg_class rclass = context_reg_class;
-             if ((unsigned) CLASS_MAX_NREGS (rclass, GET_MODE (SUBREG_REG (x)))
-                 > reg_class_size[rclass])
+             if (ira_reg_class_max_nregs [rclass][GET_MODE (SUBREG_REG (x))]
+                 > reg_class_size[(int) rclass])
                {
                  x = find_reloads_subreg_address (x, 0, opnum,
                                                   ADDR_TYPE (type),
Index: gcc/ira.c
===================================================================
--- gcc/ira.c   (revision 176209)
+++ gcc/ira.c   (working copy)
@@ -1403,7 +1403,7 @@ 
       for (cl = 0; cl < N_REG_CLASSES; cl++)
        ira_reg_class_max_nregs[cl][m]
          = ira_reg_class_min_nregs[cl][m]
-         = CLASS_MAX_NREGS ((enum reg_class) cl, (enum machine_mode) m);
+         = targetm.class_max_nregs ((reg_class_t) cl, (enum machine_mode) m);
       for (cl = 0; cl < N_REG_CLASSES; cl++)
        for (i = 0;
             (cl2 = alloc_reg_class_subclasses[cl][i]) != LIM_REG_CLASSES;
Index: gcc/ira.h
===================================================================
--- gcc/ira.h   (revision 176209)
+++ gcc/ira.h   (working copy)
@@ -68,8 +68,8 @@ 
   /* Maps: register class x machine mode -> maximal/minimal number of
      hard registers of given class needed to store value of given
      mode.  */
-  int x_ira_reg_class_max_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
-  int x_ira_reg_class_min_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
+  unsigned char x_ira_reg_class_max_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
+  unsigned char x_ira_reg_class_min_nregs[N_REG_CLASSES][MAX_MACHINE_MODE];
 
   /* Array analogous to target hook TARGET_MEMORY_MOVE_COST.  */
   short x_ira_memory_move_cost[MAX_MACHINE_MODE][N_REG_CLASSES][2];
Index: gcc/ira-costs.c
===================================================================
--- gcc/ira-costs.c     (revision 176209)
+++ gcc/ira-costs.c     (working copy)
@@ -930,15 +930,15 @@ 
          enum machine_mode mode = GET_MODE (ops[!i]);
          cost_classes_t cost_classes_ptr = regno_cost_classes[regno];
          enum reg_class *cost_classes = cost_classes_ptr->classes;
-         enum reg_class rclass;
+         reg_class_t rclass;
          int nr;
 
          for (k = cost_classes_ptr->num - 1; k >= 0; k--)
            {
              rclass = cost_classes[k];
              if (TEST_HARD_REG_BIT (reg_class_contents[rclass], other_regno)
-                 && (reg_class_size[rclass]
-                     == (unsigned) CLASS_MAX_NREGS (rclass, mode)))
+                 && (reg_class_size[(int) rclass]
+                     == ira_reg_class_max_nregs [(int) rclass][(int) mode]))
                {
                  if (reg_class_size[rclass] == 1)
                    op_costs[i]->cost[k] = -frequency;
Index: gcc/reginfo.c
===================================================================
--- gcc/reginfo.c       (revision 176209)
+++ gcc/reginfo.c       (working copy)
@@ -529,8 +529,7 @@ 
          SET_HARD_REG_BIT (ok_regs, j);
 
       for (i = 0; i < N_REG_CLASSES; i++)
-       if (((unsigned) CLASS_MAX_NREGS ((enum reg_class) i,
-                                        (enum machine_mode) m)
+       if ((targetm.class_max_nregs ((reg_class_t) i, (enum machine_mode) m)
             <= reg_class_size[i])
            && hard_reg_set_intersect_p (ok_regs, reg_class_contents[i]))
          {
Index: gcc/config/alpha/alpha.h
===================================================================
--- gcc/config/alpha/alpha.h    (revision 176209)
+++ gcc/config/alpha/alpha.h    (working copy)
@@ -549,12 +549,6 @@ 
    : GET_MODE_SIZE (MODE) >= 4 ? (MODE)                        \
    : mode_for_size (BITS_PER_WORD, GET_MODE_CLASS (MODE), 0))
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-
-#define CLASS_MAX_NREGS(CLASS, MODE)                           \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Return the class of registers that cannot change mode from FROM to TO.  */
 
 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)              \
Index: gcc/config/spu/spu.h
===================================================================
--- gcc/config/spu/spu.h        (revision 176209)
+++ gcc/config/spu/spu.h        (working copy)
@@ -225,9 +225,6 @@ 
 #define INT_REG_OK_FOR_BASE_P(X,STRICT) \
        ((!(STRICT) || REGNO_OK_FOR_BASE_P (REGNO (X))))
 
-#define CLASS_MAX_NREGS(CLASS, MODE)   \
-       ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* GCC assumes that modes are in the lowpart of a register, which is
    only true for SPU. */
 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
Index: gcc/config/mep/mep.h
===================================================================
--- gcc/config/mep/mep.h        (revision 176209)
+++ gcc/config/mep/mep.h        (working copy)
@@ -428,9 +428,6 @@ 
 #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE) \
        mep_secondary_memory_needed (CLASS1, CLASS2, MODE)
 
-#define CLASS_MAX_NREGS(CLASS, MODE) \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #if 0
 #define CONST_OK_FOR_LETTER_P(VALUE, C) mep_const_ok_for_letter_p (VALUE, C)
 
Index: gcc/config/m32r/m32r.h
===================================================================
--- gcc/config/m32r/m32r.h      (revision 176209)
+++ gcc/config/m32r/m32r.h      (working copy)
@@ -509,11 +509,6 @@ 
 
 #define REGNO_OK_FOR_INDEX_P(REGNO) REGNO_OK_FOR_BASE_P(REGNO)
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Return true if a value is inside a range.  */
 #define IN_RANGE_P(VALUE, LOW, HIGH)                   \
   (((unsigned HOST_WIDE_INT)((VALUE) - (LOW)))         \
Index: gcc/config/i386/i386.h
===================================================================
--- gcc/config/i386/i386.h      (revision 176209)
+++ gcc/config/i386/i386.h      (working copy)
@@ -1358,19 +1358,6 @@ 
    ? mode_for_size (32, GET_MODE_CLASS (MODE), 0)              \
    : MODE)
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-/* On the 80386, this is the size of MODE in words,
-   except in the FP regs, where a single reg is always enough.  */
-#define CLASS_MAX_NREGS(CLASS, MODE)                                   \
-  (MAYBE_INTEGER_CLASS_P (CLASS)                                       \
-   ? ((MODE) == XFmode                                                 \
-      ? (TARGET_64BIT ? 2 : 3)                                         \
-      : (MODE) == XCmode                                               \
-      ? (TARGET_64BIT ? 4 : 6)                                         \
-      : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))        \
-   : (COMPLEX_MODE_P (MODE) ? 2 : 1))
-
 /* Return a class of registers that cannot change FROM mode to TO mode.  */
 
 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
Index: gcc/config/i386/i386.c
===================================================================
--- gcc/config/i386/i386.c      (revision 176209)
+++ gcc/config/i386/i386.c      (working copy)
@@ -28278,6 +28278,32 @@ 
   return inline_secondary_memory_needed (class1, class2, mode, strict);
 }
 
+/* Implement the TARGET_CLASS_MAX_NREGS hook.
+
+   On the 80386, this is the size of MODE in words,
+   except in the FP regs, where a single reg is always enough.  */
+
+static unsigned char
+ix86_class_max_nregs (reg_class_t rclass, enum machine_mode mode)
+{
+  if (MAYBE_INTEGER_CLASS_P (rclass))
+    {
+      if (mode == XFmode)
+       return (TARGET_64BIT ? 2 : 3);
+      else if (mode == XCmode)
+       return (TARGET_64BIT ? 4 : 6);
+      else
+       return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
+    }
+  else
+    {
+      if (COMPLEX_MODE_P (mode))
+       return 2;
+      else
+       return 1;
+    }
+}
+
 /* Return true if the registers in CLASS cannot represent the change from
    modes FROM to TO.  */
 
@@ -28474,7 +28500,8 @@ 
       /* In case of copying from general_purpose_register we may emit multiple
          stores followed by single load causing memory size mismatch stall.
          Count this as arbitrarily high cost of 20.  */
-      if (CLASS_MAX_NREGS (class1, mode) > CLASS_MAX_NREGS (class2, mode))
+      if (targetm.class_max_nregs (class1, mode)
+         > targetm.class_max_nregs (class2, mode))
        cost += 20;
 
       /* In the case of FP/MMX moves, the registers actually overlap, and we
@@ -34942,6 +34969,9 @@ 
 #undef TARGET_SECONDARY_RELOAD
 #define TARGET_SECONDARY_RELOAD ix86_secondary_reload
 
+#undef TARGET_CLASS_MAX_NREGS
+#define TARGET_CLASS_MAX_NREGS ix86_class_max_nregs
+
 #undef TARGET_PREFERRED_RELOAD_CLASS
 #define TARGET_PREFERRED_RELOAD_CLASS ix86_preferred_reload_class
 #undef TARGET_PREFERRED_OUTPUT_RELOAD_CLASS
Index: gcc/config/microblaze/microblaze.h
===================================================================
--- gcc/config/microblaze/microblaze.h  (revision 176209)
+++ gcc/config/microblaze/microblaze.h  (working copy)
@@ -388,9 +388,6 @@ 
 #define SECONDARY_MEMORY_NEEDED(CLASS1, CLASS2, MODE)                  \
   (GET_MODE_CLASS (MODE) == MODE_INT)
 
-#define CLASS_MAX_NREGS(CLASS, MODE)                                   \
-  ((GET_MODE_SIZE (MODE) + (UNITS_PER_WORD) - 1) / (UNITS_PER_WORD))
-
 /* Stack layout; function entry, exit and calling.  */
 
 #define STACK_GROWS_DOWNWARD
Index: gcc/config/avr/avr-protos.h
===================================================================
--- gcc/config/avr/avr-protos.h	(revision 176209)
+++ gcc/config/avr/avr-protos.h	(working copy)
@@ -110,10 +110,6 @@ 
 extern rtx avr_incoming_return_addr_rtx (void);
 #endif /* RTX_CODE */
 
-#ifdef HAVE_MACHINE_MODES
-extern int class_max_nregs (enum reg_class rclass, enum machine_mode mode);
-#endif /* HAVE_MACHINE_MODES */
-
 #ifdef REAL_VALUE_TYPE
 extern void asm_output_float (FILE *file, REAL_VALUE_TYPE n);
 #endif
Index: gcc/config/avr/avr.c
===================================================================
--- gcc/config/avr/avr.c        (revision 176209)
+++ gcc/config/avr/avr.c        (working copy)
@@ -1491,15 +1491,6 @@ 
     }
 }
 
-/* Return maximum number of consecutive registers of
-   class CLASS needed to hold a value of mode MODE.  */
-
-int
-class_max_nregs (enum reg_class rclass ATTRIBUTE_UNUSED,enum machine_mode mode)
-{
-  return ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD);
-}
-
 /* Choose mode for jump insn:
    1 - relative jump in range -63 <= x <= 62 ;
    2 - relative jump in range -2046 <= x <= 2045 ;
Index: gcc/config/avr/avr.h
===================================================================
--- gcc/config/avr/avr.h        (revision 176209)
+++ gcc/config/avr/avr.h        (working copy)
@@ -312,8 +312,6 @@ 
 
 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
 
-#define CLASS_MAX_NREGS(CLASS, MODE)   class_max_nregs (CLASS, MODE)
-
 #define STACK_PUSH_CODE POST_DEC
 
 #define STACK_GROWS_DOWNWARD
Index: gcc/config/xtensa/xtensa.h
===================================================================
--- gcc/config/xtensa/xtensa.h  (revision 176209)
+++ gcc/config/xtensa/xtensa.h  (working copy)
@@ -450,15 +450,6 @@ 
    the RTL, as either incoming or outgoing arguments.  */
 #define TARGET_SMALL_REGISTER_CLASSES_FOR_MODE_P hook_bool_mode_true
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-#define CLASS_UNITS(mode, size)                                                \
-  ((GET_MODE_SIZE (mode) + (size) - 1) / (size))
-
-#define CLASS_MAX_NREGS(CLASS, MODE)                                   \
-  (CLASS_UNITS (MODE, UNITS_PER_WORD))
-
-
 /* Stack layout; function entry, exit and calling.  */
 
 #define STACK_GROWS_DOWNWARD
Index: gcc/config/stormy16/stormy16.h
===================================================================
--- gcc/config/stormy16/stormy16.h      (revision 176209)
+++ gcc/config/stormy16/stormy16.h      (working copy)
@@ -227,9 +227,6 @@ 
 #define SECONDARY_RELOAD_CLASS(CLASS, MODE, X)                 \
   xstormy16_secondary_reload_class (CLASS, MODE, X)
 
-#define CLASS_MAX_NREGS(CLASS, MODE) \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 
 /* Basic Stack Layout.  */
 
Index: gcc/config/lm32/lm32.h
===================================================================
--- gcc/config/lm32/lm32.h      (revision 176209)
+++ gcc/config/lm32/lm32.h      (working copy)
@@ -202,9 +202,6 @@ 
 #define REGNO_REG_CLASS(REGNO) \
     (G_REG_P(REGNO) ? GENERAL_REGS : NO_REGS)
 
-#define CLASS_MAX_NREGS(CLASS, MODE) \
-    ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #define INDEX_REG_CLASS NO_REGS
 
 #define BASE_REG_CLASS GENERAL_REGS
Index: gcc/config/moxie/moxie.h
===================================================================
--- gcc/config/moxie/moxie.h    (revision 176209)
+++ gcc/config/moxie/moxie.h    (working copy)
@@ -189,11 +189,6 @@ 
    accessible in mode MODE2 without copying.  */
 #define MODES_TIEABLE_P(MODE1, MODE2) 1
 
-/* A C expression for the maximum number of consecutive registers of
-   class CLASS needed to hold a value of mode MODE.  */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* The Overall Framework of an Assembler File */
 
 #undef  ASM_SPEC
Index: gcc/config/iq2000/iq2000.h
===================================================================
--- gcc/config/iq2000/iq2000.h  (revision 176209)
+++ gcc/config/iq2000/iq2000.h  (working copy)
@@ -228,9 +228,6 @@ 
         ? (GR_REGS)                                            \
         : (CLASS))))
 
-#define CLASS_MAX_NREGS(CLASS, MODE)    \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 
 /* Basic Stack Layout.  */
 
Index: gcc/config/mn10300/mn10300.h
===================================================================
--- gcc/config/mn10300/mn10300.h        (revision 176209)
+++ gcc/config/mn10300/mn10300.h        (working copy)
@@ -388,12 +388,6 @@ 
 #define LIMIT_RELOAD_CLASS(MODE, CLASS) \
   (!TARGET_AM33 && (MODE == QImode || MODE == HImode) ? DATA_REGS : CLASS)
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-
-#define CLASS_MAX_NREGS(CLASS, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* A class that contains registers which the compiler must always
    access in a mode that is the same size as the mode in which it
    loaded the register.  */
Index: gcc/config/score/score.h
===================================================================
--- gcc/config/score/score.h    (revision 176209)
+++ gcc/config/score/score.h    (working copy)
@@ -418,11 +418,6 @@ 
 #define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
   score_secondary_reload_class (CLASS, MODE, X)
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-#define CLASS_MAX_NREGS(CLASS, MODE) \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS)    \
   (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO)        \
    ? reg_classes_intersect_p (HI_REG, (CLASS)) : 0)
Index: gcc/config/vax/vax.h
===================================================================
--- gcc/config/vax/vax.h        (revision 176209)
+++ gcc/config/vax/vax.h        (working copy)
@@ -219,11 +219,6 @@ 
 #define REG_CLASS_NAMES        \
   { "NO_REGS", "ALL_REGS" }
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-#define CLASS_MAX_NREGS(CLASS, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Define which registers fit in which classes.
    This is an initializer for a vector of HARD_REG_SET
    of length N_REG_CLASSES.  */
@@ -242,12 +237,6 @@ 
 #define INDEX_REG_CLASS ALL_REGS
 #define BASE_REG_CLASS ALL_REGS
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-/* On the VAX, this is always the size of MODE in words,
-   since all registers are the same size.  */
-#define CLASS_MAX_NREGS(CLASS, MODE)   \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
 
 /* Stack layout; function entry, exit and calling.  */
 
Index: gcc/config/h8300/h8300.h
===================================================================
--- gcc/config/h8300/h8300.h    (revision 176209)
+++ gcc/config/h8300/h8300.h    (working copy)
@@ -357,14 +357,6 @@ 
 #define INDEX_REG_CLASS (TARGET_H8300SX ? GENERAL_REGS : NO_REGS)
 #define BASE_REG_CLASS  GENERAL_REGS
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-
-/* On the H8, this is the size of MODE in words.  */
-
-#define CLASS_MAX_NREGS(CLASS, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Stack layout; function entry, exit and calling.  */
 
 /* Define this if pushing a word on the stack
Index: gcc/config/v850/v850.h
===================================================================
--- gcc/config/v850/v850.h      (revision 176209)
+++ gcc/config/v850/v850.h      (working copy)
@@ -341,12 +341,6 @@ 
 
 #define REGNO_OK_FOR_INDEX_P(regno) 0
 
-/* Return the maximum number of consecutive registers
-   needed to represent mode MODE in a register of class CLASS.  */
-
-#define CLASS_MAX_NREGS(CLASS, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Convenience wrappers around insn_const_int_ok_for_constraint.  */
 
 #define CONST_OK_FOR_I(VALUE) \