<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 17, 2016 at 10:45 AM, Matt Turner <span dir="ltr"><<a href="mailto:mattst88@gmail.com" target="_blank">mattst88@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thu, Mar 17, 2016 at 10:21 AM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> NIR already has this optimization and it can do much better than the little<br>
> peephole in the backend.<br>
><br>
> No shader-db change on Broadwell.<br>
> ---<br>
> src/mesa/drivers/dri/i965/brw_fs.cpp | 11 -----------<br>
> 1 file changed, 11 deletions(-)<br>
><br>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> index 86d2bd9..ba6ae59 100644<br>
> --- a/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp<br>
> @@ -2274,17 +2274,6 @@ fs_visitor::opt_algebraic()<br>
> progress = true;<br>
> }<br>
> break;<br>
> - case SHADER_OPCODE_RCP: {<br>
> - fs_inst *prev = (fs_inst *)inst->prev;<br>
> - if (prev->opcode == SHADER_OPCODE_SQRT) {<br>
> - if (inst->src[0].equals(prev->dst)) {<br>
> - inst->opcode = SHADER_OPCODE_RSQ;<br>
> - inst->src[0] = prev->src[0];<br>
> - progress = true;<br>
> - }<br>
> - }<br>
> - break;<br>
> - }<br>
<br>
</div></div>Do this in the vec4 backend as well, and with no shader-db regressions on HSW:<br></blockquote><div><br></div><div>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.<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Reviewed-by: Matt Turner <<a href="mailto:mattst88@gmail.com">mattst88@gmail.com</a>><br>
</blockquote></div><br></div></div>