Commit 7311b751 authored by Matthias Braun's avatar Matthias Braun
Browse files

Avoid using new_r_Const_long for float modes

This fixes xaos-formulas.c in the firm-testsuite.
parent 66b7f33e
......@@ -3001,7 +3001,15 @@ static ir_node *transform_node_Add(ir_node *n)
ir_node *const block = get_nodes_block(n);
if (!irg_is_constrained(irg, IR_GRAPH_CONSTRAINT_ARCH_DEP)) {
/* a + a -> a * 2 */
ir_node *const two = new_r_Const_long(irg, mode, 2);
ir_tarval *tv_two;
if (get_mode_arithmetic(mode) == irma_twos_complement) {
tv_two = new_tarval_from_long(2, mode);
} else {
assert(mode_is_float(mode));
tv_two = new_tarval_from_long(2, mode_Is);
tv_two = tarval_convert_to(tv_two, mode);
}
ir_node *const two = new_r_Const(irg, tv_two);
n = new_rd_Mul(dbgi, block, a, two, mode);
DBG_OPT_ALGSIM0(oldn, n);
return n;
......
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