X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fia32%2Fia32_new_nodes.c;h=0c3805ad86f7c4198ed52b2b32312a38521802c0;hb=753110deda395f7ecae4a26a46d11768e8a63cb0;hp=a0a1cf6a85aac66dfad47445b477898f0e90939d;hpb=a6e674f74ea93c3661f100088db520acb701571f;p=libfirm diff --git a/ir/be/ia32/ia32_new_nodes.c b/ir/be/ia32/ia32_new_nodes.c index a0a1cf6a8..0c3805ad8 100644 --- a/ir/be/ia32/ia32_new_nodes.c +++ b/ir/be/ia32/ia32_new_nodes.c @@ -38,7 +38,7 @@ #include "ircons_t.h" #include "iropt_t.h" #include "irop.h" -#include "irvrfy_t.h" +#include "irverify_t.h" #include "irprintf.h" #include "iredges.h" #include "error.h" @@ -55,17 +55,6 @@ #include "gen_ia32_regalloc_if.h" #include "gen_ia32_machine.h" -/*********************************************************************************** - * _ _ _ __ - * | | (_) | | / _| - * __| |_ _ _ __ ___ _ __ ___ _ __ _ _ __ | |_ ___ _ __| |_ __ _ ___ ___ - * / _` | | | | '_ ` _ \| '_ \ / _ \ '__| | | '_ \| __/ _ \ '__| _/ _` |/ __/ _ \ - * | (_| | |_| | | | | | | |_) | __/ | | | | | | || __/ | | || (_| | (_| __/ - * \__,_|\__,_|_| |_| |_| .__/ \___|_| |_|_| |_|\__\___|_| |_| \__,_|\___\___| - * | | - * |_| - ***********************************************************************************/ - /** * Dumper interface for dumping ia32 nodes in vcg. * @param n the node to dump @@ -73,10 +62,9 @@ * @param reason indicates which kind of information should be dumped * @return 0 on success or != 0 on failure */ -static int ia32_dump_node(ir_node *n, FILE *F, dump_reason_t reason) +static void ia32_dump_node(FILE *F, ir_node *n, dump_reason_t reason) { - ir_mode *mode = NULL; - int bad = 0; + ir_mode *mode = NULL; switch (reason) { case dump_node_opcode_txt: @@ -250,23 +238,10 @@ static int ia32_dump_node(ir_node *n, FILE *F, dump_reason_t reason) break; } - - return bad; } -/*************************************************************************************************** - * _ _ _ __ _ _ _ _ - * | | | | | | / / | | | | | | | | - * __ _| |_| |_ _ __ ___ ___| |_ / /_ _ ___| |_ _ __ ___ ___| |_| |__ ___ __| |___ - * / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __| - * | (_| | |_| |_| | \__ \ __/ |_ / / (_| | __/ |_ | | | | | | __/ |_| | | | (_) | (_| \__ \ - * \__,_|\__|\__|_| |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/ - * __/ | - * |___/ - ***************************************************************************************************/ - ia32_attr_t *get_ia32_attr(ir_node *node) { assert(is_ia32_irn(node) && "need ia32 node to get ia32 attributes"); @@ -387,7 +362,7 @@ const ia32_climbframe_attr_t *get_ia32_climbframe_attr_const(const ir_node *node ia32_op_type_t get_ia32_op_type(const ir_node *node) { const ia32_attr_t *attr = get_ia32_attr_const(node); - return attr->data.tp; + return (ia32_op_type_t)attr->data.tp; } /** @@ -402,7 +377,7 @@ void set_ia32_op_type(ir_node *node, ia32_op_type_t tp) ia32_am_type_t get_ia32_am_support(const ir_node *node) { const ia32_attr_t *attr = get_ia32_attr_const(node); - return attr->data.am_arity; + return (ia32_am_type_t)attr->data.am_arity; } /** @@ -674,45 +649,6 @@ unsigned get_ia32_latency(const ir_node *node) return op_attr->latency; } -/** - * Returns the argument register requirements of an ia32 node. - */ -const arch_register_req_t **get_ia32_in_req_all(const ir_node *node) -{ - const ia32_attr_t *attr = get_ia32_attr_const(node); - return attr->in_req; -} - -/** - * Sets the argument register requirements of an ia32 node. - */ -void set_ia32_in_req_all(ir_node *node, const arch_register_req_t **reqs) -{ - ia32_attr_t *attr = get_ia32_attr(node); - attr->in_req = reqs; -} - -/** - * Returns the argument register requirement at position pos of an ia32 node. - */ -const arch_register_req_t *get_ia32_in_req(const ir_node *node, int pos) -{ - const ia32_attr_t *attr = get_ia32_attr_const(node); - if (attr->in_req == NULL) - return arch_no_register_req; - - return attr->in_req[pos]; -} - -/** - * Sets the IN register requirements at position pos. - */ -void set_ia32_req_in(ir_node *node, const arch_register_req_t *req, int pos) -{ - ia32_attr_t *attr = get_ia32_attr(node); - attr->in_req[pos] = req; -} - /** * Returns the condition code of a node. */ @@ -802,11 +738,12 @@ const char *get_ia32_orig_node(const ir_node *node) static const char *ia32_get_old_node_name(const ir_node *irn) { - struct obstack *obst = env_cg->isa->name_obst; + ir_graph *irg = get_irn_irg(irn); + struct obstack *obst = be_get_be_obst(irg); lc_eoprintf(firm_get_arg_env(), obst, "%+F", irn); obstack_1grow(obst, 0); - return obstack_finish(obst); + return (const char*)obstack_finish(obst); } /** @@ -821,16 +758,6 @@ void set_ia32_orig_node(ir_node *node, const ir_node *old) #endif /* NDEBUG */ -/****************************************************************************************************** - * _ _ _ _ __ _ _ - * (_) | | | | | | / _| | | (_) - * ___ _ __ ___ ___ _ __ _| | __ _| |_| |_ _ __ | |_ _ _ _ __ ___| |_ _ ___ _ __ ___ - * / __| '_ \ / _ \/ __| |/ _` | | / _` | __| __| '__| | _| | | | '_ \ / __| __| |/ _ \| '_ \ / __| - * \__ \ |_) | __/ (__| | (_| | | | (_| | |_| |_| | | | | |_| | | | | (__| |_| | (_) | | | | \__ \ - * |___/ .__/ \___|\___|_|\__,_|_| \__,_|\__|\__|_| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_| |___/ - * | | - * |_| - ******************************************************************************************************/ /** * Returns whether or not the node is an AddrModeS node. @@ -876,7 +803,7 @@ void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, backend_info_t *info; arch_irn_set_flags(node, flags); - set_ia32_in_req_all(node, in_reqs); + arch_set_in_register_reqs(node, in_reqs); attr->exec_units = execution_units; #ifndef NDEBUG @@ -890,13 +817,15 @@ void init_ia32_attributes(ir_node *node, arch_irn_flags_t flags, void init_ia32_x87_attributes(ir_node *res) { + ir_graph *irg = get_irn_irg(res); + ia32_irg_data_t *irg_data = ia32_get_irg_data(irg); #ifndef NDEBUG ia32_attr_t *attr = get_ia32_attr(res); attr->attr_type |= IA32_ATTR_ia32_x87_attr_t; #else (void) res; #endif - ia32_current_cg->do_x87_sim = 1; + irg_data->do_x87_sim = 1; } void init_ia32_asm_attributes(ir_node *res) @@ -913,7 +842,7 @@ void init_ia32_immediate_attributes(ir_node *res, ir_entity *symconst, int symconst_sign, int no_pic_adjust, long offset) { - ia32_immediate_attr_t *attr = get_irn_generic_attr(res); + ia32_immediate_attr_t *attr = (ia32_immediate_attr_t*)get_irn_generic_attr(res); #ifndef NDEBUG attr->attr.attr_type |= IA32_ATTR_ia32_immediate_attr_t; @@ -926,7 +855,7 @@ void init_ia32_immediate_attributes(ir_node *res, ir_entity *symconst, void init_ia32_call_attributes(ir_node* res, unsigned pop, ir_type* call_tp) { - ia32_call_attr_t *attr = get_irn_generic_attr(res); + ia32_call_attr_t *attr = (ia32_call_attr_t*)get_irn_generic_attr(res); #ifndef NDEBUG attr->attr.attr_type |= IA32_ATTR_ia32_call_attr_t; @@ -937,7 +866,7 @@ void init_ia32_call_attributes(ir_node* res, unsigned pop, ir_type* call_tp) void init_ia32_copyb_attributes(ir_node *res, unsigned size) { - ia32_copyb_attr_t *attr = get_irn_generic_attr(res); + ia32_copyb_attr_t *attr = (ia32_copyb_attr_t*)get_irn_generic_attr(res); #ifndef NDEBUG attr->attr.attr_type |= IA32_ATTR_ia32_copyb_attr_t; @@ -947,7 +876,7 @@ void init_ia32_copyb_attributes(ir_node *res, unsigned size) void init_ia32_condcode_attributes(ir_node *res, long pnc) { - ia32_condcode_attr_t *attr = get_irn_generic_attr(res); + ia32_condcode_attr_t *attr = (ia32_condcode_attr_t*)get_irn_generic_attr(res); #ifndef NDEBUG attr->attr.attr_type |= IA32_ATTR_ia32_condcode_attr_t; @@ -957,7 +886,7 @@ void init_ia32_condcode_attributes(ir_node *res, long pnc) void init_ia32_climbframe_attributes(ir_node *res, unsigned count) { - ia32_climbframe_attr_t *attr = get_irn_generic_attr(res); + ia32_climbframe_attr_t *attr = (ia32_climbframe_attr_t*)get_irn_generic_attr(res); #ifndef NDEBUG attr->attr.attr_type |= IA32_ATTR_ia32_climbframe_attr_t; @@ -965,15 +894,6 @@ void init_ia32_climbframe_attributes(ir_node *res, unsigned count) attr->count = count; } -/*************************************************************************************** - * _ _ _ - * | | | | | | - * _ __ ___ __| | ___ ___ ___ _ __ ___| |_ _ __ _ _ ___| |_ ___ _ __ ___ - * | '_ \ / _ \ / _` |/ _ \ / __/ _ \| '_ \/ __| __| '__| | | |/ __| __/ _ \| '__/ __| - * | | | | (_) | (_| | __/ | (_| (_) | | | \__ \ |_| | | |_| | (__| || (_) | | \__ \ - * |_| |_|\___/ \__,_|\___| \___\___/|_| |_|___/\__|_| \__,_|\___|\__\___/|_| |___/ - * - ***************************************************************************************/ /* default compare operation to compare attributes */ static int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b) @@ -1161,6 +1081,7 @@ static void ia32_copy_attr(ir_graph *irg, const ir_node *old_node, /* copy out flags */ new_info->out_infos = DUP_ARR_D(reg_out_info_t, obst, old_info->out_infos); + new_info->in_reqs = old_info->in_reqs; } /* Include the generated constructor functions */