<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 10, 2016 at 4:00 PM, Connor Abbott <span dir="ltr"><<a href="mailto:cwabbott0@gmail.com" target="_blank">cwabbott0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, Mar 7, 2016 at 3:45 AM, Samuel Iglesias Gonsálvez<br>
<<a href="mailto:siglesias@igalia.com">siglesias@igalia.com</a>> wrote:<br>
> From: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>><br>
><br>
> v2: Fix size/type mask to properly handle 8-bit types.<br>
><br>
> Signed-off-by: Juan A. Suarez Romero <<a href="mailto:jasuarez@igalia.com">jasuarez@igalia.com</a>><br>
> ---<br>
>  src/compiler/nir/nir.h | 17 ++++++++++++++++-<br>
>  1 file changed, 16 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
> index cccb3a4..659e98c 100644<br>
> --- a/src/compiler/nir/nir.h<br>
> +++ b/src/compiler/nir/nir.h<br>
> @@ -605,9 +605,24 @@ typedef enum {<br>
>     nir_type_float,<br>
>     nir_type_int,<br>
>     nir_type_uint,<br>
> -   nir_type_bool<br>
> +   nir_type_bool,<br>
> +   nir_type_bool32 =    32 | nir_type_bool,<br>
> +   nir_type_int8 =      8  | nir_type_int,<br>
> +   nir_type_int16 =     16 | nir_type_int,<br>
> +   nir_type_int32 =     32 | nir_type_int,<br>
> +   nir_type_int64 =     64 | nir_type_int,<br>
> +   nir_type_uint8 =     8  | nir_type_uint,<br>
> +   nir_type_uint16 =    16 | nir_type_uint,<br>
> +   nir_type_uint32 =    32 | nir_type_uint,<br>
> +   nir_type_uint64 =    64 | nir_type_uint,<br>
> +   nir_type_float16 =   16 | nir_type_float,<br>
> +   nir_type_float32 =   32 | nir_type_float,<br>
> +   nir_type_float64 =   64 | nir_type_float,<br>
>  } nir_alu_type;<br>
><br>
> +#define NIR_ALU_TYPE_SIZE_MASK 0xfffffff8<br>
> +#define NIR_ALU_TYPE_BASE_TYPE_MASK 0x00000007<br>
<br>
</div></div>So I'm not really the one to be reviewing this series (after all, I<br>
wrote most of it :) ) but one thing that I never quite liked, and<br>
didn't get around to fixing, is how we use these raw constants all<br>
over the place. Perhaps we could make things more readable by adding<br>
nir_get_sized_type(), nir_get_unsized_type(), and nir_type_size()<br>
helpers and then use those instead of or-ing/and-ing things together<br>
everywhere.<br></blockquote><div><br></div><div>Agreed.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
> +<br>
>  typedef enum {<br>
>     NIR_OP_IS_COMMUTATIVE = (1 << 0),<br>
>     NIR_OP_IS_ASSOCIATIVE = (1 << 1),<br>
> --<br>
> 2.7.0<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</div></div></blockquote></div><br></div></div>