[Mesa-dev] [PATCH 03/29] nir/vars_to_ssa: adapt to different bit sizes

Jason Ekstrand jason at jlekstrand.net
Mon Mar 21 21:03:10 UTC 2016


On Mon, Mar 21, 2016 at 5:05 AM, Samuel Iglesias Gonsálvez <
siglesias at igalia.com> wrote:

> From: Connor Abbott <connor.w.abbott at intel.com>
>
> v2 (Sam):
> - Keep using nir_op_imov when calling nir_alu_instr_create() at
> rename_variables_block(). nir_op_fmov is not needed anymore.
>
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> ---
>  src/compiler/nir/nir_lower_vars_to_ssa.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/src/compiler/nir/nir_lower_vars_to_ssa.c
> b/src/compiler/nir/nir_lower_vars_to_ssa.c
> index 2331791..511662e 100644
> --- a/src/compiler/nir/nir_lower_vars_to_ssa.c
> +++ b/src/compiler/nir/nir_lower_vars_to_ssa.c
> @@ -543,6 +543,8 @@ get_ssa_def_for_block(struct deref_node *node,
> nir_block *block,
>     nir_ssa_undef_instr *undef =
>        nir_ssa_undef_instr_create(state->shader,
>                                   glsl_get_vector_elements(node->type));
> +   undef->def.bit_size =
> +      glsl_get_bit_size(glsl_get_base_type(node->type));
>

Can we instead make nir_ssa_undef_instr_create take a bit size?  That seems
better than setting it manually.  We probably want to do the same for
load_cons.


>     nir_instr_insert_before_cf_list(&state->impl->body, &undef->instr);
>     def_stack_push(node, &undef->def, state);
>     return &undef->def;
> @@ -627,6 +629,7 @@ rename_variables_block(nir_block *block, struct
> lower_variables_state *state)
>                 nir_ssa_undef_instr *undef =
>                    nir_ssa_undef_instr_create(state->shader,
>                                               intrin->num_components);
> +               undef->def.bit_size = intrin->dest.ssa.bit_size;
>
>                 nir_instr_insert_before(&intrin->instr, &undef->instr);
>                 nir_instr_remove(&intrin->instr);
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160321/3cbb7732/attachment-0001.html>


More information about the mesa-dev mailing list