X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Farch%2Farchop.c;h=f6ffe603efe2e89c85da6b1a3f4dc4b0401ef59f;hb=0decb677fb069c9d47f5285f12fdb983dca7fdae;hp=57fe2a8cb05097d71ef7da660fbb23fc2229775d;hpb=99a6ae39a8b6c6d4d97361721b894e84690d5958;p=libfirm diff --git a/ir/arch/archop.c b/ir/arch/archop.c index 57fe2a8cb..f6ffe603e 100644 --- a/ir/arch/archop.c +++ b/ir/arch/archop.c @@ -184,7 +184,7 @@ static tarval *computed_value_Max(ir_node *n) /** * Returns an equivalent node for a Min/Max node. - * We do not allow Exeptions in our Min/Max, so there will be always + * We do not allow Exceptions in our Min/Max, so there will be always * an result. * The problem is Min(NaN, NaN) == NaN ???. */ @@ -199,7 +199,7 @@ static ir_node *equivalent_node_MinMax(ir_node *n) b = get_binop_right(n); if (a == b) { - DBG_OPT_ALGSIM0(n, a); + DBG_OPT_ALGSIM0(n, a, FS_OPT_MIN_MAX_EQ); return a; } @@ -210,7 +210,7 @@ static ir_node *equivalent_node_MinMax(ir_node *n) #define equivalent_node_Max equivalent_node_MinMax /* - * Create Min and Mux from Mux nodes + * Create Min and Max from Mux nodes */ ir_node *arch_transform_node_Mux(ir_node *n) { @@ -239,7 +239,7 @@ ir_node *arch_transform_node_Mux(ir_node *n) a, b, get_irn_mode(n)); - DBG_OPT_ALGSIM1(oldn, cmp, proj, n); + DBG_OPT_ALGSIM1(oldn, cmp, proj, n, FS_OPT_MUX_TO_MIN); return n; } else if (a == f && b == t) { @@ -250,7 +250,7 @@ ir_node *arch_transform_node_Mux(ir_node *n) a, b, get_irn_mode(n)); - DBG_OPT_ALGSIM1(oldn, cmp, proj, n); + DBG_OPT_ALGSIM1(oldn, cmp, proj, n, FS_OPT_MUX_TO_MAX); return n; } } @@ -263,7 +263,7 @@ ir_node *arch_transform_node_Mux(ir_node *n) a, b, get_irn_mode(n)); - DBG_OPT_ALGSIM1(oldn, cmp, proj, n); + DBG_OPT_ALGSIM1(oldn, cmp, proj, n, FS_OPT_MUX_TO_MAX); return n; } else if (a == f && b == t) { @@ -274,7 +274,7 @@ ir_node *arch_transform_node_Mux(ir_node *n) a, b, get_irn_mode(n)); - DBG_OPT_ALGSIM1(oldn, cmp, proj, n); + DBG_OPT_ALGSIM1(oldn, cmp, proj, n, FS_OPT_MUX_TO_MIN); return n; } } @@ -306,20 +306,26 @@ static int verify_node_MinMax(ir_node *n, ir_graph *irg) { */ void firm_archops_init(const arch_ops_info *info) { + ir_op_ops ops; + if (! info) info = &default_settings; memcpy(&settings, info, sizeof(settings)); if (info->enabled_ops & ARCH_OPS_MINMAX) { - op_Min = new_ir_op(get_next_ir_opcode(), "Min", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0); - op_Min->computed_value = computed_value_Min; - op_Min->equivalent_node = equivalent_node_Min; - op_Min->verify_node = verify_node_MinMax; - - op_Max = new_ir_op(get_next_ir_opcode(), "Max", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0); - op_Max->computed_value = computed_value_Max; - op_Max->equivalent_node = equivalent_node_Max; - op_Max->verify_node = verify_node_MinMax; + memset(&ops, 0, sizeof(ops)); + + ops.computed_value = computed_value_Min; + ops.equivalent_node = equivalent_node_Min; + ops.verify_node = verify_node_MinMax; + + op_Min = new_ir_op(get_next_ir_opcode(), "Min", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0, &ops); + + ops.computed_value = computed_value_Max; + ops.equivalent_node = equivalent_node_Max; + ops.verify_node = verify_node_MinMax; + + op_Max = new_ir_op(get_next_ir_opcode(), "Max", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0, &ops); } }