Commit 7fcabe88 authored by Moritz Kroll's avatar Moritz Kroll
Browse files

Reverted changes from 25529

[r25585]
parent 8713f359
...@@ -1725,25 +1725,24 @@ ir_node *new_rd_Rotl (dbg_info *db, ir_graph *irg, ir_node *block, ...@@ -1725,25 +1725,24 @@ ir_node *new_rd_Rotl (dbg_info *db, ir_graph *irg, ir_node *block,
/** Constructor for a Conv node. /** Constructor for a Conv node.
* *
* @param *db A pointer for debug information. * @param *db A pointer for debug information.
* @param *irg The IR graph the node belongs to. * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to. * @param *block The IR block the node belongs to.
* @param *op The operand. * @param *op The operand.
* @param *mode The mode the operand must be converted to. * @param *mode The mode of this the operand muss be converted .
* @param strict_flag Whether the Conv is strict.
*/ */
ir_node *new_rd_Conv (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *new_rd_Conv (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *op, ir_mode *mode, int strict_flag); ir_node *op, ir_mode *mode);
/** Constructor for a Cast node. /** Constructor for a Cast node.
* *
* High level type cast. * High level type cast.
* *
* @param *db A pointer for debug information. * @param *db A pointer for debug information.
* @param *irg The IR graph the node belongs to. * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to. * @param *block The IR block the node belongs to.
* @param *op The operand. * @param *op The operand.
* @param *to_tp The type of this the operand muss be casted. * @param *to_tp The type of this the operand muss be casted .
*/ */
ir_node *new_rd_Cast (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *new_rd_Cast (dbg_info *db, ir_graph *irg, ir_node *block,
ir_node *op, ir_type *to_tp); ir_node *op, ir_type *to_tp);
...@@ -2549,14 +2548,13 @@ ir_node *new_r_Rotl (ir_graph *irg, ir_node *block, ...@@ -2549,14 +2548,13 @@ ir_node *new_r_Rotl (ir_graph *irg, ir_node *block,
/** Constructor for a Conv node. /** Constructor for a Conv node.
* *
* @param *irg The IR graph the node belongs to. * @param *irg The IR graph the node belongs to.
* @param *block The IR block the node belongs to. * @param *block The IR block the node belongs to.
* @param *op The operand. * @param *op The operand.
* @param *mode The mode the operand must be converted to. * @param *mode The mode of this the operand muss be converted .
* @param strict_flag Whether the Conv is strict.
*/ */
ir_node *new_r_Conv (ir_graph *irg, ir_node *block, ir_node *new_r_Conv (ir_graph *irg, ir_node *block,
ir_node *op, ir_mode *mode, int strict_flag); ir_node *op, ir_mode *mode);
/** Constructor for a Cast node. /** Constructor for a Cast node.
* *
......
...@@ -2043,7 +2043,7 @@ static void modify_irg(be_abi_irg_t *env) ...@@ -2043,7 +2043,7 @@ static void modify_irg(be_abi_irg_t *env)
repl = new_r_Proj(irg, reg_params_bl, load, load_mode, pn_Load_res); repl = new_r_Proj(irg, reg_params_bl, load, load_mode, pn_Load_res);
if (mode != load_mode) { if (mode != load_mode) {
repl = new_r_Conv(irg, reg_params_bl, repl, mode, 0); repl = new_r_Conv(irg, reg_params_bl, repl, mode);
} }
} else { } else {
/* The stack parameter is not primitive (it is a struct or array), /* The stack parameter is not primitive (it is a struct or array),
...@@ -2059,7 +2059,7 @@ static void modify_irg(be_abi_irg_t *env) ...@@ -2059,7 +2059,7 @@ static void modify_irg(be_abi_irg_t *env)
which may be wrong. Add Conv's then. */ which may be wrong. Add Conv's then. */
mode = get_irn_mode(args[i]); mode = get_irn_mode(args[i]);
if (mode != get_irn_mode(repl)) { if (mode != get_irn_mode(repl)) {
repl = new_r_Conv(irg, get_irn_n(repl, -1), repl, mode, 0); repl = new_r_Conv(irg, get_irn_n(repl, -1), repl, mode);
} }
exchange(args[i], repl); exchange(args[i], repl);
} }
......
...@@ -269,7 +269,7 @@ static int map_Shl(ir_node *call, void *ctx) { ...@@ -269,7 +269,7 @@ static int map_Shl(ir_node *call, void *ctx) {
if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) { if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) {
/* simplest case: shift only the lower bits. Note that there is no /* simplest case: shift only the lower bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */ need to reduce the constant here, this is done by the hardware. */
ir_node *conv = new_rd_Conv(dbg, irg, block, a_l, h_mode, 0); ir_node *conv = new_rd_Conv(dbg, irg, block, a_l, h_mode);
h_res = new_rd_Shl(dbg, irg, block, conv, cnt, h_mode); h_res = new_rd_Shl(dbg, irg, block, conv, cnt, h_mode);
l_res = new_rd_Const(dbg, irg, get_mode_null(l_mode)); l_res = new_rd_Const(dbg, irg, get_mode_null(l_mode));
...@@ -306,7 +306,7 @@ static int map_Shl(ir_node *call, void *ctx) { ...@@ -306,7 +306,7 @@ static int map_Shl(ir_node *call, void *ctx) {
/* the block for cnt >= 32 */ /* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]); n_block = new_rd_Block(dbg, irg, 1, &in[1]);
h2 = new_rd_Conv(dbg, irg, n_block, l1, h_mode, 0); h2 = new_rd_Conv(dbg, irg, n_block, l1, h_mode);
l2 = new_r_Const(irg, get_mode_null(l_mode)); l2 = new_r_Const(irg, get_mode_null(l_mode));
in[1] = new_r_Jmp(irg, n_block); in[1] = new_r_Jmp(irg, n_block);
...@@ -357,7 +357,7 @@ static int map_Shr(ir_node *call, void *ctx) { ...@@ -357,7 +357,7 @@ static int map_Shr(ir_node *call, void *ctx) {
if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) { if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) {
/* simplest case: shift only the higher bits. Note that there is no /* simplest case: shift only the higher bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */ need to reduce the constant here, this is done by the hardware. */
ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode, 0); ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode);
h_res = new_rd_Const(dbg, irg, get_mode_null(h_mode)); h_res = new_rd_Const(dbg, irg, get_mode_null(h_mode));
l_res = new_rd_Shr(dbg, irg, block, conv, cnt, l_mode); l_res = new_rd_Shr(dbg, irg, block, conv, cnt, l_mode);
} else { } else {
...@@ -392,7 +392,7 @@ static int map_Shr(ir_node *call, void *ctx) { ...@@ -392,7 +392,7 @@ static int map_Shr(ir_node *call, void *ctx) {
/* the block for cnt >= 32 */ /* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]); n_block = new_rd_Block(dbg, irg, 1, &in[1]);
l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode, 0); l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
h2 = new_r_Const(irg, get_mode_null(h_mode)); h2 = new_r_Const(irg, get_mode_null(h_mode));
in[1] = new_r_Jmp(irg, n_block); in[1] = new_r_Jmp(irg, n_block);
...@@ -443,7 +443,7 @@ static int map_Shrs(ir_node *call, void *ctx) { ...@@ -443,7 +443,7 @@ static int map_Shrs(ir_node *call, void *ctx) {
if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) { if (tarval_cmp(tv, new_tarval_from_long(32, l_mode)) & (pn_Cmp_Gt|pn_Cmp_Eq)) {
/* simplest case: shift only the higher bits. Note that there is no /* simplest case: shift only the higher bits. Note that there is no
need to reduce the constant here, this is done by the hardware. */ need to reduce the constant here, this is done by the hardware. */
ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode, 0); ir_node *conv = new_rd_Conv(dbg, irg, block, a_h, l_mode);
ir_mode *c_mode = get_irn_mode(cnt); ir_mode *c_mode = get_irn_mode(cnt);
h_res = new_rd_Shrs(dbg, irg, block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode); h_res = new_rd_Shrs(dbg, irg, block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
...@@ -480,7 +480,7 @@ static int map_Shrs(ir_node *call, void *ctx) { ...@@ -480,7 +480,7 @@ static int map_Shrs(ir_node *call, void *ctx) {
/* the block for cnt >= 32 */ /* the block for cnt >= 32 */
n_block = new_rd_Block(dbg, irg, 1, &in[1]); n_block = new_rd_Block(dbg, irg, 1, &in[1]);
l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode, 0); l2 = new_rd_Conv(dbg, irg, n_block, h1, l_mode);
h2 = new_rd_Shrs(dbg, irg, n_block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode); h2 = new_rd_Shrs(dbg, irg, n_block, a_h, new_r_Const_long(irg, c_mode, 31), h_mode);
in[1] = new_r_Jmp(irg, n_block); in[1] = new_r_Jmp(irg, n_block);
...@@ -581,10 +581,10 @@ static int map_Mul(ir_node *call, void *ctx) { ...@@ -581,10 +581,10 @@ static int map_Mul(ir_node *call, void *ctx) {
pEDX = new_rd_Proj(dbg, irg, block, mul, h_mode, pn_ia32_l_Mul_EDX); pEDX = new_rd_Proj(dbg, irg, block, mul, h_mode, pn_ia32_l_Mul_EDX);
l_res = new_rd_Proj(dbg, irg, block, mul, l_mode, pn_ia32_l_Mul_EAX); l_res = new_rd_Proj(dbg, irg, block, mul, l_mode, pn_ia32_l_Mul_EAX);
b_l = new_rd_Conv(dbg, irg, block, b_l, h_mode, 0); b_l = new_rd_Conv(dbg, irg, block, b_l, h_mode);
mul = new_rd_Mul( dbg, irg, block, a_h, b_l, h_mode); mul = new_rd_Mul( dbg, irg, block, a_h, b_l, h_mode);
add = new_rd_Add( dbg, irg, block, mul, pEDX, h_mode); add = new_rd_Add( dbg, irg, block, mul, pEDX, h_mode);
a_l = new_rd_Conv(dbg, irg, block, a_l, h_mode, 0); a_l = new_rd_Conv(dbg, irg, block, a_l, h_mode);
mul = new_rd_Mul( dbg, irg, block, a_l, b_h, h_mode); mul = new_rd_Mul( dbg, irg, block, a_l, b_h, h_mode);
h_res = new_rd_Add( dbg, irg, block, add, mul, h_mode); h_res = new_rd_Add( dbg, irg, block, add, mul, h_mode);
} }
...@@ -654,7 +654,7 @@ static int map_Abs(ir_node *call, void *ctx) { ...@@ -654,7 +654,7 @@ static int map_Abs(ir_node *call, void *ctx) {
/* TODO: give a hint to the backend somehow to not create a cltd here... */ /* TODO: give a hint to the backend somehow to not create a cltd here... */
sign = new_rd_Shrs(dbg, irg, block, a_h, new_Const_long(l_mode, 31), h_mode); sign = new_rd_Shrs(dbg, irg, block, a_h, new_Const_long(l_mode, 31), h_mode);
sign_l = new_rd_Conv(dbg, irg, block, sign, l_mode, 0); sign_l = new_rd_Conv(dbg, irg, block, sign, l_mode);
sub_l = new_rd_Eor(dbg, irg, block, a_l, sign_l, l_mode); sub_l = new_rd_Eor(dbg, irg, block, a_l, sign_l, l_mode);
sub_h = new_rd_Eor(dbg, irg, block, a_h, sign, h_mode); sub_h = new_rd_Eor(dbg, irg, block, a_h, sign, h_mode);
......
...@@ -112,7 +112,7 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) { ...@@ -112,7 +112,7 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) {
switch(from_modecode){ switch(from_modecode){
case irm_F: case irm_F:
op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_D, 0); op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_D);
// fall through // fall through
case irm_D: case irm_D:
{ {
...@@ -144,7 +144,7 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) { ...@@ -144,7 +144,7 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) {
case irm_Hs: case irm_Hs:
case irm_Bu: case irm_Bu:
case irm_Hu: case irm_Hu:
return new_rd_Conv(env->dbg, env->irg, env->block, res, to_mode, 0); return new_rd_Conv(env->dbg, env->irg, env->block, res, to_mode);
case irm_Is: case irm_Is:
case irm_Iu: case irm_Iu:
return res; return res;
...@@ -155,14 +155,14 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) { ...@@ -155,14 +155,14 @@ static ir_node *gen_Conv(ppc32_transform_env_t *env, ir_node *op) {
} }
case irm_Hs: case irm_Hs:
case irm_Bs: case irm_Bs:
op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_Is, 0); op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_Is);
case irm_Is: case irm_Is:
return own_gen_convert_call(env, op, (to_mode == mode_D) ? "conv_int_to_double" : "conv_int_to_single", mode_Is, to_mode); return own_gen_convert_call(env, op, (to_mode == mode_D) ? "conv_int_to_double" : "conv_int_to_single", mode_Is, to_mode);
case irm_Hu: case irm_Hu:
case irm_Bu: case irm_Bu:
op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_Iu, 0); op = new_rd_Conv(env->dbg, env->irg, env->block, op, mode_Iu);
case irm_Iu: case irm_Iu:
return own_gen_convert_call(env, op, (to_mode == mode_D) ? "conv_unsigned_int_to_double": "conv_unsigned_int_to_single", mode_Iu, to_mode); return own_gen_convert_call(env, op, (to_mode == mode_D) ? "conv_unsigned_int_to_double": "conv_unsigned_int_to_single", mode_Iu, to_mode);
......
...@@ -1012,12 +1012,12 @@ new_rd_defaultProj(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg, ...@@ -1012,12 +1012,12 @@ new_rd_defaultProj(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *arg,
} /* new_rd_defaultProj */ } /* new_rd_defaultProj */
ir_node * ir_node *
new_rd_Conv(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode, int strict_flag) { new_rd_Conv(dbg_info *db, ir_graph *irg, ir_node *block, ir_node *op, ir_mode *mode) {
ir_node *res; ir_node *res;
ir_graph *rem = current_ir_graph; ir_graph *rem = current_ir_graph;
current_ir_graph = irg; current_ir_graph = irg;
res = new_bd_Conv(db, block, op, mode, strict_flag); res = new_bd_Conv(db, block, op, mode, 0);
current_ir_graph = rem; current_ir_graph = rem;
return res; return res;
...@@ -1645,8 +1645,8 @@ ir_node *new_r_Cmp(ir_graph *irg, ir_node *block, ...@@ -1645,8 +1645,8 @@ ir_node *new_r_Cmp(ir_graph *irg, ir_node *block,
} }
#endif #endif
ir_node *new_r_Conv(ir_graph *irg, ir_node *block, ir_node *new_r_Conv(ir_graph *irg, ir_node *block,
ir_node *op, ir_mode *mode, int strict_flag) { ir_node *op, ir_mode *mode) {
return new_rd_Conv(NULL, irg, block, op, mode, strict_flag); return new_rd_Conv(NULL, irg, block, op, mode);
} }
#ifdef USE_ORIGINAL #ifdef USE_ORIGINAL
ir_node *new_r_Cast(ir_graph *irg, ir_node *block, ir_node *op, ir_type *to_tp) { ir_node *new_r_Cast(ir_graph *irg, ir_node *block, ir_node *op, ir_type *to_tp) {
......
...@@ -2185,7 +2185,7 @@ static ir_node *transform_node_AddSub(ir_node *n) { ...@@ -2185,7 +2185,7 @@ static ir_node *transform_node_AddSub(ir_node *n) {
/* convert a AddP(P, *s) into AddP(P, *u) */ /* convert a AddP(P, *s) into AddP(P, *u) */
ir_mode *nm = get_reference_mode_unsigned_eq(mode); ir_mode *nm = get_reference_mode_unsigned_eq(mode);
ir_node *pre = new_r_Conv(current_ir_graph, get_nodes_block(n), right, nm, 0); ir_node *pre = new_r_Conv(current_ir_graph, get_nodes_block(n), right, nm);
set_binop_right(n, pre); set_binop_right(n, pre);
} }
} }
...@@ -2250,7 +2250,7 @@ static ir_node *transform_node_Add(ir_node *n) { ...@@ -2250,7 +2250,7 @@ static ir_node *transform_node_Add(ir_node *n) {
if (is_Const(b) && is_Const_null(b) && mode_is_int(lmode)) { if (is_Const(b) && is_Const_null(b) && mode_is_int(lmode)) {
/* an Add(a, NULL) is a hidden Conv */ /* an Add(a, NULL) is a hidden Conv */
dbg_info *dbg = get_irn_dbg_info(n); dbg_info *dbg = get_irn_dbg_info(n);
return new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode, 0); return new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode);
} }
} }
...@@ -2370,7 +2370,7 @@ static ir_node *transform_node_Sub(ir_node *n) { ...@@ -2370,7 +2370,7 @@ static ir_node *transform_node_Sub(ir_node *n) {
if (is_Const(b) && is_Const_null(b) && mode_is_reference(lmode)) { if (is_Const(b) && is_Const_null(b) && mode_is_reference(lmode)) {
/* a Sub(a, NULL) is a hidden Conv */ /* a Sub(a, NULL) is a hidden Conv */
dbg_info *dbg = get_irn_dbg_info(n); dbg_info *dbg = get_irn_dbg_info(n);
n = new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode, 0); n = new_rd_Conv(dbg, current_ir_graph, get_nodes_block(n), a, mode);
DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_CONV); DBG_OPT_ALGSIM0(oldn, n, FS_OPT_SUB_TO_CONV);
return n; return n;
} }
...@@ -2442,7 +2442,7 @@ restart: ...@@ -2442,7 +2442,7 @@ restart:
ir_node *a_block = get_nodes_block(n); ir_node *a_block = get_nodes_block(n);
if (s_mode != mode) if (s_mode != mode)
s_right = new_r_Conv(irg, a_block, s_right, mode, 0); s_right = new_r_Conv(irg, a_block, s_right, mode);
n = new_rd_Add(a_dbg, irg, a_block, sub, s_right, mode); n = new_rd_Add(a_dbg, irg, a_block, sub, s_right, mode);
} else { } else {
ir_node *sub = new_rd_Sub(s_dbg, irg, s_block, s_right, s_left, s_mode); ir_node *sub = new_rd_Sub(s_dbg, irg, s_block, s_right, s_left, s_mode);
...@@ -2494,7 +2494,7 @@ restart: ...@@ -2494,7 +2494,7 @@ restart:
if (left == b) { if (left == b) {
if (mode != get_irn_mode(right)) { if (mode != get_irn_mode(right)) {
/* This Sub is an effective Cast */ /* This Sub is an effective Cast */
right = new_r_Conv(get_irn_irg(n), get_nodes_block(n), right, mode, 0); right = new_r_Conv(get_irn_irg(n), get_nodes_block(n), right, mode);
} }
n = right; n = right;
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
...@@ -2502,7 +2502,7 @@ restart: ...@@ -2502,7 +2502,7 @@ restart:
} else if (right == b) { } else if (right == b) {
if (mode != get_irn_mode(left)) { if (mode != get_irn_mode(left)) {
/* This Sub is an effective Cast */ /* This Sub is an effective Cast */
left = new_r_Conv(get_irn_irg(n), get_nodes_block(n), left, mode, 0); left = new_r_Conv(get_irn_irg(n), get_nodes_block(n), left, mode);
} }
n = left; n = left;
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
...@@ -2522,7 +2522,7 @@ restart: ...@@ -2522,7 +2522,7 @@ restart:
n = new_r_Minus(get_irn_irg(n), get_nodes_block(n), right, r_mode); n = new_r_Minus(get_irn_irg(n), get_nodes_block(n), right, r_mode);
if (mode != r_mode) { if (mode != r_mode) {
/* This Sub is an effective Cast */ /* This Sub is an effective Cast */
n = new_r_Conv(get_irn_irg(n), get_nodes_block(n), n, mode, 0); n = new_r_Conv(get_irn_irg(n), get_nodes_block(n), n, mode);
} }
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
return n; return n;
...@@ -2532,7 +2532,7 @@ restart: ...@@ -2532,7 +2532,7 @@ restart:
n = new_r_Minus(get_irn_irg(n), get_nodes_block(n), left, l_mode); n = new_r_Minus(get_irn_irg(n), get_nodes_block(n), left, l_mode);
if (mode != l_mode) { if (mode != l_mode) {
/* This Sub is an effective Cast */ /* This Sub is an effective Cast */
n = new_r_Conv(get_irn_irg(n), get_nodes_block(n), n, mode, 0); n = new_r_Conv(get_irn_irg(n), get_nodes_block(n), n, mode);
} }
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_ADD_SUB);
return n; return n;
...@@ -2664,7 +2664,7 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode) { ...@@ -2664,7 +2664,7 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode) {
if (ta == get_mode_one(smode)) { if (ta == get_mode_one(smode)) {
/* (L)1 * (L)b = (L)b */ /* (L)1 * (L)b = (L)b */
ir_node *blk = get_nodes_block(n); ir_node *blk = get_nodes_block(n);
n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, b, mode, 0); n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, b, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1);
return n; return n;
} }
...@@ -2672,14 +2672,14 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode) { ...@@ -2672,14 +2672,14 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode) {
/* (L)-1 * (L)b = (L)b */ /* (L)-1 * (L)b = (L)b */
ir_node *blk = get_nodes_block(n); ir_node *blk = get_nodes_block(n);
n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, b, smode); n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, b, smode);
n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, n, mode, 0); n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, n, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1);
return n; return n;
} }
if (tb == get_mode_one(smode)) { if (tb == get_mode_one(smode)) {
/* (L)a * (L)1 = (L)a */ /* (L)a * (L)1 = (L)a */
ir_node *blk = get_irn_n(a, -1); ir_node *blk = get_irn_n(a, -1);
n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, a, mode, 0); n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, a, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_NEUTRAL_1);
return n; return n;
} }
...@@ -2687,7 +2687,7 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode) { ...@@ -2687,7 +2687,7 @@ static ir_node *transform_node_Mul2n(ir_node *n, ir_mode *mode) {
/* (L)a * (L)-1 = (L)-a */ /* (L)a * (L)-1 = (L)-a */
ir_node *blk = get_nodes_block(n); ir_node *blk = get_nodes_block(n);
n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, a, smode); n = new_rd_Minus(get_irn_dbg_info(n), current_ir_graph, blk, a, smode);
n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, n, mode, 0); n = new_rd_Conv(get_irn_dbg_info(n), current_ir_graph, blk, n, mode);
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_MUL_MINUS_1);
return n; return n;
} }
...@@ -3274,7 +3274,7 @@ static ir_node *transform_bitwise_distributive(ir_node *n, ...@@ -3274,7 +3274,7 @@ static ir_node *transform_bitwise_distributive(ir_node *n,
set_binop_right(n, b_op); set_binop_right(n, b_op);
set_irn_mode(n, a_mode); set_irn_mode(n, a_mode);
n = trans_func(n); n = trans_func(n);
n = new_r_Conv(current_ir_graph, blk, n, get_irn_mode(oldn), 0); n = new_r_Conv(current_ir_graph, blk, n, get_irn_mode(oldn));
DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_SHIFT_AND); DBG_OPT_ALGSIM1(oldn, a, b, n, FS_OPT_SHIFT_AND);
return n; return n;
...@@ -4057,13 +4057,13 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) { ...@@ -4057,13 +4057,13 @@ static ir_node *transform_node_Proj_Cmp(ir_node *proj) {
changed |= 1; changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV_CONV); DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV_CONV);
} else if (smaller_mode(mode_left, mode_right)) { } else if (smaller_mode(mode_left, mode_right)) {
left = new_r_Conv(irg, block, op_left, mode_right, 0); left = new_r_Conv(irg, block, op_left, mode_right);
right = op_right; right = op_right;
changed |= 1; changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV); DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV);
} else if (smaller_mode(mode_right, mode_left)) { } else if (smaller_mode(mode_right, mode_left)) {
left = op_left; left = op_left;
right = new_r_Conv(irg, block, op_right, mode_left, 0); right = new_r_Conv(irg, block, op_right, mode_left);
changed |= 1; changed |= 1;
DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV); DBG_OPT_ALGSIM0(n, n, FS_OPT_CMP_CONV);
} }
......
...@@ -960,7 +960,7 @@ static void lower_Shl(ir_node *node, ir_mode *mode, lower_env_t *env) { ...@@ -960,7 +960,7 @@ static void lower_Shl(ir_node *node, ir_mode *mode, lower_env_t *env) {
long shf_cnt = get_tarval_long(tv) - get_mode_size_bits(mode); long shf_cnt = get_tarval_long(tv) - get_mode_size_bits(mode);
int idx = get_irn_idx(left); int idx = get_irn_idx(left);
left = new_r_Conv(irg, block, env->entries[idx]->low_word, mode, 0); left = new_r_Conv(irg, block, env->entries[idx]->low_word, mode);
idx = get_irn_idx(node); idx = get_irn_idx(node);
mode_l = env->params->low_unsigned; mode_l = env->params->low_unsigned;
...@@ -1009,7 +1009,7 @@ static void lower_Shrs(ir_node *node, ir_mode *mode, lower_env_t *env) { ...@@ -1009,7 +1009,7 @@ static void lower_Shrs(ir_node *node, ir_mode *mode, lower_env_t *env) {
low = left; low = left;
} /* if */ } /* if */
/* low word is expected to have mode_l */ /* low word is expected to have mode_l */
env->entries[idx]->low_word = new_r_Conv(irg, block, low, mode_l, 0); env->entries[idx]->low_word = new_r_Conv(irg, block, low, mode_l);
c = new_r_Const_long(irg, mode_l, get_mode_size_bits(mode) - 1); c = new_r_Const_long(irg, mode_l, get_mode_size_bits(mode) - 1);
env->entries[idx]->high_word = new_r_Shrs(irg, block, left, c, mode); env->entries[idx]->high_word = new_r_Shrs(irg, block, left, c, mode);
...@@ -1315,8 +1315,8 @@ static void lower_Cond(ir_node *node, ir_mode *mode, lower_env_t *env) { ...@@ -1315,8 +1315,8 @@ static void lower_Cond(ir_node *node, ir_mode *mode, lower_env_t *env) {
if (pnc == pn_Cmp_Eq || pnc == pn_Cmp_Lg) { if (pnc == pn_Cmp_Eq || pnc == pn_Cmp_Lg) {
/* x ==/!= 0 ==> or(low,high) ==/!= 0 */ /* x ==/!= 0 ==> or(low,high) ==/!= 0 */
ir_mode *mode = env->params->low_unsigned; ir_mode *mode = env->params->low_unsigned;
ir_node *low = new_r_Conv(irg, block, lentry->low_word, mode, 0); ir_node *low = new_r_Conv(irg, block, lentry->low_word, mode);
ir_node *high = new_r_Conv(irg, block, lentry->high_word, mode, 0); ir_node *high = new_r_Conv(irg, block, lentry->high_word, mode);
ir_node *or = new_rd_Or(dbg, irg, block, low, high, mode); ir_node *or = new_rd_Or(dbg, irg, block, low, high, mode);
ir_node *cmp = new_rd_Cmp(dbg, irg, block, or, new_Const_long(mode, 0)); ir_node *cmp = new_rd_Cmp(dbg, irg, block, or, new_Const_long(mode, 0));
...@@ -1497,17 +1497,17 @@ static void lower_Conv_to_Ls(ir_node *node, lower_env_t *env) { ...@@ -1497,17 +1497,17 @@ static void lower_Conv_to_Ls(ir_node *node, lower_env_t *env) {
pdeq_putr(env->waitq, node); pdeq_putr(env->waitq, node);
return; return;
} /* if */ } /* if */
env->entries[idx]->low_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->low_word, dst_mode_l, 0); env->entries[idx]->low_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->low_word, dst_mode_l);
env->entries[idx]->high_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->high_word, dst_mode_h, 0); env->entries[idx]->high_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->high_word, dst_mode_h);
} else { } else {
/* simple case: create a high word */ /* simple case: create a high word */
if (imode != dst_mode_l) if (imode != dst_mode_l)
op = new_rd_Conv(dbg, irg, block, op, dst_mode_l, 0); op = new_rd_Conv(dbg, irg, block, op, dst_mode_l);
env->entries[idx]->low_word = op; env->entries[idx]->low_word = op;
if (mode_is_signed(imode)) { if (mode_is_signed(imode)) {
ir_node *op_conv = new_rd_Conv(dbg, irg, block, op, dst_mode_h, 0); ir_node *op_conv = new_rd_Conv(dbg, irg, block, op, dst_mode_h);
env->entries[idx]->high_word = new_rd_Shrs(dbg, irg, block, op_conv, env->entries[idx]->high_word = new_rd_Shrs(dbg, irg, block, op_conv,
new_Const_long(dst_mode_l, get_mode_size_bits(dst_mode_h) - 1), dst_mode_h); new_Const_long(dst_mode_l, get_mode_size_bits(dst_mode_h) - 1), dst_mode_h);
} else { } else {
...@@ -1553,12 +1553,12 @@ static void lower_Conv_to_Lu(ir_node *node, lower_env_t *env) { ...@@ -1553,12 +1553,12 @@ static void lower_Conv_to_Lu(ir_node *node, lower_env_t *env) {
pdeq_putr(env->waitq, node); pdeq_putr(env->waitq, node);
return; return;
} /* if */ } /* if */
env->entries[idx]->low_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->low_word, dst_mode, 0); env->entries[idx]->low_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->low_word, dst_mode);
env->entries[idx]->high_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->high_word, dst_mode, 0); env->entries[idx]->high_word = new_rd_Conv(dbg, irg, block, env->entries[op_idx]->high_word, dst_mode);