#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"
#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
* @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:
}
/* dump AM scale */
- fprintf(F, "AM scale = %d\n", get_ia32_am_scale(n));
+ fprintf(F, "AM scale = %u\n", get_ia32_am_scale(n));
/* dump pn code */
if (is_ia32_SwitchJmp(n)) {
} else if (is_ia32_CMovcc(n) || is_ia32_Setcc(n) || is_ia32_Jcc(n)) {
ia32_attr_t *attr = get_ia32_attr(n);
long pnc = get_ia32_condcode(n);
- fprintf(F, "pn_code = 0x%lX (%s)\n", pnc, get_pnc_string(pnc & pn_Cmp_True));
+ fprintf(F, "pn_code = 0x%X (%s)\n", (unsigned) pnc,
+ get_pnc_string(pnc & pn_Cmp_True));
fprintf(F, "ins_permuted = %u \n", attr->data.ins_permuted);
fprintf(F, "cmp_unsigned = %u \n", attr->data.cmp_unsigned);
}
fprintf(F, "commutative = %d\n", is_ia32_commutative(n));
fprintf(F, "need stackent = %d\n", is_ia32_need_stackent(n));
fprintf(F, "is reload = %d\n", is_ia32_is_reload(n));
- fprintf(F, "latency = %d\n", get_ia32_latency(n));
+ fprintf(F, "latency = %u\n", get_ia32_latency(n));
/* dump frame entity */
fprintf(F, "frame entity = ");
break;
}
-
- return bad;
}
-/***************************************************************************************************
- * _ _ _ __ _ _ _ _
- * | | | | | | / / | | | | | | | |
- * __ _| |_| |_ _ __ ___ ___| |_ / /_ _ ___| |_ _ __ ___ ___| |_| |__ ___ __| |___
- * / _` | __| __| '__| / __|/ _ \ __| / / _` |/ _ \ __| | '_ ` _ \ / _ \ __| '_ \ / _ \ / _` / __|
- * | (_| | |_| |_| | \__ \ __/ |_ / / (_| | __/ |_ | | | | | | __/ |_| | | | (_) | (_| \__ \
- * \__,_|\__|\__|_| |___/\___|\__/_/ \__, |\___|\__| |_| |_| |_|\___|\__|_| |_|\___/ \__,_|___/
- * __/ |
- * |___/
- ***************************************************************************************************/
-
ia32_attr_t *get_ia32_attr(ir_node *node)
{
assert(is_ia32_irn(node) && "need ia32 node to get ia32 attributes");
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.
*/
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);
#endif /* NDEBUG */
-/******************************************************************************************************
- * _ _ _ _ __ _ _
- * (_) | | | | | | / _| | | (_)
- * ___ _ __ ___ ___ _ __ _| | __ _| |_| |_ _ __ | |_ _ _ _ __ ___| |_ _ ___ _ __ ___
- * / __| '_ \ / _ \/ __| |/ _` | | / _` | __| __| '__| | _| | | | '_ \ / __| __| |/ _ \| '_ \ / __|
- * \__ \ |_) | __/ (__| | (_| | | | (_| | |_| |_| | | | | |_| | | | | (__| |_| | (_) | | | | \__ \
- * |___/ .__/ \___|\___|_|\__,_|_| \__,_|\__|\__|_| |_| \__,_|_| |_|\___|\__|_|\___/|_| |_| |___/
- * | |
- * |_|
- ******************************************************************************************************/
/**
* Returns whether or not the node is an AddrModeS node.
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
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)
attr->count = count;
}
-/***************************************************************************************
- * _ _ _
- * | | | | | |
- * _ __ ___ __| | ___ ___ ___ _ __ ___| |_ _ __ _ _ ___| |_ ___ _ __ ___
- * | '_ \ / _ \ / _` |/ _ \ / __/ _ \| '_ \/ __| __| '__| | | |/ __| __/ _ \| '__/ __|
- * | | | | (_) | (_| | __/ | (_| (_) | | | \__ \ |_| | | |_| | (__| || (_) | | \__ \
- * |_| |_|\___/ \__,_|\___| \___\___/|_| |_|___/\__|_| \__,_|\___|\__\___/|_| |___/
- *
- ***************************************************************************************/
/* default compare operation to compare attributes */
-int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b)
+static int ia32_compare_attr(const ia32_attr_t *a, const ia32_attr_t *b)
{
if (a->data.tp != b->data.tp)
return 1;
/* 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 */