Commit 86460bab by Kaveh R. Ghazi Committed by Kaveh Ghazi

machmode.h (mode_name, [...]): Set array size in declaration to NUM_MACHINE_MODES.

	* machmode.h (mode_name, mode_class, mode_size, mode_unit_size,
	mode_bitsize, mode_mask_array, mode_wider_mode): Set array size in
	declaration to NUM_MACHINE_MODES.
	(mode_size, mode_unit_size): Set array type to unsigned char.
	(mode_bitsize): Set array type to unsigned short.

	* rtl.c (rtx_length): Set array type to unsigned char.
	(rtx_length, rtx_name, rtx_format, rtx_class): Set array size to
	NUM_RTX_CODE.
	(mode_bitsize): Set array type to unsigned short.
	(mode_size, mode_unit_size): Set array type to unsigned char.
	(mode_name, mode_class, mode_bitsize, mode_size, mode_unit_size,
	mode_wider_mode, mode_mask_array): Set array size to
	NUM_MACHINE_MODES.

	* rtl.h (rtx_length, rtx_name, rtx_format, rtx_class): Set array
	size in declaration to NUM_RTX_CODE.

From-SVN: r48139
parent 29b06e35
2001-12-17 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* machmode.h (mode_name, mode_class, mode_size, mode_unit_size,
mode_bitsize, mode_mask_array, mode_wider_mode): Set array size in
declaration to NUM_MACHINE_MODES.
(mode_size, mode_unit_size): Set array type to unsigned char.
(mode_bitsize): Set array type to unsigned short.
* rtl.c (rtx_length): Set array type to unsigned char.
(rtx_length, rtx_name, rtx_format, rtx_class): Set array size to
NUM_RTX_CODE.
(mode_bitsize): Set array type to unsigned short.
(mode_size, mode_unit_size): Set array type to unsigned char.
(mode_name, mode_class, mode_bitsize, mode_size, mode_unit_size,
mode_wider_mode, mode_mask_array): Set array size to
NUM_MACHINE_MODES.
* rtl.h (rtx_length, rtx_name, rtx_format, rtx_class): Set array
size in declaration to NUM_RTX_CODE.
2001-12-17 Richard Henderson <rth@redhat.com> 2001-12-17 Richard Henderson <rth@redhat.com>
* config/alpha/alpha.md (unop): Encode RB as $sp. * config/alpha/alpha.md (unop): Encode RB as $sp.
......
...@@ -38,7 +38,7 @@ MAX_MACHINE_MODE }; ...@@ -38,7 +38,7 @@ MAX_MACHINE_MODE };
/* Get the name of mode MODE as a string. */ /* Get the name of mode MODE as a string. */
extern const char * const mode_name[]; extern const char * const mode_name[NUM_MACHINE_MODES];
#define GET_MODE_NAME(MODE) (mode_name[(int) (MODE)]) #define GET_MODE_NAME(MODE) (mode_name[(int) (MODE)])
enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC, enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
...@@ -49,7 +49,7 @@ enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC, ...@@ -49,7 +49,7 @@ enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
/* Get the general kind of object that mode MODE represents /* Get the general kind of object that mode MODE represents
(integer, floating, complex, etc.) */ (integer, floating, complex, etc.) */
extern const enum mode_class mode_class[]; extern const enum mode_class mode_class[NUM_MACHINE_MODES];
#define GET_MODE_CLASS(MODE) (mode_class[(int) (MODE)]) #define GET_MODE_CLASS(MODE) (mode_class[(int) (MODE)])
/* Nonzero if MODE is an integral mode. */ /* Nonzero if MODE is an integral mode. */
...@@ -77,12 +77,12 @@ extern const enum mode_class mode_class[]; ...@@ -77,12 +77,12 @@ extern const enum mode_class mode_class[];
/* Get the size in bytes of an object of mode MODE. */ /* Get the size in bytes of an object of mode MODE. */
extern const unsigned int mode_size[]; extern const unsigned char mode_size[NUM_MACHINE_MODES];
#define GET_MODE_SIZE(MODE) (mode_size[(int) (MODE)]) #define GET_MODE_SIZE(MODE) (mode_size[(int) (MODE)])
/* Get the size in bytes of the basic parts of an object of mode MODE. */ /* Get the size in bytes of the basic parts of an object of mode MODE. */
extern const unsigned int mode_unit_size[]; extern const unsigned char mode_unit_size[NUM_MACHINE_MODES];
#define GET_MODE_UNIT_SIZE(MODE) (mode_unit_size[(int) (MODE)]) #define GET_MODE_UNIT_SIZE(MODE) (mode_unit_size[(int) (MODE)])
/* Get the number of units in the object. */ /* Get the number of units in the object. */
...@@ -93,7 +93,7 @@ extern const unsigned int mode_unit_size[]; ...@@ -93,7 +93,7 @@ extern const unsigned int mode_unit_size[];
/* Get the size in bits of an object of mode MODE. */ /* Get the size in bits of an object of mode MODE. */
extern const unsigned int mode_bitsize[]; extern const unsigned short mode_bitsize[NUM_MACHINE_MODES];
#define GET_MODE_BITSIZE(MODE) (mode_bitsize[(int) (MODE)]) #define GET_MODE_BITSIZE(MODE) (mode_bitsize[(int) (MODE)])
#endif /* not HAVE_MACHINE_MODES */ #endif /* not HAVE_MACHINE_MODES */
...@@ -103,7 +103,7 @@ extern const unsigned int mode_bitsize[]; ...@@ -103,7 +103,7 @@ extern const unsigned int mode_bitsize[];
/* Get a bitmask containing 1 for all bits in a word /* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */ that fit within mode MODE. */
extern const unsigned HOST_WIDE_INT mode_mask_array[]; extern const unsigned HOST_WIDE_INT mode_mask_array[NUM_MACHINE_MODES];
#define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)] #define GET_MODE_MASK(MODE) mode_mask_array[(int) (MODE)]
...@@ -114,7 +114,7 @@ extern const unsigned HOST_WIDE_INT mode_mask_array[]; ...@@ -114,7 +114,7 @@ extern const unsigned HOST_WIDE_INT mode_mask_array[];
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */ /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */
extern const unsigned char mode_wider_mode[]; extern const unsigned char mode_wider_mode[NUM_MACHINE_MODES];
#define GET_MODE_WIDER_MODE(MODE) ((enum machine_mode)mode_wider_mode[(int) (MODE)]) #define GET_MODE_WIDER_MODE(MODE) ((enum machine_mode)mode_wider_mode[(int) (MODE)])
/* Return the mode for data of a given size SIZE and mode class CLASS. /* Return the mode for data of a given size SIZE and mode class CLASS.
......
...@@ -96,7 +96,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -96,7 +96,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) sizeof FORMAT - 1 , #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) sizeof FORMAT - 1 ,
const int rtx_length[NUM_RTX_CODE + 1] = { const unsigned char rtx_length[NUM_RTX_CODE] = {
#include "rtl.def" #include "rtl.def"
}; };
...@@ -106,7 +106,7 @@ const int rtx_length[NUM_RTX_CODE + 1] = { ...@@ -106,7 +106,7 @@ const int rtx_length[NUM_RTX_CODE + 1] = {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME , #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) NAME ,
const char * const rtx_name[] = { const char * const rtx_name[NUM_RTX_CODE] = {
#include "rtl.def" /* rtl expressions are documented here */ #include "rtl.def" /* rtl expressions are documented here */
}; };
...@@ -117,7 +117,7 @@ const char * const rtx_name[] = { ...@@ -117,7 +117,7 @@ const char * const rtx_name[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) NAME, #define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) NAME,
const char * const mode_name[] = { const char * const mode_name[NUM_MACHINE_MODES] = {
#include "machmode.def" #include "machmode.def"
}; };
...@@ -127,7 +127,7 @@ const char * const mode_name[] = { ...@@ -127,7 +127,7 @@ const char * const mode_name[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) CLASS, #define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) CLASS,
const enum mode_class mode_class[] = { const enum mode_class mode_class[NUM_MACHINE_MODES] = {
#include "machmode.def" #include "machmode.def"
}; };
...@@ -138,7 +138,7 @@ const enum mode_class mode_class[] = { ...@@ -138,7 +138,7 @@ const enum mode_class mode_class[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) BITSIZE, #define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) BITSIZE,
const unsigned int mode_bitsize[] = { const unsigned short mode_bitsize[NUM_MACHINE_MODES] = {
#include "machmode.def" #include "machmode.def"
}; };
...@@ -149,7 +149,7 @@ const unsigned int mode_bitsize[] = { ...@@ -149,7 +149,7 @@ const unsigned int mode_bitsize[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) SIZE, #define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) SIZE,
const unsigned int mode_size[] = { const unsigned char mode_size[NUM_MACHINE_MODES] = {
#include "machmode.def" #include "machmode.def"
}; };
...@@ -160,7 +160,7 @@ const unsigned int mode_size[] = { ...@@ -160,7 +160,7 @@ const unsigned int mode_size[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) UNIT, #define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) UNIT,
const unsigned int mode_unit_size[] = { const unsigned char mode_unit_size[NUM_MACHINE_MODES] = {
#include "machmode.def" /* machine modes are documented here */ #include "machmode.def" /* machine modes are documented here */
}; };
...@@ -173,7 +173,7 @@ const unsigned int mode_unit_size[] = { ...@@ -173,7 +173,7 @@ const unsigned int mode_unit_size[] = {
#define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) \ #define DEF_MACHMODE(SYM, NAME, CLASS, BITSIZE, SIZE, UNIT, WIDER) \
(unsigned char) WIDER, (unsigned char) WIDER,
const unsigned char mode_wider_mode[] = { const unsigned char mode_wider_mode[NUM_MACHINE_MODES] = {
#include "machmode.def" /* machine modes are documented here */ #include "machmode.def" /* machine modes are documented here */
}; };
...@@ -184,7 +184,7 @@ const unsigned char mode_wider_mode[] = { ...@@ -184,7 +184,7 @@ const unsigned char mode_wider_mode[] = {
/* Indexed by machine mode, gives mask of significant bits in mode. */ /* Indexed by machine mode, gives mask of significant bits in mode. */
const unsigned HOST_WIDE_INT mode_mask_array[] = { const unsigned HOST_WIDE_INT mode_mask_array[NUM_MACHINE_MODES] = {
#include "machmode.def" #include "machmode.def"
}; };
...@@ -214,7 +214,7 @@ const enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS] = { ...@@ -214,7 +214,7 @@ const enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS] = {
rtx's of that code. The sequence is a C string in which rtx's of that code. The sequence is a C string in which
each character describes one operand. */ each character describes one operand. */
const char * const rtx_format[] = { const char * const rtx_format[NUM_RTX_CODE] = {
/* "*" undefined. /* "*" undefined.
can cause a warning message can cause a warning message
"0" field is unused (or used in a phase-dependent manner) "0" field is unused (or used in a phase-dependent manner)
...@@ -249,7 +249,7 @@ const char * const rtx_format[] = { ...@@ -249,7 +249,7 @@ const char * const rtx_format[] = {
/* Indexed by rtx code, gives a character representing the "class" of /* Indexed by rtx code, gives a character representing the "class" of
that rtx code. See rtl.def for documentation on the defined classes. */ that rtx code. See rtl.def for documentation on the defined classes. */
const char rtx_class[] = { const char rtx_class[NUM_RTX_CODE] = {
#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) CLASS, #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) CLASS,
#include "rtl.def" /* rtl expressions are defined here */ #include "rtl.def" /* rtl expressions are defined here */
#undef DEF_RTL_EXPR #undef DEF_RTL_EXPR
......
...@@ -51,16 +51,16 @@ enum rtx_code { ...@@ -51,16 +51,16 @@ enum rtx_code {
#define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE) #define NUM_RTX_CODE ((int)LAST_AND_UNUSED_RTX_CODE)
/* The cast here, saves many elsewhere. */ /* The cast here, saves many elsewhere. */
extern const int rtx_length[]; extern const unsigned char rtx_length[NUM_RTX_CODE];
#define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)]) #define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
extern const char * const rtx_name[]; extern const char * const rtx_name[NUM_RTX_CODE];
#define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)]) #define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
extern const char * const rtx_format[]; extern const char * const rtx_format[NUM_RTX_CODE];
#define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)]) #define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
extern const char rtx_class[]; extern const char rtx_class[NUM_RTX_CODE];
#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)]) #define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
/* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label /* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label
......
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