foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == UNIFORM) {
int uniform_nr = inst->src[i].reg + inst->src[i].reg_offset;
int constant_nr;
* the send is reading the whole thing.
*/
if (inst->is_send_from_grf()) {
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
split_grf[inst->src[i].reg] = false;
}
inst->dst.reg_offset - 1);
inst->dst.reg_offset = 0;
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF &&
split_grf[inst->src[i].reg] &&
inst->src[i].reg_offset != 0) {
if (inst->dst.file == GRF)
remap_table[inst->dst.reg] = 0;
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF)
remap_table[inst->src[i].reg] = 0;
}
if (inst->dst.file == GRF)
inst->dst.reg = remap_table[inst->dst.reg];
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF)
inst->src[i].reg = remap_table[inst->src[i].reg];
}
foreach_list_safe(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (int i = 0 ; i < 3; i++) {
+ for (int i = 0 ; i < inst->sources; i++) {
if (inst->src[i].file != UNIFORM || !inst->src[i].reladdr)
continue;
foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *) node;
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file != UNIFORM)
continue;
foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file != UNIFORM)
continue;
* MRF's source GRF that we wanted to rewrite, that stops us.
*/
bool interfered = false;
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < scan_inst->sources; i++) {
if (scan_inst->src[i].file == GRF &&
scan_inst->src[i].reg == inst->src[0].reg &&
scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
!inst->force_sechalf);
/* Clear the flag for registers that actually got read (as expected). */
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
int grf;
if (inst->src[i].file == GRF) {
grf = inst->src[i].reg;
}
fprintf(file, ":%s, ", brw_reg_type_letters(inst->dst.type));
- for (int i = 0; i < 3 && inst->src[i].file != BAD_FILE; i++) {
+ for (int i = 0; i < inst->sources && inst->src[i].file != BAD_FILE; i++) {
if (inst->src[i].negate)
fprintf(file, "-");
if (inst->src[i].abs)
fprintf(file, ":%s", brw_reg_type_letters(inst->src[i].type));
}
- if (i < 2 && inst->src[i + 1].file != BAD_FILE)
+ if (i < inst->sources - 1 && inst->src[i + 1].file != BAD_FILE)
fprintf(file, ", ");
}
if (entry->src.file != IMM)
return false;
- for (int i = 2; i >= 0; i--) {
+ for (int i = inst->sources - 1; i >= 0; i--) {
if (inst->src[i].file != entry->dst.file ||
inst->src[i].reg != entry->dst.reg ||
inst->src[i].reg_offset != entry->dst.reg_offset ||
inst = (fs_inst *)inst->next) {
/* Try propagating into this instruction. */
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file != GRF)
continue;
}
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < entry->generator->sources; i++) {
fs_reg *src_reg = &entry->generator->src[i];
/* Kill all AEB entries that use the destination we just
}
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
int var = live_intervals->var_from_vgrf[inst->src[i].reg];
if (unlikely(debug_flag))
annotate(brw, annotation, cfg, inst, p->next_insn_offset);
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
src[i] = brw_reg_from_fs_reg(&inst->src[i]);
/* The accumulator result appears to get used for the
inst = (fs_inst *)inst->next) {
/* Set use[] for this instruction */
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
fs_reg reg = inst->src[i];
if (reg.file != GRF)
* assign_curbe_setup(), and interpolation uses fixed hardware regs from
* the start (see interp_reg()).
*/
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == HW_REG &&
inst->src[i].fixed_hw_reg.file == BRW_GENERAL_REGISTER_FILE) {
int node_nr = inst->src[i].fixed_hw_reg.nr / reg_width;
foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
spill_costs[inst->src[i].reg] += loop_scale;
foreach_list(node, &this->instructions) {
fs_inst *inst = (fs_inst *)node;
- for (unsigned int i = 0; i < 3; i++) {
+ for (unsigned int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF &&
inst->src[i].reg == spill_reg) {
int regs_read = inst->regs_read(this, i);
scan_inst->dst.reg = reg_to;
scan_inst->dst.reg_offset = reg_to_offset[i];
}
- for (int j = 0; j < 3; j++) {
+ for (int j = 0; j < scan_inst->sources; j++) {
if (scan_inst->src[j].file == GRF &&
scan_inst->src[j].reg == reg_from &&
scan_inst->src[j].reg_offset == i) {
}
break;
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < scan_inst->sources; i++) {
if (scan_inst->src[i].file == GRF &&
scan_inst->src[i].reg == inst->src[0].reg &&
scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
if (inst->dst.file == GRF)
remaining_grf_uses[inst->dst.reg]++;
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file != GRF)
continue;
grf_active[inst->dst.reg] = true;
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
remaining_grf_uses[inst->src[i].reg]--;
grf_active[inst->src[i].reg] = true;
benefit -= v->virtual_grf_sizes[inst->dst.reg];
}
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file != GRF)
continue;
add_barrier_deps(n);
/* read-after-write deps. */
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
if (post_reg_alloc) {
for (int r = 0; r < reg_width * inst->regs_read(v, i); r++)
fs_inst *inst = (fs_inst *)n->inst;
/* write-after-read deps. */
- for (int i = 0; i < 3; i++) {
+ for (int i = 0; i < inst->sources; i++) {
if (inst->src[i].file == GRF) {
if (post_reg_alloc) {
for (int r = 0; r < reg_width * inst->regs_read(v, i); r++)