debug_program_log(c, "after unroll loops");
}
else{
- rc_transform_loops(&c->Base, &loop_state, R300_PFS_MAX_ALU_INST);
+ rc_transform_loops(&c->Base, &loop_state);
debug_program_log(c, "after transform loops");
rc_emulate_branches(&c->Base);
* on all chipsets. */
if (compiler->Base.is_r500){
- rc_transform_loops(&compiler->Base, &loop_state, R500_VS_MAX_ALU);
+ rc_transform_loops(&compiler->Base, &loop_state);
rc_emulate_loops(&loop_state, R500_VS_MAX_ALU);
} else {
+ rc_transform_loops(&compiler->Base, &loop_state);
rc_emulate_loops(&loop_state, R300_VS_MAX_ALU);
- rc_transform_loops(&compiler->Base, &loop_state, R300_VS_MAX_ALU);
}
debug_program_log(compiler, "after emulate loops");
}
}
+/**
+ * If prog_inst_limit is -1, then all eligible loops will be unrolled regardless
+ * of how many iterations they have.
+ */
static int try_unroll_loop(struct radeon_compiler * c, struct loop_info * loop,
unsigned int prog_inst_limit)
{
return 0;
}
- if (iterations > loop_max_possible_iterations(c, loop,
+ if (prog_inst_limit > 0
+ && iterations > loop_max_possible_iterations(c, loop,
prog_inst_limit)) {
return 0;
}
* Null if there is an error.
*/
static struct rc_instruction * transform_loop(struct emulate_loop_state * s,
- struct rc_instruction * inst,
- int prog_inst_limit)
+ struct rc_instruction * inst)
{
struct loop_info * loop;
if (!build_loop_info(s->C, loop, inst))
return NULL;
- if(try_unroll_loop(s->C, loop, prog_inst_limit)){
+ if(try_unroll_loop(s->C, loop, -1)){
return loop->BeginLoop->Next;
}
}
void rc_transform_loops(struct radeon_compiler *c,
- struct emulate_loop_state * s,
- int prog_inst_limit)
+ struct emulate_loop_state * s)
{
struct rc_instruction * ptr;
while(ptr != &s->C->Program.Instructions) {
if(ptr->Type == RC_INSTRUCTION_NORMAL &&
ptr->U.I.Opcode == RC_OPCODE_BGNLOOP){
- ptr = transform_loop(s, ptr, prog_inst_limit);
+ ptr = transform_loop(s, ptr);
if(!ptr){
return;
}