This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Provide a default definition for HARD_REGNO_NREGS.


Hi,

Attached is a patch to provide a default definition for
HARD_REGNO_NREGS.

Built avr-elf and mn10300-elf.  OK to apply?

Kazu Hirata

2004-03-07  Kazu Hirata  <kazu@cs.umass.edu>

	* defaults.h (HARD_REGNO_NREGS): Provide a default definition.
	* config/alpha/alpha.h, config/arc/arc.h, config/avr/avr.h,
	config/fr30/fr30.h, config/i860/i860.h, config/ip2k/ip2k.h,
	config/iq2000/iq2000.h, config/mcore/mcore.h,
	config/mmix/mmix.h, config/mn10300/mn10300.h,
	config/stormy16/stormy16.h, config/v850/v850.h,
	config/vax/vax.h (HARD_REGNO_NREGS): Remove.
	* doc/tm.texi (HARD_REGNO_NREGS): Mention the default
	definition.

Index: defaults.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/defaults.h,v
retrieving revision 1.130
diff -u -r1.130 defaults.h
--- defaults.h	7 Mar 2004 20:23:26 -0000	1.130
+++ defaults.h	7 Mar 2004 20:30:41 -0000
@@ -707,4 +707,7 @@
 #define LEGITIMIZE_ADDRESS(X, OLDX, MODE, WIN)
 #endif
 
+#define HARD_REGNO_NREGS(REGNO, MODE)   \
+  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
+
 #endif  /* ! GCC_DEFAULTS_H */
Index: config/alpha/alpha.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.h,v
retrieving revision 1.217
diff -u -r1.217 alpha.h
--- config/alpha/alpha.h	6 Mar 2004 18:48:51 -0000	1.217
+++ config/alpha/alpha.h	7 Mar 2004 20:30:43 -0000
@@ -626,14 +626,6 @@
    29, 30, 31, 63		/* gp, sp, ap, sfp */			\
 }
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.  */
-
-#define HARD_REGNO_NREGS(REGNO, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
    On Alpha, the integer registers can hold any mode.  The floating-point
    registers can hold 64-bit integers as well, but not smaller values.  */
