X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firarch.c;h=cf0ed67508f0ae9fe112454671977ed21b6460c4;hb=b78bdd4d94de46de4156272e6dbfe44e97933a5b;hp=7f15232ba9e6c3d0cf565b9cb97fc173739d50a5;hpb=9372d5147d6b19582b1a6ea35586630d225ae532;p=libfirm diff --git a/ir/ir/irarch.c b/ir/ir/irarch.c index 7f15232ba..cf0ed6750 100644 --- a/ir/ir/irarch.c +++ b/ir/ir/irarch.c @@ -1,12 +1,19 @@ /** * @file irarch.c * @date 28.9.2004 - * @author Sebastian Hack + * @author Sebastian Hack, Michael Beck * @brief Machine dependent firm optimizations. * * $Id$ */ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_STDLIB_H +# include +#endif + #include #include "irnode_t.h" @@ -55,22 +62,6 @@ new_rd_Mulh (dbg_info *db, ir_graph *irg, ir_node *block, ir_node *in[2]; ir_node *res; - if (! op_Mulh) { - rflct_sig_t *sig; - int mulh_opc = get_next_ir_opcode(); - - op_Mulh = new_ir_op(mulh_opc, "Mulh", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0); - sig = rflct_signature_allocate(1, 3); - rflct_signature_set_arg(sig, 0, 0, "Res", RFLCT_MC(Int), 0, 0); - rflct_signature_set_arg(sig, 1, 0, "Block", RFLCT_MC(BB), 0, 0); - rflct_signature_set_arg(sig, 1, 1, "Op 0", RFLCT_MC(Int), 0, 0); - rflct_signature_set_arg(sig, 1, 2, "Op 1", RFLCT_MC(Int), 0, 0); - - rflct_new_opcode(mulh_opc, "Mulh", false); - rflct_opcode_add_signature(mulh_opc, sig); - - } - in[0] = op1; in[1] = op2; res = new_ir_node(db, irg, block, op_Mulh, mode, 2, in); @@ -88,11 +79,20 @@ void arch_dep_init(arch_dep_params_factory_t factory) if (factory != NULL) params = factory(); - if (params && (opts & (arch_dep_div_by_const|arch_dep_mod_by_const))) { - if (! op_Mulh) { - /* create the Mulh operation */ - op_Mulh = new_ir_op(get_next_ir_opcode(), "Mulh", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0); - } + if (! op_Mulh) { + rflct_sig_t *sig; + int mulh_opc = get_next_ir_opcode(); + + /* create the Mulh operation */ + op_Mulh = new_ir_op(mulh_opc, "Mulh", op_pin_state_floats, irop_flag_commutative, oparity_binary, 0, 0, NULL); + sig = rflct_signature_allocate(1, 3); + rflct_signature_set_arg(sig, 0, 0, "Res", RFLCT_MC(Int), 0, 0); + rflct_signature_set_arg(sig, 1, 0, "Block", RFLCT_MC(BB), 0, 0); + rflct_signature_set_arg(sig, 1, 1, "Op 0", RFLCT_MC(Int), 0, 0); + rflct_signature_set_arg(sig, 1, 2, "Op 1", RFLCT_MC(Int), 0, 0); + + rflct_new_opcode(mulh_opc, "Mulh", 0); + rflct_opcode_add_signature(mulh_opc, sig); } } @@ -716,7 +716,7 @@ ir_node *arch_dep_replace_div_by_const(ir_node *irn) } if (res != irn) - hook_arch_dep_replace_div_by_const(irn); + hook_arch_dep_replace_division_by_const(irn); return res; } @@ -807,7 +807,7 @@ ir_node *arch_dep_replace_mod_by_const(ir_node *irn) } if (res != irn) - hook_arch_dep_replace_mod_by_const(irn); + hook_arch_dep_replace_division_by_const(irn); return res; } @@ -914,7 +914,7 @@ void arch_dep_replace_divmod_by_const(ir_node **div, ir_node **mod, ir_node *irn } if (*div) - hook_arch_dep_replace_DivMod_by_const(irn); + hook_arch_dep_replace_division_by_const(irn); }