summaryrefslogtreecommitdiff
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authordavids <davids@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-19 15:23:11 +0000
committerdavids <davids@138bc75d-0d04-0410-961f-82ee72b054a4>2015-08-19 15:23:11 +0000
commita0509d0eb68c41d64f1464de691818519c48aff0 (patch)
tree2b377ed532e090b8c3c26e8bb610668f7077e860 /gcc/machmode.h
parent34bf6b7fe74f1721b8b9b71c98a3515fb77eee04 (diff)
downloadgcc-a0509d0eb68c41d64f1464de691818519c48aff0.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227013 138bc75d-0d04-0410-961f-82ee72b054a4
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 66ac7c0539d..5de16349919 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. */