Index: config/arc/arc.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arc/arc.h,v
retrieving revision 1.74
diff -u -r1.74 arc.h
--- config/arc/arc.h	7 Mar 2004 20:23:27 -0000	1.74
+++ config/arc/arc.h	7 Mar 2004 20:30:44 -0000
@@ -362,13 +362,6 @@
     }							\
 } while (0)
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.  */
-#define HARD_REGNO_NREGS(REGNO, MODE) \
-((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.  */
 extern const unsigned int arc_hard_regno_mode_ok[];
 extern unsigned int arc_mode_class[];
Index: config/avr/avr.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.102
diff -u -r1.102 avr.h
--- config/avr/avr.h	7 Feb 2004 17:06:19 -0000	1.102
+++ config/avr/avr.h	7 Mar 2004 20:30:45 -0000
@@ -214,8 +214,6 @@
 #define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
 
 
-#define HARD_REGNO_NREGS(REGNO, MODE) ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #define HARD_REGNO_MODE_OK(REGNO, MODE) avr_hard_regno_mode_ok(REGNO, MODE)
 
 #define MODES_TIEABLE_P(MODE1, MODE2) 0
Index: config/fr30/fr30.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/fr30/fr30.h,v
retrieving revision 1.54
diff -u -r1.54 fr30.h
--- config/fr30/fr30.h	7 Mar 2004 20:23:28 -0000	1.54
+++ config/fr30/fr30.h	7 Mar 2004 20:30:45 -0000
@@ -254,12 +254,6 @@
 /*}}}*/ 
 /*{{{  How Values Fit in Registers.  */ 
 
-/* A C expression for the number of consecutive hard registers, starting at
-   register number REGNO, required to hold a value of mode MODE.  */
-
-#define HARD_REGNO_NREGS(REGNO, MODE) 			\
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* A C expression that is nonzero if it is permissible to store a value of mode
    MODE in hard register number REGNO (or in several registers starting with
    that one).  */
Index: config/i860/i860.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i860/i860.h,v
retrieving revision 1.43
diff -u -r1.43 i860.h
--- config/i860/i860.h	19 Feb 2004 10:56:57 -0000	1.43
+++ config/i860/i860.h	7 Mar 2004 20:30:46 -0000
@@ -177,15 +177,6 @@
   47, 46, 45, 44, 43, 42, 41, 40,	\
   39, 38, 37, 36, 35, 34, 33, 32}
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.
-
-   On the i860, all registers hold 32 bits worth.  */
-#define HARD_REGNO_NREGS(REGNO, MODE)   \
-  (((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
-
 #define REGNO_MODE_ALIGNED(REGNO, MODE) \
   (((REGNO) % ((GET_MODE_UNIT_SIZE (MODE) + 3) / 4)) == 0)
 
Index: config/ip2k/ip2k.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ip2k/ip2k.h,v
retrieving revision 1.38
diff -u -r1.38 ip2k.h
--- config/ip2k/ip2k.h	23 Feb 2004 14:10:58 -0000	1.38
+++ config/ip2k/ip2k.h	7 Mar 2004 20:30:47 -0000
@@ -234,9 +234,6 @@
     : ((REG) == REG_IPH) ? ((NREG) == REG_DPH)			\
     : (((NREG) == REG_IPL) || ((NREG) == REG_DPL)) ? 0 : 1)
 
-#define HARD_REGNO_NREGS(REGNO, MODE) \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
 
 #define MODES_TIEABLE_P(MODE1, MODE2)		\
Index: config/iq2000/iq2000.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/iq2000/iq2000.h,v
retrieving revision 1.13
diff -u -r1.13 iq2000.h
--- config/iq2000/iq2000.h	19 Feb 2004 10:56:57 -0000	1.13
+++ config/iq2000/iq2000.h	7 Mar 2004 20:30:47 -0000
@@ -226,9 +226,6 @@
 
 /* How Values Fit in Registers.  */
 
-#define HARD_REGNO_NREGS(REGNO, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #define HARD_REGNO_MODE_OK(REGNO, MODE) 			\
  ((REGNO_REG_CLASS (REGNO) == GR_REGS)				\
   ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4     	\
Index: config/mcore/mcore.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mcore/mcore.h,v
retrieving revision 1.62
diff -u -r1.62 mcore.h
--- config/mcore/mcore.h	7 Mar 2004 20:23:29 -0000	1.62
+++ config/mcore/mcore.h	7 Mar 2004 20:30:48 -0000
@@ -373,15 +373,6 @@
  /* r7  r6  r5  r4  r3  r2  r15 r14 r13 r12 r11 r10  r9  r8  r1  r0  ap  c   fp x19*/ \
   {  7,  6,  5,  4,  3,  2,  15, 14, 13, 12, 11, 10,  9,  8,  1,  0, 16, 17, 18, 19}
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.
-
-   On the MCore regs are UNITS_PER_WORD bits wide; */
-#define HARD_REGNO_NREGS(REGNO, MODE)  \
-   (((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
-
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
    We may keep double values in even registers.  */
 #define HARD_REGNO_MODE_OK(REGNO, MODE)  \
Index: config/mmix/mmix.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.h,v
retrieving revision 1.62
diff -u -r1.62 mmix.h
--- config/mmix/mmix.h	7 Mar 2004 20:23:30 -0000	1.62
+++ config/mmix/mmix.h	7 Mar 2004 20:30:49 -0000
@@ -535,10 +535,6 @@
 
 /* Node: Values in Registers */
 
-#define HARD_REGNO_NREGS(REGNO, MODE)            	\
-   ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1)  	\
-    / UNITS_PER_WORD)
-
 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
 
 /* Note that no register can really be accessed in single-float mode, so
Index: config/mn10300/mn10300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mn10300/mn10300.h,v
retrieving revision 1.79
diff -u -r1.79 mn10300.h
--- config/mn10300/mn10300.h	6 Feb 2004 06:18:32 -0000	1.79
+++ config/mn10300/mn10300.h	7 Mar 2004 20:30:50 -0000
@@ -218,15 +218,6 @@
     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;	\
 }
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.  */
-
-#define HARD_REGNO_NREGS(REGNO, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Value is 1 if hard register REGNO can hold a value of machine-mode
    MODE.  */
 
Index: config/stormy16/stormy16.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/stormy16/stormy16.h,v
retrieving revision 1.87
diff -u -r1.87 stormy16.h
--- config/stormy16/stormy16.h	7 Mar 2004 20:23:31 -0000	1.87
+++ config/stormy16/stormy16.h	7 Mar 2004 20:30:52 -0000
@@ -170,9 +170,6 @@
 
 /* How Values Fit in Registers */
 
-#define HARD_REGNO_NREGS(REGNO, MODE) 				\
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 #define HARD_REGNO_MODE_OK(REGNO, MODE) ((REGNO) != 16 || (MODE) == BImode)
 
 /* A C expression that is nonzero if it is desirable to choose register
Index: config/v850/v850.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.h,v
retrieving revision 1.95
diff -u -r1.95 v850.h
--- config/v850/v850.h	7 Mar 2004 20:23:31 -0000	1.95
+++ config/v850/v850.h	7 Mar 2004 20:30:53 -0000
@@ -411,15 +411,6 @@
     }                                                   \
 }
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.  */
-
-#define HARD_REGNO_NREGS(REGNO, MODE)   \
-  ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Value is 1 if hard register REGNO can hold a value of machine-mode
    MODE.  */
 
Index: config/vax/vax.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/vax/vax.h,v
retrieving revision 1.68
diff -u -r1.68 vax.h
--- config/vax/vax.h	7 Mar 2004 20:23:32 -0000	1.68
+++ config/vax/vax.h	7 Mar 2004 20:30:53 -0000
@@ -186,14 +186,6 @@
    Aside from that, you can include as many other registers as you like.  */
 #define CALL_USED_REGISTERS {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1}
 
-/* Return number of consecutive hard regs needed starting at reg REGNO
-   to hold something of mode MODE.
-   This is ordinarily the length in words of a value of mode MODE
-   but can be less for certain modes in special long registers.
-   On the VAX, all registers are one word long.  */
-#define HARD_REGNO_NREGS(REGNO, MODE)   \
- ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-
 /* Value is 1 if hard register REGNO can hold a value of machine-mode MODE.
    On the VAX, all registers can hold all modes.  */
 #define HARD_REGNO_MODE_OK(REGNO, MODE) 1
Index: doc/tm.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.311
diff -u -r1.311 tm.texi
--- doc/tm.texi	7 Mar 2004 20:23:32 -0000	1.311
+++ doc/tm.texi	7 Mar 2004 20:31:00 -0000
@@ -2001,8 +2001,8 @@
 at register number @var{regno}, required to hold a value of mode
 @var{mode}.
 
-On a machine where all registers are exactly one word, a suitable
-definition of this macro is
+On a machine where all registers are exactly one word, the default
+definition should work, which is
 
 @smallexample
 #define HARD_REGNO_NREGS(REGNO, MODE)            \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]