summaryrefslogtreecommitdiff
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 12:49:49 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 12:49:49 +0000
commite2ec52cad85e7fdd83aa32fbff941d42eeebbd8a (patch)
tree4c749de5dc4a776f1ab9f29f46405e370f12efcc /gcc/machmode.h
parent65b0537f9e9741318f7c8e738b6dd3b8f82f58b5 (diff)
downloadgcc-e2ec52cad85e7fdd83aa32fbff941d42eeebbd8a.tar.gz
* genmodes.c (struct mode_data): Add need_bytesize_adj field.
(blank_mode): Initialize it. (emit_mode_size_inline, emit_mode_nunits_inline, emit_mode_inner_inline): New functions. (emit_insn_modes_h): Call them and surround their output with #if GCC_VERSION >= 4001 ... #endif. * machmode.h (GET_MODE_SIZE, GET_MODE_NUNITS, GET_MODE_INNER): For GCC_VERSION >= 4001 use mode_*_inline routines instead of mode_* arrays if the argument is __builtin_constant_p. * lower-subreg.c (dump_choices): Make sure GET_MODE_SIZE argument is enum machine_mode. fortran/ * trans-types.c (gfc_init_kinds): Make sure GET_MODE_BITSIZE argument is enum machine_mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209484 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r--gcc/machmode.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h
index bc5d901d245..222e6263e0b 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -177,7 +177,13 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
/* Get the size in bytes and bits of an object of mode MODE. */
extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES];
+#if GCC_VERSION >= 4001
+#define GET_MODE_SIZE(MODE) \
+ ((unsigned short) (__builtin_constant_p (MODE) \
+ ? mode_size_inline (MODE) : mode_size[MODE]))
+#else
#define GET_MODE_SIZE(MODE) ((unsigned short) mode_size[MODE])
+#endif
#define GET_MODE_BITSIZE(MODE) \
((unsigned short) (GET_MODE_SIZE (MODE) * BITS_PER_UNIT))
@@ -203,7 +209,13 @@ extern const unsigned HOST_WIDE_INT mode_mask_array[NUM_MACHINE_MODES];
/* Return the mode of the inner elements in a vector. */
extern const unsigned char mode_inner[NUM_MACHINE_MODES];
+#if GCC_VERSION >= 4001
+#define GET_MODE_INNER(MODE) \
+ ((enum machine_mode) (__builtin_constant_p (MODE) \
+ ? mode_inner_inline (MODE) : mode_inner[MODE]))
+#else
#define GET_MODE_INNER(MODE) ((enum machine_mode) mode_inner[MODE])
+#endif
/* Get the size in bytes or bites of the basic parts of an
object of mode MODE. */
@@ -224,7 +236,13 @@ extern const unsigned char mode_inner[NUM_MACHINE_MODES];
/* Get the number of units in the object. */
extern const unsigned char mode_nunits[NUM_MACHINE_MODES];
+#if GCC_VERSION >= 4001
+#define GET_MODE_NUNITS(MODE) \
+ ((unsigned char) (__builtin_constant_p (MODE) \
+ ? mode_nunits_inline (MODE) : mode_nunits[MODE]))
+#else
#define GET_MODE_NUNITS(MODE) mode_nunits[MODE]
+#endif
/* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI). */