Commit 077eace8 authored by Michael Beck's avatar Michael Beck
Browse files

renamed modecode, mode_sort, mode_arithmetic to ir_*

[r19868]
parent cd74bb2a
......@@ -65,8 +65,8 @@ typedef enum { /* irm is short for `ir mode' */
irm_T, /**< tuple */
irm_ANY, /**< undefined mode */
irm_BAD, /**< bad mode */
irm_max /**< maximum value for modecode */
} modecode;
irm_max /**< maximum value for ir_modecode */
} ir_modecode;
/** These values represent the different mode classes of value representations.
*/
......@@ -84,7 +84,7 @@ typedef enum {
Floating point computations can be performed. */
irms_reference, /**< A mode to represent entities.
Restricted int computations can be performed */
} mode_sort;
} ir_mode_sort;
/** These values represent the different arithmetic operations possible with a mode.
Further arithmetics can be defined, e.g., for @@@ modes.
......@@ -105,7 +105,7 @@ typedef enum {
according to @@@ which standards??? Only legal for modes of
sort float_number. */
irma_max
} mode_arithmetic;
} ir_mode_arithmetic;
/* ********** Constructor for user defined modes **************** */
......@@ -113,7 +113,7 @@ typedef enum {
* Creates a new mode.
*
* @param name the name of the mode to be created
* @param sort the mode_sort of the mode to be created
* @param sort the ir_mode_sort of the mode to be created
* @param bit_size number of bits this mode allocate
* @param sign non-zero if this is a signed mode
* @param arithmetic arithmetic operations possible with a mode
......@@ -133,13 +133,14 @@ typedef enum {
* It is allowed to construct the default modes. So, a call
* new_ir_mode("Is", irms_int_number, 32, 1, irma_twos_complement, 32) will return mode_Is.
*/
ir_mode *new_ir_mode(const char *name, mode_sort sort, int bit_size, int sign, mode_arithmetic arithmetic, unsigned int modulo_shift);
ir_mode *new_ir_mode(const char *name, ir_mode_sort sort, int bit_size, int sign,
ir_mode_arithmetic arithmetic, unsigned int modulo_shift);
/**
* Creates a new vector mode.
*
* @param name the name of the mode to be created
* @param sort the mode_sort of the mode to be created
* @param sort the ir_mode_sort of the mode to be created
* @param bit_size number of bits for one element of this mode
* @param num_of_elem number of elements in this vector mode
* @param sign non-zero if this is a signed mode
......@@ -155,8 +156,8 @@ ir_mode *new_ir_mode(const char *name, mode_sort sort, int bit_size, int sign, m
* @return
* The new mode or NULL on error.
*/
ir_mode *new_ir_vector_mode(const char *name, mode_sort sort, int bit_size, unsigned num_of_elem, int sign,
mode_arithmetic arithmetic, unsigned int modulo_shift);
ir_mode *new_ir_vector_mode(const char *name, ir_mode_sort sort, int bit_size, unsigned num_of_elem, int sign,
ir_mode_arithmetic arithmetic, unsigned int modulo_shift);
/**
* Checks whether a pointer points to a mode.
......@@ -171,7 +172,7 @@ int is_mode(void *thing);
/* ********** Access methods to read mode information *********** */
/** Returns the classification of the mode */
modecode get_mode_modecode(const ir_mode *mode);
ir_modecode get_mode_modecode(const ir_mode *mode);
/** Returns the ident* of the mode */
ident *get_mode_ident(const ir_mode *mode);
......@@ -180,7 +181,7 @@ ident *get_mode_ident(const ir_mode *mode);
const char *get_mode_name(const ir_mode *mode);
/** Returns a coarse classification of the mode. */
mode_sort get_mode_sort(const ir_mode *mode);
ir_mode_sort get_mode_sort(const ir_mode *mode);
/** Returns the size of values of the mode in bits. */
unsigned get_mode_size_bits(const ir_mode *mode);
......@@ -195,7 +196,7 @@ unsigned get_mode_size_bytes(const ir_mode *mode);
int get_mode_sign(const ir_mode *mode);
/** Returns the arithmetic of a mode */
mode_arithmetic get_mode_arithmetic(const ir_mode *mode);
ir_mode_arithmetic get_mode_arithmetic(const ir_mode *mode);
/** Get the modulo shift attribute.
*
......@@ -363,7 +364,7 @@ void set_modeP_code(ir_mode *p);
void set_modeP_data(ir_mode *p);
/**
Functions to check, whether a modecode is signed, float, int, character,
Functions to check, whether a ir_modecode is signed, float, int, character,
reference, num, data, datab or dataM.
For more exact definitions read the corresponding pages
......
......@@ -180,8 +180,8 @@ void del_Sync_n(ir_node *n, int i);
void set_irn_mode(ir_node *node, ir_mode *mode);
/** Gets the mode struct of a node. */
ir_mode *get_irn_mode(const ir_node *node);
/** Gets the mode-enum modecode. */
modecode get_irn_modecode(const ir_node *node);
/** Gets the mode-enum ir_modecode. */
ir_modecode get_irn_modecode(const ir_node *node);
/** Gets the ident for a string representation of the mode .*/
ident *get_irn_modeident(const ir_node *node);
/** Gets the string representation of the mode .*/
......
......@@ -83,11 +83,11 @@ ir_mode *get_ppc32_mode_Cond(void) {
}
/**
* Calculates the modecode with size, sort and signed attributes
* Calculates the ir_modecode with size, sort and signed attributes
*/
modecode get_nice_modecode(ir_mode *irmode)
ir_modecode get_nice_modecode(ir_mode *irmode)
{
modecode mode = irm_max;
ir_modecode mode = irm_max;
int sign = mode_is_signed(irmode);
int bits = get_mode_size_bits(irmode);
if(mode_is_int(irmode))
......@@ -791,8 +791,8 @@ static ir_node *own_gen_Andi_dot_lo16(ppc32_transform_env_t *env, ir_node *op, i
*/
static ir_node *gen_Conv(ppc32_transform_env_t *env) {
ir_node *op = get_Conv_op(env->irn);
modecode from_mode=get_nice_modecode(get_irn_mode(op));
modecode to_mode=get_nice_modecode(env->mode);
ir_modecode from_mode=get_nice_modecode(get_irn_mode(op));
ir_modecode to_mode=get_nice_modecode(env->mode);
#define SKIP return op
......
......@@ -108,8 +108,8 @@ static ir_node *own_gen_convert_call(ppc32_transform_env_t *env, ir_node *op, co
static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) {
ir_mode *from_mode = get_irn_mode(get_irn_n(env->irn,0));
ir_mode *to_mode = env->mode;
modecode from_modecode=get_mode_modecode(from_mode);
modecode to_modecode=get_mode_modecode(to_mode);
ir_modecode from_modecode=get_mode_modecode(from_mode);
ir_modecode to_modecode=get_mode_modecode(to_mode);
switch(from_modecode){
case irm_F:
......@@ -387,8 +387,8 @@ void ppc32_conv_walk(ir_node *node, void *env) {
if (code == iro_Conv)
{
modecode from_mode=get_mode_modecode(get_irn_mode(get_irn_n(node,0)));
modecode to_mode=get_mode_modecode(get_irn_mode(node));
ir_modecode from_mode=get_mode_modecode(get_irn_mode(get_irn_n(node,0)));
ir_modecode to_mode=get_mode_modecode(get_irn_mode(node));
cw_block_attr *attr;
if(from_mode == to_mode) return;
......
......@@ -264,8 +264,8 @@ static ir_mode *register_mode(const ir_mode *new_mode) {
/*
* Creates a new mode.
*/
ir_mode *new_ir_mode(const char *name, mode_sort sort, int bit_size, int sign,
mode_arithmetic arithmetic, unsigned int modulo_shift)
ir_mode *new_ir_mode(const char *name, ir_mode_sort sort, int bit_size, int sign,
ir_mode_arithmetic arithmetic, unsigned int modulo_shift)
{
ir_mode mode_tmpl;
ir_mode *mode = NULL;
......@@ -306,8 +306,8 @@ ir_mode *new_ir_mode(const char *name, mode_sort sort, int bit_size, int sign,
/*
* Creates a new vector mode.
*/
ir_mode *new_ir_vector_mode(const char *name, mode_sort sort, int bit_size, unsigned num_of_elem, int sign,
mode_arithmetic arithmetic, unsigned int modulo_shift)
ir_mode *new_ir_vector_mode(const char *name, ir_mode_sort sort, int bit_size, unsigned num_of_elem, int sign,
ir_mode_arithmetic arithmetic, unsigned int modulo_shift)
{
ir_mode mode_tmpl;
ir_mode *mode = NULL;
......@@ -357,7 +357,7 @@ ir_mode *new_ir_vector_mode(const char *name, mode_sort sort, int bit_size, unsi
}
/* Functions for the direct access to all attributes of an ir_mode */
modecode (get_mode_modecode)(const ir_mode *mode) {
ir_modecode (get_mode_modecode)(const ir_mode *mode) {
return _get_mode_modecode(mode);
}
......@@ -369,7 +369,7 @@ const char *get_mode_name(const ir_mode *mode) {
return get_id_str(mode->name);
}
mode_sort (get_mode_sort)(const ir_mode* mode) {
ir_mode_sort (get_mode_sort)(const ir_mode* mode) {
return _get_mode_sort(mode);
}
......@@ -385,7 +385,7 @@ int (get_mode_sign)(const ir_mode *mode) {
return _get_mode_sign(mode);
}
mode_arithmetic (get_mode_arithmetic)(const ir_mode *mode) {
ir_mode_arithmetic (get_mode_arithmetic)(const ir_mode *mode) {
return get_mode_arithmetic(mode);
}
......@@ -412,7 +412,7 @@ void (set_mode_link)(ir_mode *mode, void *l) {
tarval *get_mode_min(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_data(mode));
return mode->min;
......@@ -420,7 +420,7 @@ tarval *get_mode_min(ir_mode *mode) {
tarval *get_mode_max(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_data(mode));
return mode->max;
......@@ -428,7 +428,7 @@ tarval *get_mode_max(ir_mode *mode) {
tarval *get_mode_null(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_datab(mode));
return mode->null;
......@@ -436,7 +436,7 @@ tarval *get_mode_null(ir_mode *mode) {
tarval *get_mode_one(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_datab(mode));
return mode->one;
......@@ -444,7 +444,7 @@ tarval *get_mode_one(ir_mode *mode) {
tarval *get_mode_minus_one(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_data(mode));
return mode->minus_one;
......@@ -452,14 +452,14 @@ tarval *get_mode_minus_one(ir_mode *mode) {
tarval *get_mode_all_one(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_datab(mode));
return mode->all_one;
}
tarval *get_mode_infinite(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_float(mode));
return get_tarval_plus_inf(mode);
......@@ -467,7 +467,7 @@ tarval *get_mode_infinite(ir_mode *mode) {
tarval *get_mode_NAN(ir_mode *mode) {
assert(mode);
assert(get_mode_modecode(mode) < (modecode) num_modes);
assert(get_mode_modecode(mode) < (ir_modecode) num_modes);
assert(mode_is_float(mode));
return get_tarval_nan(mode);
......
......@@ -42,14 +42,14 @@ _get_modeP_code(void) { return mode_P_code; }
static INLINE ir_mode *
_get_modeP_data(void) { return mode_P_data; }
static INLINE modecode
static INLINE ir_modecode
_get_mode_modecode(const ir_mode *mode) { return mode->code; }
static INLINE ident *
_get_mode_ident(const ir_mode *mode) { return mode->name; }
static INLINE mode_sort
_get_mode_sort(const ir_mode* mode) { return mode->sort; }
static INLINE ir_mode_sort
_get_mode_sort(const ir_mode *mode) { return mode->sort; }
static INLINE unsigned
_get_mode_size_bits(const ir_mode *mode) { return mode->size; }
......@@ -64,7 +64,7 @@ _get_mode_size_bytes(const ir_mode *mode) {
static INLINE int
_get_mode_sign(const ir_mode *mode) { return mode->sign; }
static INLINE mode_arithmetic
static INLINE ir_mode_arithmetic
_get_mode_arithmetic(const ir_mode *mode) { return mode->arithmetic; }
static INLINE unsigned int
......@@ -79,7 +79,7 @@ _get_mode_link(const ir_mode *mode) { return mode->link; }
static INLINE void
_set_mode_link(ir_mode *mode, void *l) { mode->link = l; }
/* Functions to check, whether a modecode is signed, float, int, num, data,
/* Functions to check, whether a ir_modecode is signed, float, int, num, data,
datab or dataM. For more exact definitions read the corresponding pages
in the firm documentation or the following enumeration
......
......@@ -401,7 +401,7 @@ void (set_irn_mode)(ir_node *node, ir_mode *mode) {
_set_irn_mode(node, mode);
}
modecode get_irn_modecode(const ir_node *node) {
ir_modecode get_irn_modecode(const ir_node *node) {
assert(node);
return node->mode->code;
}
......
......@@ -70,9 +70,9 @@ struct ir_op {
* and comparisons of values of a such described mode.
*
* ATTRIBUTES:
* - modecode code: An unambiguous int (enum) for the mode
* - ir_modecode code: An unambiguous int (enum) for the mode
* - ident *name: Name of this mode. Two modes are different if the name is different.
* - mode_sort sort: sort of mode specifying possible usage categories
* - ir_mode_sort sort: sort of mode specifying possible usage categories
* - int size: size of the mode in Bits.
* - unsigned sign:1: signedness of this mode
* - ... more to come
......@@ -85,15 +85,16 @@ struct ir_op {
*/
struct ir_mode {
firm_kind kind; /**< distinguishes this node from others */
modecode code; /**< unambiguous identifier of a mode */
ir_modecode code; /**< unambiguous identifier of a mode */
ident *name; /**< Name ident of this mode */
/* ----------------------------------------------------------------------- */
/* On changing this struct you have to evaluate the mode_are_equal function!*/
mode_sort sort; /**< coarse classification of this mode:
ir_mode_sort sort; /**< coarse classification of this mode:
int, float, reference ...
(see irmode.h) */
mode_arithmetic arithmetic; /**< different arithmetic operations possible with a mode */
ir_mode_arithmetic
arithmetic; /**< different arithmetic operations possible with a mode */
unsigned size; /**< size of the mode in Bits. */
unsigned sign:1; /**< signedness of this mode */
unsigned int modulo_shift; /**< number of bits a values of this mode will be shifted */
......
Markdown is supported
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