+
+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->impl->get_flags(ops, irn);
+}
+
+extern const char *arch_irn_flag_str(arch_irn_flags_t fl)
+{
+ switch(fl) {
+#define XXX(x) case arch_irn_flags_ ## x: return #x;
+ XXX(dont_spill);
+ XXX(ignore);
+ XXX(rematerializable);
+ XXX(modify_sp);
+ XXX(none);
+#undef XXX
+ }
+ return "n/a";
+}
+
+extern char *arch_register_req_format(char *buf, size_t len,
+ const arch_register_req_t *req,
+ const ir_node *node)
+{
+ char tmp[128];
+ snprintf(buf, len, "class: %s", req->cls->name);
+
+ if(arch_register_req_is(req, limited)) {
+ unsigned n_regs = req->cls->n_regs;
+ unsigned i;
+
+ strncat(buf, " limited:", len);
+ for(i = 0; i < n_regs; ++i) {
+ if(rbitset_is_set(req->limited, i)) {
+ const arch_register_t *reg = &req->cls->regs[i];
+ strncat(buf, " ", len);
+ strncat(buf, reg->name, len);
+ }
+ }
+ }
+
+ if(arch_register_req_is(req, should_be_same)) {
+ const ir_node *same = get_irn_n(skip_Proj_const(node), req->other_same);
+ ir_snprintf(tmp, sizeof(tmp), " same to: %+F", same);
+ strncat(buf, tmp, len);
+ }
+
+ if(arch_register_req_is(req, should_be_different)) {
+ const ir_node *different = get_irn_n(skip_Proj_const(node), req->other_different);
+ ir_snprintf(tmp, sizeof(tmp), " different to: %+F", different);
+ strncat(buf, tmp, len);
+ }
+
+ return buf;
+}
+
+static const arch_register_req_t no_requirement = {
+ arch_register_req_type_none,
+ NULL,
+ NULL,
+ -1,
+ -1
+};
+const arch_register_req_t *arch_no_register_req = &no_requirement;