return 0;
}
+int arch_get_n_operands(const arch_env_t *env, const ir_node *irn, int in_out)
+{
+ const arch_irn_ops_t *ops = get_irn_ops(env, irn);
+ return ops->get_n_operands(ops, irn, in_out);
+}
+
int arch_is_register_operand(const arch_env_t *env,
const ir_node *irn, int pos)
{
int arch_reg_is_allocatable(const arch_env_t *env, const ir_node *irn,
int pos, const arch_register_t *reg)
{
- const arch_register_class_t *cls = arch_register_get_class(reg);
- int n_regs = arch_register_class_n_regs(cls);
- bitset_t *bs = bitset_alloca(n_regs);
-
- arch_get_allocatable_regs(env, irn, pos, cls, bs);
- return bitset_is_set(bs, arch_register_get_index(reg));
+ int res = 0;
+ arch_register_req_t req;
+
+ arch_get_register_req(env, &req, irn, pos);
+ switch(req.type) {
+ case arch_register_req_type_normal:
+ res = req.cls == reg->reg_class;
+ break;
+ case arch_register_req_type_limited:
+ {
+ bitset_t *bs = bitset_alloca(req.cls->n_regs);
+ req.data.limited(irn, pos, bs);
+ res = bitset_is_set(bs, arch_register_get_index(reg));
+ }
+ default:
+ res = 0;
+ }
+
+ return res;
}
const arch_register_class_t *
const arch_irn_ops_t *ops = get_irn_ops(env, irn);
return ops->classify(ops, irn);
}
+
+extern arch_irn_flags_t arch_irn_get_flags(const arch_env_t *env, const ir_node *irn)
+{
+ const arch_irn_ops_t *ops = get_irn_ops(env, irn);
+ return ops->get_flags(ops, irn);
+}