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.
*/
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.
according to @@@ which standards??? Only legal for modes of
sort float_number. */
irma_max
-} mode_arithmetic;
+} ir_mode_arithmetic;
/* ********** Constructor for user defined modes **************** */
* 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
* 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
* @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.
/* ********** 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);
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);
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.
*
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
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 .*/
}
/**
- * 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))
*/
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
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:
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;
/*
* 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;
/*
* 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;
}
/* 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);
}
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);
}
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);
}
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;
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;
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;
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;
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;
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);
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);
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; }
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
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
_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;
}
* 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
*/
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 */