pb->iter_count++;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(i, tmp, defs, pb->num_blocks) {
+ BITSET_FOREACH_SET(i, defs, pb->num_blocks) {
if (pb->work[i] < pb->iter_count)
pb->W[w_end++] = pb->blocks[i];
pb->work[i] = pb->iter_count;
/* apply live_in/live_out to ranges */
nir_foreach_block(block, impl) {
- BITSET_WORD tmp;
int i;
- BITSET_FOREACH_SET(i, tmp, block->live_in, state.num_defs)
+ BITSET_FOREACH_SET(i, block->live_in, state.num_defs)
range_include(&state.defs[i], block_live_index[block->index]);
- BITSET_FOREACH_SET(i, tmp, block->live_out, state.num_defs)
+ BITSET_FOREACH_SET(i, block->live_out, state.num_defs)
range_include(&state.defs[i], block_live_index[block->index + 1]);
}
BITSET_WORD *live_regs)
{
int live_node;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(live_node, tmp, live_nodes, ctx->comp->cur_index) {
+ BITSET_FOREACH_SET(live_node, live_nodes, ctx->comp->cur_index) {
add_interference(ctx, i,
live_node + ctx->comp->cur_reg);
}
int live_reg;
- BITSET_FOREACH_SET(live_reg, tmp, ctx->live, ctx->comp->cur_index) {
+ BITSET_FOREACH_SET(live_reg, ctx->live, ctx->comp->cur_index) {
add_interference(ctx, i, live_reg);
}
return;
int live_idx;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(live_idx, tmp, live_reg, ctx->comp->cur_reg) {
+ BITSET_FOREACH_SET(live_idx, live_reg, ctx->comp->cur_reg) {
printf("reg%d ", live_idx);
}
- BITSET_FOREACH_SET(live_idx, tmp, live_val, ctx->comp->cur_index) {
+ BITSET_FOREACH_SET(live_idx, live_val, ctx->comp->cur_index) {
printf("%d ", live_idx);
}
printf("\n");
block->live_out_phys = 0;
int reg_idx;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(reg_idx, tmp, block->live_out, ctx->comp->cur_reg) {
+ BITSET_FOREACH_SET(reg_idx, block->live_out, ctx->comp->cur_reg) {
if (BITSET_TEST(block->def_out, reg_idx)) {
block->live_out_phys |= (1ull << ctx->registers[reg_idx].assigned_color);
}
* encodings are rejected by the validator.
*/
int e;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(e, tmp, invalid_encodings, num_encodings) {
+ BITSET_FOREACH_SET(e, invalid_encodings, num_encodings) {
if (file == FIXED_GRF) {
brw_MOV(p, g0, g0);
brw_inst_set_src0_vstride(&devinfo, last_inst, BRW_VERTICAL_STRIDE_4);
* encodings are rejected by the validator.
*/
int e;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(e, tmp, invalid_encodings, num_encodings) {
+ BITSET_FOREACH_SET(e, invalid_encodings, num_encodings) {
for (unsigned i = 0; i < 2; i++) {
if (i == 0) {
brw_MAD(p, g0, g0, g0, g0);
* encodings are rejected by the validator.
*/
int e;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(e, tmp, invalid_encodings, num_encodings) {
+ BITSET_FOREACH_SET(e, invalid_encodings, num_encodings) {
const unsigned hw_type = e & 0x7;
const unsigned exec_type = e >> 3;
for (group = 0; group < ctx->PerfMonitor.NumGroups; group++) {
const struct gl_perf_monitor_group *g = &ctx->PerfMonitor.Groups[group];
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(counter, tmp, m->ActiveCounters[group], g->NumCounters) {
+ BITSET_FOREACH_SET(counter, m->ActiveCounters[group], g->NumCounters) {
const struct gl_perf_monitor_counter *c = &g->Counters[counter];
size += sizeof(uint32_t); /* Group ID */
for (gid = 0; gid < ctx->PerfMonitor.NumGroups; gid++) {
const struct gl_perf_monitor_group *g = &ctx->PerfMonitor.Groups[gid];
const struct st_perf_monitor_group *stg = &st->perfmon[gid];
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(cid, tmp, m->ActiveCounters[gid], g->NumCounters) {
+ BITSET_FOREACH_SET(cid, m->ActiveCounters[gid], g->NumCounters) {
const struct st_perf_monitor_counter *stc = &stg->counters[cid];
struct st_perf_counter_object *cntr =
&stm->active_counters[stm->num_active_counters];
* where possible. */
unsigned i;
- BITSET_WORD tmp;
- BITSET_FOREACH_SET(i, tmp, done->dependents, count) {
+ BITSET_FOREACH_SET(i, done->dependents, count) {
assert(instructions[i]->nr_dependencies);
if (!(--instructions[i]->nr_dependencies))
/* Iterate to find the best instruction satisfying the predicate */
unsigned i;
- BITSET_WORD tmp;
signed best_index = -1;
bool best_conditional = false;
unsigned max_active = 0;
unsigned max_distance = 6;
- BITSET_FOREACH_SET(i, tmp, worklist, count) {
+ BITSET_FOREACH_SET(i, worklist, count) {
max_active = MAX2(max_active, i);
}
- BITSET_FOREACH_SET(i, tmp, worklist, count) {
+ BITSET_FOREACH_SET(i, worklist, count) {
if ((max_active - i) >= max_distance)
continue;
* Iterates over each set bit in a set
*
* @param __i iteration variable, bit number
- * @param __tmp an internally-used temporary bitset
* @param __set the bitset to iterate (will not be modified)
* @param __size number of bits in the set to consider
*/
-#define BITSET_FOREACH_SET(__i, __tmp, __set, __size) \
- for (__tmp = *(__set), __i = 0; \
- (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)
+#define BITSET_FOREACH_SET(__i, __set, __size) \
+ for (BITSET_WORD __tmp = *(__set), *__foo = &__tmp; __foo != NULL; __foo = NULL) \
+ for (__i = 0; \
+ (__i = __bitset_next_set(__i, &__tmp, __set, __size)) < __size;)
#ifdef __cplusplus
ra_make_reg_conflicts_transitive(struct ra_regs *regs, unsigned int r)
{
struct ra_reg *reg = ®s->regs[r];
- BITSET_WORD tmp;
int c;
- BITSET_FOREACH_SET(c, tmp, reg->conflicts, regs->count) {
+ BITSET_FOREACH_SET(c, reg->conflicts, regs->count) {
struct ra_reg *other = ®s->regs[c];
unsigned i;
for (i = 0; i < BITSET_WORDS(regs->count); i++)