[Mesa-dev] [PATCH 9/9] nir: s/nir_type_unsigned/nir_type_uint

2015-11-19 Thread Iago Toral Quiroga
From: Jason Ekstrand 

v2: do the same in tgsi_to_nir (Samuel)

v3: added missing cases after rebase (Iago)

Reviewed-by: Iago Toral Quiroga 
---
 src/gallium/auxiliary/nir/tgsi_to_nir.c|  2 +-
 src/glsl/nir/glsl_to_nir.cpp   |  2 +-
 src/glsl/nir/nir.h |  2 +-
 src/glsl/nir/nir_constant_expressions.py   |  2 +-
 src/glsl/nir/nir_opcodes.py| 78 +++---
 src/glsl/nir/nir_search.c  |  4 +-
 src/mesa/drivers/dri/i965/brw_nir.c|  4 +-
 src/mesa/drivers/dri/i965/brw_vec4_nir.cpp |  2 +-
 8 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c 
b/src/gallium/auxiliary/nir/tgsi_to_nir.c
index 0539cfc..8918240 100644
--- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
+++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
@@ -295,7 +295,7 @@ ttn_emit_declaration(struct ttn_compile *c)
  type = nir_type_int;
  break;
   case TGSI_RETURN_TYPE_UINT:
- type = nir_type_unsigned;
+ type = nir_type_uint;
  break;
   case TGSI_RETURN_TYPE_FLOAT:
   default:
diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
index e149d73..3455b49 100644
--- a/src/glsl/nir/glsl_to_nir.cpp
+++ b/src/glsl/nir/glsl_to_nir.cpp
@@ -1826,7 +1826,7 @@ nir_visitor::visit(ir_texture *ir)
   instr->dest_type = nir_type_int;
   break;
case GLSL_TYPE_UINT:
-  instr->dest_type = nir_type_unsigned;
+  instr->dest_type = nir_type_uint;
   break;
default:
   unreachable("not reached");
diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
index e9d722e..7304517 100644
--- a/src/glsl/nir/nir.h
+++ b/src/glsl/nir/nir.h
@@ -633,7 +633,7 @@ typedef enum {
nir_type_invalid = 0, /* Not a valid type */
nir_type_float,
nir_type_int,
-   nir_type_unsigned,
+   nir_type_uint,
nir_type_bool
 } nir_alu_type;
 
diff --git a/src/glsl/nir/nir_constant_expressions.py 
b/src/glsl/nir/nir_constant_expressions.py
index 2ba8554..b16ef50 100644
--- a/src/glsl/nir/nir_constant_expressions.py
+++ b/src/glsl/nir/nir_constant_expressions.py
@@ -213,7 +213,7 @@ unpack_half_1x16(uint16_t u)
 }
 
 /* Some typed vector structures to make things like src0.y work */
