[Mesa-dev] [PATCH 10/15] i965: Allow immediates to be folded into logical and shift instructions.

Paul Berry stereotype441 at gmail.com
Fri Aug 23 09:02:51 PDT 2013


On 22 August 2013 16:08, Matt Turner <mattst88 at gmail.com> wrote:

> These instructions will be used with immediate arguments in the upcoming
> frexp and ldexp lowering passes.
> ---
>  src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
> b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
> index 2780ab6..034ebef 100644
> --- a/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp
> @@ -341,9 +341,20 @@ fs_visitor::try_constant_propagate(fs_inst *inst,
> acp_entry *entry)
>           progress = true;
>           break;
>
> +      case BRW_OPCODE_SHL:
> +      case BRW_OPCODE_SHR:
> +         if (i == 1) {
> +            inst->src[i] = entry->src;
> +            progress = true;
> +         }
> +         break;
> +
>        case BRW_OPCODE_MACH:
>        case BRW_OPCODE_MUL:
>        case BRW_OPCODE_ADD:
> +      case BRW_OPCODE_OR:
> +      case BRW_OPCODE_AND:
> +      case BRW_OPCODE_XOR:
>           if (i == 1) {
>              inst->src[i] = entry->src;
>              progress = true;
> --
> 1.8.3.2
>

Shouldn't we make a similar change to brw_vec4_copy_propagation.cpp?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20130823/db34dca2/attachment.html>


More information about the mesa-dev mailing list