[Mesa-dev] [PATCH 6/7] nir: add opcode to perform int64 to bool conversions

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Feb 8 15:19:46 UTC 2017


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 08/02/17 14:58, Samuel Iglesias Gonsálvez wrote:
> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99660
> ---
>   src/compiler/glsl/glsl_to_nir.cpp | 1 +
>   src/compiler/nir/nir_opcodes.py   | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/src/compiler/glsl/glsl_to_nir.cpp b/src/compiler/glsl/glsl_to_nir.cpp
> index fde6a018750..96d8164ea43 100644
> --- a/src/compiler/glsl/glsl_to_nir.cpp
> +++ b/src/compiler/glsl/glsl_to_nir.cpp
> @@ -1501,6 +1501,7 @@ nir_visitor::visit(ir_expression *ir)
>      case ir_unop_i642i: result = nir_i2i32(&b, srcs[0]);   break;
>      case ir_unop_i642u: result = nir_i2u32(&b, srcs[0]);   break;
>      case ir_unop_i642f: result = nir_i642f(&b, srcs[0]);   break;
> +   case ir_unop_i642b: result = nir_i642b(&b, srcs[0]);   break;
>      case ir_unop_i642d: result = nir_i642d(&b, srcs[0]);   break;
>   
>      case ir_unop_u642i: result = nir_u2i32(&b, srcs[0]);   break;
> diff --git a/src/compiler/nir/nir_opcodes.py b/src/compiler/nir/nir_opcodes.py
> index 0f6dd0add83..ece673cda36 100644
> --- a/src/compiler/nir/nir_opcodes.py
> +++ b/src/compiler/nir/nir_opcodes.py
> @@ -183,6 +183,7 @@ unop_convert("i2u64", tuint64, tint,  "src0")  # General int (int8_t, int64_t, e
>   unop_convert("u2u64", tuint64, tuint, "src0")  # General uint (uint8_t, uint32_t, etc.) to uint64_t conversion
>   unop_convert("f2u64", tuint64, tfloat, "src0") # General float (float or double) to uint64_t conversion
>   unop_convert("i642f", tfloat32, tint64, "src0")  # int64_t-to-float conversion.
> +unop_convert("i642b", tbool, tint64, "src0")  # int64_t-to-bool conversion.
>   unop_convert("i642d", tfloat64, tint64, "src0")  # int64_t-to-double conversion.
>   unop_convert("u642f", tfloat32, tuint64, "src0") # uint64_t-to-float conversion.
>   unop_convert("u642d", tfloat64, tuint64, "src0") # uint64_t-to-double conversion.




More information about the mesa-dev mailing list