#ifdef HAVE_CONFIG_H
-#include <config.h>
+#include "config.h"
#endif
#include "irgraph_t.h"
#include "besched_t.h"
#include "beinsn_t.h"
+#include "beirg_t.h"
#include "beabi.h"
#include "raw_bitset.h"
/* Compute the admissible registers bitsets. */
for (i = 0; i < insn->n_ops; ++i) {
be_operand_t *op = &insn->ops[i];
- const arch_register_req_t *req = op->req;
-
-#if 0
- // Matze: can we do without this?
- if (req->cls == NULL && req->type == arch_register_req_type_none) {
- req->cls = env->cls;
- req->type = arch_register_req_type_normal;
+ const arch_register_req_t *req = op->req;
+ const arch_register_class_t *cls = req->cls;
+ arch_register_req_type_t type = req->type;
+
+ /* If there is no special requirement, we allow current class here */
+ if (cls == NULL && req->type == arch_register_req_type_none) {
+ cls = env->cls;
+ type = arch_register_req_type_normal;
}
-#endif
- assert(req->cls == env->cls);
+ assert(cls == env->cls);
op->regs = bitset_obstack_alloc(obst, env->cls->n_regs);
- if (arch_register_req_is(req, limited)) {
+ if (type & arch_register_req_type_limited) {
rbitset_copy_to_bitset(req->limited, op->regs);
} else {
arch_put_non_ignore_regs(arch_env, env->cls, op->regs);
return insn;
}
-be_insn_env_t *be_insn_env_init(be_insn_env_t *ie, const be_irg_t *birg, const arch_register_class_t *cls, struct obstack *obst)
+be_insn_env_t *be_insn_env_init(be_insn_env_t *ie, const be_irg_t *birg,
+ const arch_register_class_t *cls,
+ struct obstack *obst)
{
- ie->aenv = birg->main_env->arch_env;
+ ie->aenv = be_get_birg_arch_env(birg);
ie->cls = cls;
ie->obst = obst;
ie->ignore_colors = bitset_obstack_alloc(obst, cls->n_regs);