Removed the arch_register_type_is() macro.
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 6 Dec 2010 19:01:56 +0000 (19:01 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Mon, 6 Dec 2010 19:01:56 +0000 (19:01 +0000)
Only makes it hard to search for arch_register_type_* flags.

[r28185]

ir/be/arm/arm_emitter.c
ir/be/beabi.c
ir/be/bearch.h
ir/be/bepeephole.c
ir/be/bespill.c
ir/be/beverify.c

index 92eba40..febba2f 100644 (file)
@@ -84,7 +84,7 @@ static const arch_register_t *get_in_reg(const ir_node *irn, int pos)
        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)) {
index 567ac1f..ffa46c1 100644 (file)
@@ -526,15 +526,15 @@ static ir_node *adjust_call(be_abi_irg_t *env, ir_node *irn, ir_node *curr_sp)
                        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);
                                }
                        }
@@ -1325,7 +1325,7 @@ static ir_node *create_be_return(be_abi_irg_t *env, ir_node *irn, ir_node *bl,
        /* 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);
        }
 
@@ -1840,8 +1840,7 @@ static void modify_irg(ir_graph *irg)
                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);
                        }
                }
@@ -2005,7 +2004,7 @@ static void fix_call_state_inputs(ir_graph *irg)
                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);
                        }
                }
@@ -2323,14 +2322,14 @@ void be_set_allocatable_regs(const ir_graph *irg,
 
 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);
 }
index 5490921..f6f133c 100644 (file)
@@ -262,15 +262,6 @@ static inline const char *arch_register_get_name(const arch_register_t *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.
index 26a9c4a..490bc92 100644 (file)
@@ -62,7 +62,7 @@ static void clear_reg_value(ir_node *node)
        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);
@@ -87,7 +87,7 @@ static void set_reg_value(ir_node *node)
        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);
index b38967a..4eecd8e 100644 (file)
@@ -87,8 +87,8 @@ static void prepare_constr_insn(be_pre_spill_env_t *env, ir_node *node)
 
                /* 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))
index f01d9ae..a443aea 100644 (file)
@@ -673,7 +673,7 @@ static void check_output_constraints(ir_node *node)
                        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;
@@ -722,7 +722,7 @@ static void check_input_constraints(ir_node *node)
                                   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;
@@ -741,7 +741,7 @@ static void check_input_constraints(ir_node *node)
                        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",