[Mesa-dev] [PATCH 1/5] i965: Add writes_accumulator flag
Matt Turner
mattst88 at gmail.com
Fri Mar 28 13:29:56 PDT 2014
On Fri, Mar 28, 2014 at 6:28 AM, Juha-Pekka Heikkila
<juhapekka.heikkila at gmail.com> wrote:
> diff --git a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
> index a951459..492ee0d 100644
> --- a/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_schedule_instructions.cpp
> @@ -818,7 +818,7 @@ fs_instruction_scheduler::calculate_deps()
> }
> }
>
> - if (inst->reads_flag()) {
> + if (inst->reads_flag() || inst->writes_accumulator) {
> add_dep(last_conditional_mod[inst->flag_subreg], n);
last_conditional_mod tracks the last instructions to write f0.0 and
f0.1, so we don't want to use it to also track writes to the
accumulator. Add another variable
schedule_node *last_accumulator_write = NULL;
and use it like we do with last_conditional_mod
if (inst->writes_accumulator || inst->dst.is_accumulator()) {
...
}
You'll need to add an is_accumulator method to the FS backend's fs_reg
class, and to the vec4 backend's reg class. You can tell if a register
is the accumulator if
reg.file == HW_REG &&
reg.fixed_hw_reg.file == BRW_ARCHITECTURE_REGISTER_FILE &&
reg.fixed_hw_reg.nr == BRW_ARF_ACCUMULATOR
More information about the mesa-dev
mailing list