Commit f1dfcc71 authored by Götz Lindenmaier's avatar Götz Lindenmaier
Browse files

size access with unit

[r1003]
parent 9e4f7398
......@@ -20,6 +20,7 @@
# 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)
......@@ -29,7 +30,6 @@
* local values
* * */
static long long count = 0;
/* dynamic array to hold all modes */
static ir_mode * modes;
......@@ -226,13 +226,20 @@ get_mode_sort(ir_mode* mode)
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)
{
......
......@@ -148,8 +148,11 @@ const char *get_mode_name(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);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment