Only makes it hard to search for arch_register_type_* flags.
[r28185]
assert(reg && "no in register found");
/* in case of a joker register: just return a valid register */
- if (arch_register_type_is(reg, joker)) {
+ if (reg->type & arch_register_type_joker) {
const arch_register_req_t *req = arch_get_register_req(irn, pos);
if (arch_register_req_is(req, limited)) {
if (reg == arch_env->sp || reg == arch_env->bp)
continue;
- if (arch_register_type_is(reg, state)) {
+ if (reg->type & arch_register_type_state) {
ARR_APP1(const arch_register_t*, destroyed_regs, reg);
ARR_APP1(const arch_register_t*, states, reg);
/* we're already in the destroyed set so no need for further
* checking */
continue;
}
- if (destroy_all_regs || arch_register_type_is(reg, caller_save)) {
- if (! arch_register_type_is(reg, ignore)) {
+ if (destroy_all_regs || (reg->type & arch_register_type_caller_save)) {
+ if (!(reg->type & arch_register_type_ignore)) {
ARR_APP1(const arch_register_t*, destroyed_regs, reg);
}
}
/* Add uses of the callee save registers. */
foreach_pmap(env->regs, ent) {
const arch_register_t *reg = (const arch_register_t*)ent->key;
- if (arch_register_type_is(reg, callee_save) || arch_register_type_is(reg, ignore))
+ if (reg->type & (arch_register_type_callee_save | arch_register_type_ignore))
pmap_insert(reg_map, ent->key, ent->value);
}
const arch_register_class_t *cls = &arch_env->register_classes[i];
for (j = 0; j < cls->n_regs; ++j) {
const arch_register_t *reg = &cls->regs[j];
- if (arch_register_type_is(reg, callee_save) ||
- arch_register_type_is(reg, state)) {
+ if (reg->type & (arch_register_type_callee_save | arch_register_type_state)) {
pmap_insert(env->regs, (void *) reg, NULL);
}
}
const arch_register_class_t *cls = &arch_env->register_classes[i];
for (j = 0; j < cls->n_regs; ++j) {
const arch_register_t *reg = arch_register_for_index(cls, j);
- if (arch_register_type_is(reg, state)) {
+ if (reg->type & arch_register_type_state) {
ARR_APP1(arch_register_t*, stateregs, (arch_register_t *)reg);
}
}
ir_node *be_abi_get_callee_save_irn(be_abi_irg_t *abi, const arch_register_t *reg)
{
- assert(arch_register_type_is(reg, callee_save));
+ assert(reg->type & arch_register_type_callee_save);
assert(pmap_contains(abi->regs, (void *) reg));
return (ir_node*)pmap_get(abi->regs, (void *) reg);
}
ir_node *be_abi_get_ignore_irn(be_abi_irg_t *abi, const arch_register_t *reg)
{
- assert(arch_register_type_is(reg, ignore));
+ assert(reg->type & arch_register_type_ignore);
assert(pmap_contains(abi->regs, (void *) reg));
return (ir_node*)pmap_get(abi->regs, (void *) reg);
}
return reg->name;
}
-/**
- * Convenience macro to check for register type.
- * @param req A pointer to register.
- * @param kind The kind of type to check for (see arch_register_type_t).
- * @return 1, If register is of given kind, 0 if not.
- */
-#define arch_register_type_is(reg, kind) \
- (((reg)->type & arch_register_type_ ## kind) != 0)
-
/**
* A class of registers.
* Like general purpose or floating point.
if (reg == NULL) {
panic("No register assigned at %+F", node);
}
- if (arch_register_type_is(reg, virtual))
+ if (reg->type & arch_register_type_virtual)
return;
cls = arch_register_get_class(reg);
reg_idx = arch_register_get_index(reg);
if (reg == NULL) {
panic("No register assigned at %+F", node);
}
- if (arch_register_type_is(reg, virtual))
+ if (reg->type & arch_register_type_virtual)
return;
cls = arch_register_get_class(reg);
reg_idx = arch_register_get_index(reg);
/* precolored with an ignore register (which is not a joker like
unknown/noreg) */
- if (arch_register_type_is(reg, joker)
- || rbitset_is_set(birg->allocatable_regs, reg->global_index))
+ if ((reg->type & arch_register_type_joker) ||
+ rbitset_is_set(birg->allocatable_regs, reg->global_index))
continue;
if (! (req->type & arch_register_req_type_limited))
ir_fprintf(stderr, "Verify warning: Node %+F in block %+F(%s) should have a register assigned\n",
node, get_nodes_block(node), get_irg_dump_name(irg));
problem_found = 1;
- } else if (!arch_register_type_is(reg, joker) && !arch_reg_out_is_allocatable(node, reg)) {
+ } else if (!(reg->type & arch_register_type_joker) && !arch_reg_out_is_allocatable(node, reg)) {
ir_fprintf(stderr, "Verify warning: Register %s assigned as output of %+F not allowed (register constraint) in block %+F(%s)\n",
reg->name, node, get_nodes_block(node), get_irg_dump_name(irg));
problem_found = 1;
pred, get_nodes_block(pred), get_irg_dump_name(irg), node);
problem_found = 1;
continue;
- } else if (!arch_register_type_is(reg, joker) && ! arch_reg_is_allocatable(node, i, reg)) {
+ } else if (!(reg->type & arch_register_type_joker) && ! arch_reg_is_allocatable(node, i, reg)) {
ir_fprintf(stderr, "Verify warning: Register %s as input %d of %+F not allowed (register constraint) in block %+F(%s)\n",
reg->name, i, node, get_nodes_block(node), get_irg_dump_name(irg));
problem_found = 1;
ir_node *pred = get_Phi_pred(node, i);
const arch_register_t *pred_reg = arch_get_irn_register(pred);
- if (reg != pred_reg && !arch_register_type_is(pred_reg, joker)) {
+ if (reg != pred_reg && !(pred_reg->type & arch_register_type_joker)) {
const char *pred_name = pred_reg != NULL ? pred_reg->name : "(null)";
const char *reg_name = reg != NULL ? reg->name : "(null)";
ir_fprintf(stderr, "Verify warning: Input %d of %+F in block %+F(%s) uses register %s instead of %s\n",