summaryrefslogtreecommitdiffstats
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-10 20:33:07 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-10 20:33:07 +0000
commit47a2c1d448f2578c0d9d1bd6be4a17e95d279870 (patch)
treef9be992652ecd68b01a301007bfe03ceccd94dc6 /gcc/machmode.h
parent18ee3f27ba9cc3c48b390db1d052618c0f393513 (diff)
downloadppe42-gcc-47a2c1d448f2578c0d9d1bd6be4a17e95d279870.tar.gz
ppe42-gcc-47a2c1d448f2578c0d9d1bd6be4a17e95d279870.zip
* genmodes.c, mode-classes.def: New files.
* machmode.def: Rewritten to genmodes.c interface. * Makefile.in (extra_modes_file): New substitution variable. (MACHMODE_H): No longer includes machmode.def or @extra_modes_file@; instead, mode-classes.def and insn-modes.h. (BUILD_RTL): Add $(BUILD_PREFIX)insn-modes.o. (OBJS-common): Add insn-modes.o. (STAGESTUFF): Add insn-modes.c, insn-modes.h, s-modes, and genmodes$(build_exeext). (insn-modes.o, insn-modes.c, insn-modes.h, s-modes, genmodes.o, genmodes$(build_exeext), $(BUILD_PREFIX_1)insn-modes.o): New targets. (s-genrtl): Don't depend on $(RTL_BASE_H). (gengenrtl.o): Don't depend on coretypes.h, $(GTM_H), real.h, or $(RTL_BASE_H); just rtl.def. * gengenrtl.c: Don't include coretypes.h, tm.h, rtl.h, or real.h. Give fake definition of CONST_DOUBLE_FORMAT and substitute definition of NUM_RTX_CODE. Add casts to avoid warnings. * machmode.h: Include insn-modes.h, not machmode.def. Include mode-classes.def to define enum mode_class. Tweak definitions of GET_MODE_CLASS, GET_MODE_SIZE, GET_MODE_BITSIZE, GET_MODE_MASK, GET_MODE_INNER, GET_MODE_WIDER_MODE, GET_CLASS_NARROWEST_MODE. (inner_mode_array): Renamed mode_inner. (mode_base_align): New. * rtl.c (mode_name, mode_class, mode_bitsize, mode_size, mode_unit_size, mode_wider_mode, mode_mask_array, inner_mode_array, class_narrowest_mode): Delete definitions. * stor-layout.c (get_mode_alignment): Use mode_base_align. * real.h: Use MIN_MODE_FLOAT and MAX_MODE_FLOAT, not QFmode and TFmode, in real_format_for_mode and REAL_MODE_FORMAT. * config/ip2k/ip2k.h, config/iq2000/iq2000.h: No need to define BITS_PER_UNIT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72313 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r--gcc/machmode.h52
1 files changed, 23 insertions, 29 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h
index fbb48505e86..4c4086c312d 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -23,34 +23,26 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define HAVE_MACHINE_MODES
/* Make an enum class that gives all the machine modes. */
-
-#define DEF_MACHMODE(SYM, NAME, TYPE, BITSIZE, SIZE, UNIT, WIDER, INNER) SYM,
-
-enum machine_mode {
-#include "machmode.def"
-MAX_MACHINE_MODE };
-
-#undef DEF_MACHMODE
-
-#ifndef NUM_MACHINE_MODES
-#define NUM_MACHINE_MODES (int) MAX_MACHINE_MODE
-#endif
+#include "insn-modes.h"
/* Get the name of mode MODE as a string. */
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[MODE]
+
+/* Mode classes. */
-enum mode_class { MODE_RANDOM, MODE_INT, MODE_FLOAT, MODE_PARTIAL_INT, MODE_CC,
- MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT,
- MODE_VECTOR_INT, MODE_VECTOR_FLOAT,
- MAX_MODE_CLASS};
+#include "mode-classes.def"
+#define DEF_MODE_CLASS(M) M
+enum mode_class { MODE_CLASSES, MAX_MODE_CLASS };
+#undef DEF_MODE_CLASS
+#undef MODE_CLASSES
/* Get the general kind of object that mode MODE represents
(integer, floating, complex, etc.) */
-extern const enum mode_class mode_class[NUM_MACHINE_MODES];
-#define GET_MODE_CLASS(MODE) (mode_class[(int) (MODE)])
+extern const unsigned char mode_class[NUM_MACHINE_MODES];
+#define GET_MODE_CLASS(MODE) mode_class[MODE]
/* Nonzero if MODE is an integral mode. */
#define INTEGRAL_MODE_P(MODE) \
@@ -87,12 +79,12 @@ extern const enum mode_class mode_class[NUM_MACHINE_MODES];
/* Get the size in bytes of an object of mode MODE. */
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[MODE]
/* Get the size in bytes of the basic parts of an object of mode MODE. */
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[MODE]
/* Get the number of units in the object. */
@@ -103,7 +95,7 @@ extern const unsigned char mode_unit_size[NUM_MACHINE_MODES];
/* Get the size in bits of an object of mode MODE. */
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[MODE]
#endif /* not HAVE_MACHINE_MODES */
@@ -114,13 +106,13 @@ extern const unsigned short mode_bitsize[NUM_MACHINE_MODES];
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[MODE]
-extern const enum machine_mode inner_mode_array[NUM_MACHINE_MODES];
+extern const unsigned char mode_inner[NUM_MACHINE_MODES];
/* Return the mode of the inner elements in a vector. */
-#define GET_MODE_INNER(MODE) inner_mode_array[(int) (MODE)]
+#define GET_MODE_INNER(MODE) mode_inner[MODE]
#endif /* defined (HOST_WIDE_INT) && ! defined GET_MODE_MASK */
@@ -129,8 +121,8 @@ extern const enum machine_mode inner_mode_array[NUM_MACHINE_MODES];
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */
-extern const unsigned char mode_wider_mode[NUM_MACHINE_MODES];
-#define GET_MODE_WIDER_MODE(MODE) ((enum machine_mode)mode_wider_mode[(int) (MODE)])
+extern const unsigned char mode_wider[NUM_MACHINE_MODES];
+#define GET_MODE_WIDER_MODE(MODE) mode_wider[MODE]
/* Return the mode for data of a given size SIZE and mode class CLASS.
If LIMIT is nonzero, then don't use modes bigger than MAX_FIXED_MODE_SIZE.
@@ -156,14 +148,16 @@ extern enum machine_mode get_best_mode (int, int, unsigned int,
/* Determine alignment, 1<=result<=BIGGEST_ALIGNMENT. */
+extern const unsigned char mode_base_align[NUM_MACHINE_MODES];
+
extern unsigned get_mode_alignment (enum machine_mode);
#define GET_MODE_ALIGNMENT(MODE) get_mode_alignment (MODE)
/* For each class, get the narrowest mode in that class. */
-extern const enum machine_mode class_narrowest_mode[(int) MAX_MODE_CLASS];
-#define GET_CLASS_NARROWEST_MODE(CLASS) class_narrowest_mode[(int) (CLASS)]
+extern const unsigned char class_narrowest_mode[MAX_MODE_CLASS];
+#define GET_CLASS_NARROWEST_MODE(CLASS) class_narrowest_mode[CLASS]
/* Define the integer modes whose sizes are BITS_PER_UNIT and BITS_PER_WORD
and the mode whose class is Pmode and whose size is POINTER_SIZE. */
OpenPOWER on IntegriCloud