-% for type in ["float", "int", "unsigned", "bool"]:
+% for type in ["float", "int", "uint", "bool"]:
 struct ${type}_vec {
${type} x;
${type} y;
diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
index 729f695..8db24eb 100644
--- a/src/glsl/nir/nir_opcodes.py
+++ b/src/glsl/nir/nir_opcodes.py
@@ -91,7 +91,7 @@ class Opcode(object):
 tfloat = "float"
 tint = "int"
 tbool = "bool"
-tunsigned = "unsigned"
+tuint = "uint"
 
 commutative = "commutative "
 associative = "associative "
@@ -156,7 +156,7 @@ unop("fsqrt", tfloat, "sqrtf(src0)")
 unop("fexp2", tfloat, "exp2f(src0)")
 unop("flog2", tfloat, "log2f(src0)")
 unop_convert("f2i", tfloat, tint, "src0") # Float-to-integer conversion.
-unop_convert("f2u", tfloat, tunsigned, "src0") # Float-to-unsigned conversion
+unop_convert("f2u", tfloat, tuint, "src0") # Float-to-unsigned conversion
 unop_convert("i2f", tint, tfloat, "src0") # Integer-to-float conversion.
 # Float-to-boolean conversion
 unop_convert("f2b", tfloat, tbool, "src0 != 0.0f")
@@ -165,7 +165,7 @@ unop_convert("b2f", tbool, tfloat, "src0 ? 1.0f : 0.0f")
 # Int-to-boolean conversion
 unop_convert("i2b", tint, tbool, "src0 != 0")
 unop_convert("b2i", tbool, tint, "src0 ? 1 : 0") # Boolean-to-int conversion
-unop_convert("u2f", tunsigned, tfloat, "src0") #Unsigned-to-float conversion.
+unop_convert("u2f", tuint, tfloat, "src0") #Unsigned-to-float conversion.
 
 unop_reduce("bany", 1, tbool, tbool, "{src}", "{src0} || {src1}", "{src}")
 unop_reduce("ball", 1, tbool, tbool, "{src}", "{src0} && {src1}", "{src}")
@@ -205,13 +205,13 @@ unop("fddy_coarse", tfloat, "0.0f")
 # Floating point pack and unpack operations.
 
 def pack_2x16(fmt):
-   unop_horiz("pack_" + fmt + "_2x16", 1, tunsigned, 2, tfloat, """
+   unop_horiz("pack_" + fmt + "_2x16", 1, tuint, 2, tfloat, """
 dst.x = (uint32_t) pack_fmt_1x16(src0.x);
 dst.x |= ((uint32_t) pack_fmt_1x16(src0.y)) << 16;
 """.replace("fmt", fmt))
 
 def pack_4x8(fmt):
-   unop_horiz("pack_" + fmt + "_4x8", 1, tunsigned, 4, tfloat, """
+   unop_horiz("pack_" + fmt + "_4x8", 1, tuint, 4, tfloat, """
 dst.x = (uint32_t) pack_fmt_1x8(src0.x);
 dst.x |= ((uint32_t) pack_fmt_1x8(src0.y)) << 8;
 dst.x |= ((uint32_t) pack_fmt_1x8(src0.z)) << 16;
@@ -219,13 +219,13 @@ dst.x |= ((uint32_t) pack_fmt_1x8(src0.w)) << 24;
 """.replace("fmt", fmt))
 
 def unpack_2x16(fmt):
-   unop_horiz("unpack_" + fmt + "_2x16", 2, tfloat, 1, tunsigned, """
+   unop_horiz("unpack_" + fmt + "_2x16", 2, tfloat, 1, tuint, """
 dst.x = unpack_fmt_1x16((uint16_t)(src0.x & 0x));
 dst.y = unpack_fmt_1x16((uint16_t)(src0.x << 16));
 """.replace("fmt", fmt))
 
 def unpack_4x8(fmt):
-   

Re: [Mesa-dev] [PATCH 9/9] nir: s/nir_type_unsigned/nir_type_uint

2015-11-19 Thread Matt Turner
On Thu, Nov 19, 2015 at 2:05 AM, Iago Toral Quiroga  wrote:
> From: Jason Ekstrand 
>
> v2: do the same in tgsi_to_nir (Samuel)
>
> v3: added missing cases after rebase (Iago)
>
> Reviewed-by: Iago Toral Quiroga 
> ---
>  src/gallium/auxiliary/nir/tgsi_to_nir.c|  2 +-
>  src/glsl/nir/glsl_to_nir.cpp   |  2 +-
>  src/glsl/nir/nir.h |  2 +-
>  src/glsl/nir/nir_constant_expressions.py   |  2 +-
>  src/glsl/nir/nir_opcodes.py| 78 
> +++---
>  src/glsl/nir/nir_search.c  |  4 +-
>  src/mesa/drivers/dri/i965/brw_nir.c|  4 +-
>  src/mesa/drivers/dri/i965/brw_vec4_nir.cpp |  2 +-
>  8 files changed, 48 insertions(+), 48 deletions(-)
>
> diff --git a/src/gallium/auxiliary/nir/tgsi_to_nir.c 
> b/src/gallium/auxiliary/nir/tgsi_to_nir.c
> index 0539cfc..8918240 100644
> --- a/src/gallium/auxiliary/nir/tgsi_to_nir.c
> +++ b/src/gallium/auxiliary/nir/tgsi_to_nir.c
> @@ -295,7 +295,7 @@ ttn_emit_declaration(struct ttn_compile *c)
>   type = nir_type_int;
>   break;
>case TGSI_RETURN_TYPE_UINT:
> - type = nir_type_unsigned;
> + type = nir_type_uint;
>   break;
>case TGSI_RETURN_TYPE_FLOAT:
>default:
> diff --git a/src/glsl/nir/glsl_to_nir.cpp b/src/glsl/nir/glsl_to_nir.cpp
> index e149d73..3455b49 100644
> --- a/src/glsl/nir/glsl_to_nir.cpp
> +++ b/src/glsl/nir/glsl_to_nir.cpp
> @@ -1826,7 +1826,7 @@ nir_visitor::visit(ir_texture *ir)
>instr->dest_type = nir_type_int;
>break;
> case GLSL_TYPE_UINT:
> -  instr->dest_type = nir_type_unsigned;
> +  instr->dest_type = nir_type_uint;
>break;
> default:
>unreachable("not reached");
> diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
> index e9d722e..7304517 100644
> --- a/src/glsl/nir/nir.h
> +++ b/src/glsl/nir/nir.h
> @@ -633,7 +633,7 @@ typedef enum {
> nir_type_invalid = 0, /* Not a valid type */
> nir_type_float,
> nir_type_int,
> -   nir_type_unsigned,
> +   nir_type_uint,
> nir_type_bool
>  } nir_alu_type;
>
> diff --git a/src/glsl/nir/nir_constant_expressions.py 
> b/src/glsl/nir/nir_constant_expressions.py
> index 2ba8554..b16ef50 100644
> --- a/src/glsl/nir/nir_constant_expressions.py
> +++ b/src/glsl/nir/nir_constant_expressions.py
> @@ -213,7 +213,7 @@ unpack_half_1x16(uint16_t u)
>  }
>
>  /* Some typed vector structures to make things like src0.y work */
> -% for type in ["float", "int", "unsigned", "bool"]:
> +% for type in ["float", "int", "uint", "bool"]:
>  struct ${type}_vec {
> ${type} x;
> ${type} y;
> diff --git a/src/glsl/nir/nir_opcodes.py b/src/glsl/nir/nir_opcodes.py
> index 729f695..8db24eb 100644
> --- a/src/glsl/nir/nir_opcodes.py
> +++ b/src/glsl/nir/nir_opcodes.py
> @@ -91,7 +91,7 @@ class Opcode(object):
>  tfloat = "float"
>  tint = "int"
>  tbool = "bool"
> -tunsigned = "unsigned"
> +tuint = "uint"
>
>  commutative = "commutative "
>  associative = "associative "
> @@ -156,7 +156,7 @@ unop("fsqrt", tfloat, "sqrtf(src0)")
>  unop("fexp2", tfloat, "exp2f(src0)")
>  unop("flog2", tfloat, "log2f(src0)")
>  unop_convert("f2i", tfloat, tint, "src0") # Float-to-integer conversion.
> -unop_convert("f2u", tfloat, tunsigned, "src0") # Float-to-unsigned conversion
> +unop_convert("f2u", tfloat, tuint, "src0") # Float-to-unsigned conversion
>  unop_convert("i2f", tint, tfloat, "src0") # Integer-to-float conversion.
>  # Float-to-boolean conversion
>  unop_convert("f2b", tfloat, tbool, "src0 != 0.0f")
> @@ -165,7 +165,7 @@ unop_convert("b2f", tbool, tfloat, "src0 ? 1.0f : 0.0f")
>  # Int-to-boolean conversion
>  unop_convert("i2b", tint, tbool, "src0 != 0")
>  unop_convert("b2i", tbool, tint, "src0 ? 1 : 0") # Boolean-to-int conversion
> -unop_convert("u2f", tunsigned, tfloat, "src0") #Unsigned-to-float conversion.
> +unop_convert("u2f", tuint, tfloat, "src0") #Unsigned-to-float conversion.

While you're modifying this line, could you put a space after the # ?

Reviewed-by: Matt Turner 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev