Commit a16a4fcf authored by Sebastian Hack's avatar Sebastian Hack
Browse files

Added register requirements transfer function

parent c0a211ef
......@@ -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)
{
......
......@@ -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.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment