[Mesa-dev] [PATCH 16/17] i965/fs: Refactor try_emit_saturate

Matt Turner mattst88 at gmail.com
Tue Aug 19 19:37:33 PDT 2014


On Mon, Aug 18, 2014 at 5:17 AM, Abdiel Janulgue
<abdiel.janulgue at linux.intel.com> wrote:
> +   /* If the last instruction from our accept() generated our
> +    * src, just set the saturate flag instead of emmitting a separate mov.

emitting.

>      */
>     fs_inst *modify = get_instruction_generating_reg(pre_inst, last_inst, src);
> -   if (!modify || modify->regs_written != 1) {
> -      this->result = fs_reg(this, ir->type);
> -      fs_inst *inst = emit(MOV(this->result, src));
> -      inst->saturate = true;
> -   } else {
> +   if (modify && modify->regs_written == 1) {
>        modify->saturate = true;
>        this->result = src;
> +      return true;
>     }

I was going to tell you that you need to call
backend_instruction::can_do_saturate() here, but ir_unop_saturate only
operates on floats, and all i965 instructions that operate on floats
can saturate.


More information about the mesa-dev mailing list