- fixed floating point constant classification
[r21404]
return STAT_FC_1;
else if (tv == get_mode_one(mode))
return STAT_FC_1;
return STAT_FC_1;
else if (tv == get_mode_one(mode))
return STAT_FC_1;
+ else if (tarval_ieee754_zero_mantissa(tv)) {
+ int exp = tarval_ieee754_get_exponent(tv);
+
+ if (exp == 1)
+ return STAT_FC_2;
+ else if (exp == -1)
+ return STAT_FC_0_5;
+ return STAT_FC_POWER_OF_TWO;
+ }
return STAT_FC_OTHER;
}
/* return a human readable name for an float classification */
const char *stat_fc_name(float_classify_t classification) {
switch (classification) {
return STAT_FC_OTHER;
}
/* return a human readable name for an float classification */
const char *stat_fc_name(float_classify_t classification) {
switch (classification) {
- case STAT_FC_0: return "0.0";
- case STAT_FC_1: return "1.0";
- case STAT_FC_2: return "2.0";
- case STAT_FC_0_5: return "0.5";
- case STAT_FC_EXACT: return "exact";
- case STAT_FC_OTHER: return "other";
- default: return "<UNKNOWN>";
+ case STAT_FC_0: return "0.0";
+ case STAT_FC_1: return "1.0";
+ case STAT_FC_2: return "2.0";
+ case STAT_FC_0_5: return "0.5";
+ case STAT_FC_POWER_OF_TWO: return "2.0^x";
+ case STAT_FC_OTHER: return "other";
+ default: return "<UNKNOWN>";
/** The Div by Const node. */
static ir_op _op_DivModC;
/** The Div by Const node. */
static ir_op _op_DivModC;
+/** The Quot by Const node. */
+static ir_op _op_QuotC;
+
/** The memory Proj node. */
static ir_op _op_ProjM;
/** The memory Proj node. */
static ir_op _op_ProjM;
-static const int status_disable = 0;
+static const unsigned status_disable = 0;
static stat_info_t *status = (stat_info_t *)&status_disable;
/**
static stat_info_t *status = (stat_info_t *)&status_disable;
/**
} /* if */
break;
case iro_Mul:
} /* if */
break;
case iro_Mul:
- if (get_irn_op(get_Mul_left(node)) == op_Const || get_irn_op(get_Mul_right(node)) == op_Const) {
+ if (is_Const(get_Mul_left(node)) || is_Const(get_Mul_right(node))) {
/* special case, a Multiply by a const, count on extra counter */
op = status->op_MulC ? status->op_MulC : op;
} /* if */
break;
case iro_Div:
/* special case, a Multiply by a const, count on extra counter */
op = status->op_MulC ? status->op_MulC : op;
} /* if */
break;
case iro_Div:
- if (get_irn_op(get_Div_right(node)) == op_Const) {
+ if (is_Const(get_Div_right(node))) {
/* special case, a division by a const, count on extra counter */
op = status->op_DivC ? status->op_DivC : op;
} /* if */
break;
case iro_Mod:
/* special case, a division by a const, count on extra counter */
op = status->op_DivC ? status->op_DivC : op;
} /* if */
break;
case iro_Mod:
- if (get_irn_op(get_Mod_right(node)) == op_Const) {
+ if (is_Const(get_Mod_right(node))) {
/* special case, a module by a const, count on extra counter */
op = status->op_ModC ? status->op_ModC : op;
} /* if */
break;
case iro_DivMod:
/* special case, a module by a const, count on extra counter */
op = status->op_ModC ? status->op_ModC : op;
} /* if */
break;
case iro_DivMod:
- if (get_irn_op(get_DivMod_right(node)) == op_Const) {
+ if (is_Const(get_DivMod_right(node))) {
/* special case, a division/modulo by a const, count on extra counter */
op = status->op_DivModC ? status->op_DivModC : op;
} /* if */
break;
/* special case, a division/modulo by a const, count on extra counter */
op = status->op_DivModC ? status->op_DivModC : op;
} /* if */
break;
+ case iro_Quot:
+ if (is_Const(get_Quot_right(node))) {
+ /* special case, a floating point division by a const, count on extra counter */
+ op = status->op_QuotC ? status->op_QuotC : op;
+ } /* if */
+ break;
case iro_Sel:
if (get_irn_op(get_Sel_ptr(node)) == op_Sel) {
/* special case, a Sel of a Sel, count on extra counter */
case iro_Sel:
if (get_irn_op(get_Sel_ptr(node)) == op_Sel) {
/* special case, a Sel of a Sel, count on extra counter */
_op_DivModC.code = --num;
_op_DivModC.name = new_id_from_chars(X("DivModC"));
_op_DivModC.code = --num;
_op_DivModC.name = new_id_from_chars(X("DivModC"));
+ _op_QuotC.code = --num;
+ _op_QuotC.name = new_id_from_chars(X("QuotC"));
+
status->op_Phi0 = &_op_Phi0;
status->op_PhiM = &_op_PhiM;
status->op_ProjM = &_op_ProjM;
status->op_Phi0 = &_op_Phi0;
status->op_PhiM = &_op_PhiM;
status->op_ProjM = &_op_ProjM;
status->op_DivC = &_op_DivC;
status->op_ModC = &_op_ModC;
status->op_DivModC = &_op_DivModC;
status->op_DivC = &_op_DivC;
status->op_ModC = &_op_ModC;
status->op_DivModC = &_op_DivModC;
+ status->op_QuotC = &_op_QuotC;
} else {
status->op_Phi0 = NULL;
status->op_PhiM = NULL;
} else {
status->op_Phi0 = NULL;
status->op_PhiM = NULL;
status->op_DivC = NULL;
status->op_ModC = NULL;
status->op_DivModC = NULL;
status->op_DivC = NULL;
status->op_ModC = NULL;
status->op_DivModC = NULL;
+ status->op_QuotC = NULL;
} /* if */
/* for Florian: count the Sel depth */
} /* if */
/* for Florian: count the Sel depth */
STAT_FC_1, /**< the float value 1.0 */
STAT_FC_2, /**< the float value 2.0 */
STAT_FC_0_5, /**< the float value 0.5 */
STAT_FC_1, /**< the float value 1.0 */
STAT_FC_2, /**< the float value 2.0 */
STAT_FC_0_5, /**< the float value 0.5 */
- STAT_FC_EXACT, /**< an exact value */
+ STAT_FC_POWER_OF_TWO, /**< another 2^x value */
STAT_FC_OTHER, /**< all other values */
STAT_FC_MAX /**< last value */
} float_classify_t;
STAT_FC_OTHER, /**< all other values */
STAT_FC_MAX /**< last value */
} float_classify_t;
ir_op *op_DivC; /**< pseudo op for division by const */
ir_op *op_ModC; /**< pseudo op for modulo by const */
ir_op *op_DivModC; /**< pseudo op for DivMod by const */
ir_op *op_DivC; /**< pseudo op for division by const */
ir_op *op_ModC; /**< pseudo op for modulo by const */
ir_op *op_DivModC; /**< pseudo op for DivMod by const */
+ ir_op *op_QuotC; /**< pseudo op for floating point division by const */
ir_op *op_SelSel; /**< pseudo op for Sel(Sel) */
ir_op *op_SelSelSel; /**< pseudo op for Sel(Sel(Sel)) */
dumper_t *dumper; /**< list of dumper */
ir_op *op_SelSel; /**< pseudo op for Sel(Sel) */
ir_op *op_SelSelSel; /**< pseudo op for Sel(Sel(Sel)) */
dumper_t *dumper; /**< list of dumper */