[Mesa-dev] [PATCH 7/9] i965/vec4: Don't allow type conversion in opt_vector_float

Matt Turner mattst88 at gmail.com
Thu Mar 17 18:17:25 UTC 2016


On Thu, Mar 17, 2016 at 10:21 AM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> ---
>  src/mesa/drivers/dri/i965/brw_vec4.cpp | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> index baf72a2..155a550 100644
> --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
> +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
> @@ -375,6 +375,7 @@ vec4_visitor::opt_vector_float()
>        if (inst->opcode != BRW_OPCODE_MOV ||
>            inst->dst.writemask == WRITEMASK_XYZW ||
>            inst->src[0].file != IMM ||
> +          inst->src[0].type != inst->dst.type ||

Why?

This breaks legitimate optimizations, like

-mov m2.xy:F, 0.500000F
-mov m2.zw:F, 0D
+mov m2:F, [0.5F, 0.5F, 0F, 0F]

and

-mov vgrf6.0.x:D, -1082130432D
-mov vgrf6.0.y:D, 1056964608D
-mov vgrf6.0.z:D, 1065353216D
+mov vgrf6.0.xyz:F, [-1F, 0.5F, 1F, 0F]

and

-mov vgrf7.0.x:D, 1073741824D
-mov vgrf7.0.yz:D, 0D
+mov vgrf7.0.xyz:F, [2F, 0F, 0F, 0F]


The first one we should just handle in opt_algebraic by fixing the src
type. The other two look like NIR fail. If we fixed those things, I'd
be fine with this.


More information about the mesa-dev mailing list