# include "array.h"
#if 0
+static long long count = 0;
# define ANNOUNCE() printf(__FILE__": call no. %lld (%s)\n", count++, __FUNCTION__)
#else
# define ANNOUNCE() ((void)0)
* local values
* * */
-static long long count = 0;
/* dynamic array to hold all modes */
static ir_mode * modes;
return mode->sort;
}
-int
-get_mode_size(ir_mode *mode)
+INLINE int
+get_mode_size_bits(ir_mode *mode)
{
ANNOUNCE();
return mode->size;
}
+int get_mode_size_bytes(ir_mode *mode) {
+ ANNOUNCE();
+ int size = get_mode_size_bits(mode);
+ if ((size % 8) != 0) return -1;
+ return size / 8;
+}
+
int
get_mode_align (ir_mode *mode)
{
/* A coarse classification of the mode */
mode_sort get_mode_sort(ir_mode *mode);
-/* The size of values of the mode in bits. */
-int get_mode_size(ir_mode *mode);
+/** The size of values of the mode in bits. */
+int get_mode_size_bits(ir_mode *mode);
+/** The size of values of the mode in bytes. If the size is not
+ dividable by 8 returns -1. */
+int get_mode_size_bytes(ir_mode *mode);
/* The alignment of values of the mode in bytes. */
int get_mode_align(ir_mode *mode);