mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-04 17:50:11 +01:00
i965/fs: Loop from 0 to inst->sources, not 0 to 3.
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
27e12a8ea9
commit
b1dcdcde2e
10 changed files with 28 additions and 28 deletions
|
|
@ -1472,7 +1472,7 @@ fs_visitor::assign_curb_setup()
|
|||
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;
|
||||
|
|
@ -1670,7 +1670,7 @@ fs_visitor::split_virtual_grfs()
|
|||
* 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;
|
||||
}
|
||||
|
|
@ -1703,7 +1703,7 @@ fs_visitor::split_virtual_grfs()
|
|||
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) {
|
||||
|
|
@ -1741,7 +1741,7 @@ fs_visitor::compact_virtual_grfs()
|
|||
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;
|
||||
}
|
||||
|
|
@ -1767,7 +1767,7 @@ fs_visitor::compact_virtual_grfs()
|
|||
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];
|
||||
}
|
||||
|
|
@ -1807,7 +1807,7 @@ fs_visitor::move_uniform_array_access_to_pull_constants()
|
|||
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;
|
||||
|
||||
|
|
@ -1857,7 +1857,7 @@ fs_visitor::assign_constant_locations()
|
|||
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;
|
||||
|
||||
|
|
@ -1928,7 +1928,7 @@ fs_visitor::demote_pull_constants()
|
|||
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;
|
||||
|
||||
|
|
@ -2180,7 +2180,7 @@ fs_visitor::compute_to_mrf()
|
|||
* 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) {
|
||||
|
|
@ -2319,7 +2319,7 @@ clear_deps_for_inst_src(fs_inst *inst, int dispatch_width, bool *deps,
|
|||
!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;
|
||||
|
|
@ -2699,7 +2699,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
}
|
||||
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)
|
||||
|
|
@ -2788,7 +2788,7 @@ fs_visitor::dump_instruction(backend_instruction *be_inst, FILE *file)
|
|||
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, ", ");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -353,7 +353,7 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
|
|||
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 ||
|
||||
|
|
@ -492,7 +492,7 @@ fs_visitor::opt_copy_propagate_local(void *copy_prop_ctx, bblock_t *block,
|
|||
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;
|
||||
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ fs_visitor::opt_cse_local(bblock_t *block, exec_list *aeb)
|
|||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ fs_visitor::dead_code_eliminate()
|
|||
}
|
||||
}
|
||||
|
||||
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];
|
||||
|
||||
|
|
|
|||
|
|
@ -1352,7 +1352,7 @@ fs_generator::generate_code(exec_list *instructions,
|
|||
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
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@ fs_live_variables::setup_def_use()
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ fs_visitor::setup_payload_interference(struct ra_graph *g,
|
|||
* 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;
|
||||
|
|
@ -583,7 +583,7 @@ fs_visitor::choose_spill_reg(struct ra_graph *g)
|
|||
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;
|
||||
|
||||
|
|
@ -682,7 +682,7 @@ fs_visitor::spill_reg(int spill_reg)
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ fs_visitor::register_coalesce()
|
|||
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) {
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
|
|||
}
|
||||
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) {
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ fs_instruction_scheduler::count_remaining_grf_uses(backend_instruction *be)
|
|||
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;
|
||||
|
||||
|
|
@ -526,7 +526,7 @@ fs_instruction_scheduler::update_register_pressure(backend_instruction *be)
|
|||
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;
|
||||
|
|
@ -547,7 +547,7 @@ fs_instruction_scheduler::get_register_pressure_benefit(backend_instruction *be)
|
|||
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;
|
||||
|
||||
|
|
@ -781,7 +781,7 @@ fs_instruction_scheduler::calculate_deps()
|
|||
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++)
|
||||
|
|
@ -905,7 +905,7 @@ fs_instruction_scheduler::calculate_deps()
|
|||
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++)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue