From a16a4fcf585928db00a34c5b82ea9b45625ede62 Mon Sep 17 00:00:00 2001 From: Sebastian Hack Date: Thu, 16 Feb 2006 14:35:24 +0000 Subject: [PATCH] Added register requirements transfer function --- ir/be/benode.c | 23 +++++++++++++++++++++++ ir/be/benode_t.h | 16 +++++++--------- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/ir/be/benode.c b/ir/be/benode.c index 4b3786a75..c90b25411 100644 --- a/ir/be/benode.c +++ b/ir/be/benode.c @@ -291,6 +291,29 @@ void be_set_constr_single_reg(ir_node *irn, int pos, const arch_register_t *reg) r->req.cls = reg->reg_class; } +void be_set_constr_limited(ir_node *irn, int pos, const arch_register_req_t *req) +{ + int idx = pos < 0 ? -(pos - 1) : pos; + be_node_attr_t *a = get_irn_attr(irn); + be_reg_data_t *rd = &a->reg_data[idx]; + be_req_t *r = pos < 0 ? &rd->req : &rd->in_req; + + assert(is_be_node(irn)); + assert(!(pos >= 0) || pos < get_irn_arity(irn)); + assert(!(pos < 0) || -(pos + 1) <= a->n_outs); + assert(arch_register_req_is(req, limited)); + + r->kind = be_req_kind_old_limited; + r->req.limited = be_limited; + r->req.limited_env = r; + r->req.type = arch_register_req_type_limited; + r->req.cls = req->cls; + + r->x.old_limited.old_limited = req->limited; + r->x.old_limited.old_limited_env = req->limited_env; +} + + void be_set_IncSP_offset(ir_node *irn, int offset) { diff --git a/ir/be/benode_t.h b/ir/be/benode_t.h index 0115024f9..7a9cff543 100644 --- a/ir/be/benode_t.h +++ b/ir/be/benode_t.h @@ -81,16 +81,14 @@ ir_node *be_get_Spill_context(const ir_node *irn); void be_set_constr_single_reg(ir_node *irn, int pos, const arch_register_t *reg); /** - * Modify the output register requirements of a Perm. - * This function incur register constraints to an output value of a Perm. - * This is used when handling register constraints in general, - * see beconstrperm.c - * @param irn The perm node. - * @param pos The position. - * @param req The requirements to set to. - * @param negate_limited When the requirements are limited, inverse the set of admissible registers. + * Impose register constraints on a backend node. + * The register subsets given by the limited function in @p req are copied to the backend node. + * This requires that the constraint type of the @p req is arch_register_req_type_limited. + * @param irn The backend node. + * @param pos The position (@see be_set_constr_single_reg()). + * @param req The register requirements which shall be transferred. */ -void be_set_Perm_out_req(ir_node *irn, int pos, const arch_register_req_t *req, unsigned negate_limited); +void be_set_constr_limited(ir_node *irn, int pos, const arch_register_req_t *req); /** * Insert a Perm node after a specific node in the schedule. -- 2.20.1