aboutsummaryrefslogtreecommitdiff
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2015-08-19 15:23:11 +0000
committerDavid Sherwood <davids@gcc.gnu.org>2015-08-19 15:23:11 +0000
commit8dc89e4d7ed340095fa0d27de5de584156b38c0b (patch)
tree2b377ed532e090b8c3c26e8bb610668f7077e860 /gcc/machmode.h
parent8d55c61ba84df5753cad7e04cabaed0f11af76b5 (diff)
downloadgcc-8dc89e4d7ed340095fa0d27de5de584156b38c0b.zip
gcc-8dc89e4d7ed340095fa0d27de5de584156b38c0b.tar.gz
gcc-8dc89e4d7ed340095fa0d27de5de584156b38c0b.tar.bz2
genmodes.c (emit_mode_unit_size_inline): New function.
2015-08-19 David Sherwood <david.sherwood@arm.com> gcc/ * genmodes.c (emit_mode_unit_size_inline): New function. (emit_mode_unit_precision_inline): New function. (emit_insn_modes_h): Emit new #define. Emit new functions. (emit_mode_unit_size): New function. (emit_mode_unit_precision): New function. (emit_mode_adjustments): Add mode_unit_size adjustments. (emit_insn_modes_c): Emit new arrays. * machmode.h (GET_MODE_UNIT_SIZE, GET_MODE_UNIT_PRECISION): Update to use new inline methods. From-SVN: r227013
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r--gcc/machmode.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h
index 66ac7c0..5de1634 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -225,12 +225,28 @@ extern const unsigned char mode_inner[NUM_MACHINE_MODES];
/* Get the size in bytes or bits of the basic parts of an
object of mode MODE. */
-#define GET_MODE_UNIT_SIZE(MODE) GET_MODE_SIZE (GET_MODE_INNER (MODE))
+extern CONST_MODE_UNIT_SIZE unsigned char mode_unit_size[NUM_MACHINE_MODES];
+#if GCC_VERSION >= 4001
+#define GET_MODE_UNIT_SIZE(MODE) \
+ ((unsigned char) (__builtin_constant_p (MODE) \
+ ? mode_unit_size_inline (MODE) : mode_unit_size[MODE]))
+#else
+#define GET_MODE_UNIT_SIZE(MODE) mode_unit_size[MODE]
+#endif
#define GET_MODE_UNIT_BITSIZE(MODE) \
((unsigned short) (GET_MODE_UNIT_SIZE (MODE) * BITS_PER_UNIT))
-#define GET_MODE_UNIT_PRECISION(MODE) GET_MODE_PRECISION (GET_MODE_INNER (MODE))
+extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES];
+#if GCC_VERSION >= 4001
+#define GET_MODE_UNIT_PRECISION(MODE) \
+ ((unsigned short) (__builtin_constant_p (MODE) \
+ ? mode_unit_precision_inline (MODE)\
+ : mode_unit_precision[MODE]))
+#else
+#define GET_MODE_UNIT_PRECISION(MODE) mode_unit_precision[MODE]
+#endif
+
/* Get the number of units in the object. */