[Mesa-dev] [PATCH 1/9] i965/fs: Remove the RCP+RSQ peephole

Matt Turner mattst88 at gmail.com
Fri Mar 18 01:01:46 UTC 2016


On Thu, Mar 17, 2016 at 5:40 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> On Thu, Mar 17, 2016 at 10:45 AM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Thu, Mar 17, 2016 at 10:21 AM, Jason Ekstrand <jason at jlekstrand.net>
>> wrote:
>> > NIR already has this optimization and it can do much better than the
>> > little
>> > peephole in the backend.
>> >
>> > No shader-db change on Broadwell.
>> > ---
>> >  src/mesa/drivers/dri/i965/brw_fs.cpp | 11 -----------
>> >  1 file changed, 11 deletions(-)
>> >
>> > diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp
>> > b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> > index 86d2bd9..ba6ae59 100644
>> > --- a/src/mesa/drivers/dri/i965/brw_fs.cpp
>> > +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
>> > @@ -2274,17 +2274,6 @@ fs_visitor::opt_algebraic()
>> >              progress = true;
>> >           }
>> >           break;
>> > -      case SHADER_OPCODE_RCP: {
>> > -         fs_inst *prev = (fs_inst *)inst->prev;
>> > -         if (prev->opcode == SHADER_OPCODE_SQRT) {
>> > -            if (inst->src[0].equals(prev->dst)) {
>> > -               inst->opcode = SHADER_OPCODE_RSQ;
>> > -               inst->src[0] = prev->src[0];
>> > -               progress = true;
>> > -            }
>> > -         }
>> > -         break;
>> > -      }
>>
>> Do this in the vec4 backend as well, and with no shader-db regressions on
>> HSW:
>
>
> Do you want them in the same patch?  The patch that disables float
> opt_algebraic in vec4 does so with 0 shader-db regressions on haswell and
> deletes the RCP+SQRT optimization.  Seems nicer to put them together.

Sure, that seems fine to me!


More information about the mesa-dev mailing list