[Mesa-dev] [PATCH v2 09/29] nir: Make boolean conversions sized just like the others

Iago Toral itoral at igalia.com
Thu Dec 13 10:07:52 UTC 2018


On Thu, 2018-12-06 at 13:45 -0600, Jason Ekstrand wrote:
(...)
> diff --git a/src/compiler/nir/nir_builder.h
> b/src/compiler/nir/nir_builder.h
> index 30fa1d7ec8b..e0cdcd4ba23 100644
> --- a/src/compiler/nir/nir_builder.h
> +++ b/src/compiler/nir/nir_builder.h
> @@ -963,6 +963,18 @@ nir_load_param(nir_builder *build, uint32_t
> param_idx)
>  
>  #include "nir_builder_opcodes.h"
>  
> +static inline nir_ssa_def *
> +nir_f2b(nir_builder *build, nir_ssa_def *f)
> +{
> +   return nir_f2b32(build, f);
> +}
> +
> +static inline nir_ssa_def *
> +nir_i2b(nir_builder *build, nir_ssa_def *i)
> +{
> +   return nir_i2b32(build, i);
> +}
> +

any particular reason why wanted these instead of just calling the 32-
bit opcode directly from the caller?

I need to do b2f conversions in a couple of places where the
destination can be 16, 32 or 64 and I think it is more convenient to
have helpers that take the destination bit-size as parameter and then
emit the appropriate opcode instead. What do you think?

Iago



More information about the mesa-dev mailing list