<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 10, 2016 at 11:33 PM, Samuel Iglesias Gonsálvez <span dir="ltr"><<a href="mailto:siglesias@igalia.com" target="_blank">siglesias@igalia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<div><div class="h5"><br>
<br>
<br>
On 11/03/16 01:08, Jason Ekstrand wrote:<br>
> On Thu, Mar 10, 2016 at 4:00 PM, Connor Abbott<br>
> <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br>
><br>
>> 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>
>>> src/compiler/nir/nir.h | 17 ++++++++++++++++- 1 file changed,<br>
>>> 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 --- a/src/compiler/nir/nir.h +++<br>
>>> b/src/compiler/nir/nir.h @@ -605,9 +605,24 @@ typedef enum {<br>
>>> nir_type_float, nir_type_int, nir_type_uint, -   nir_type_bool<br>
>>> +   nir_type_bool, +   nir_type_bool32 =    32 |<br>
>>> nir_type_bool, +   nir_type_int8 =      8  | nir_type_int, +<br>
>>> nir_type_int16 =     16 | nir_type_int, +   nir_type_int32 =<br>
>>> 32 | nir_type_int, +   nir_type_int64 =     64 | nir_type_int,<br>
>>> +   nir_type_uint8 =     8  | nir_type_uint, +<br>
>>> nir_type_uint16 =    16 | nir_type_uint, +   nir_type_uint32 =<br>
>>> 32 | nir_type_uint, +   nir_type_uint64 =    64 |<br>
>>> nir_type_uint, +   nir_type_float16 =   16 | nir_type_float, +<br>
>>> nir_type_float32 =   32 | nir_type_float, +   nir_type_float64<br>
>>> =   64 | nir_type_float, } nir_alu_type;<br>
>>><br>
>>> +#define NIR_ALU_TYPE_SIZE_MASK 0xfffffff8 +#define<br>
>>> NIR_ALU_TYPE_BASE_TYPE_MASK 0x00000007<br>
>><br>
>> So I'm not really the one to be reviewing this series (after all,<br>
>> I wrote most of it :) ) but one thing that I never quite liked,<br>
>> and didn't get around to fixing, is how we use these raw<br>
>> constants all over the place. Perhaps we could make things more<br>
>> readable by adding nir_get_sized_type(), nir_get_unsized_type(),<br>
>> and nir_type_size() helpers and then use those instead of<br>
>> or-ing/and-ing things together everywhere.<br>
>><br>
><br>
> Agreed.<br>
><br>
><br>
<br>
</div></div>Agreed. We saw it too but, as this is used in a lot in the fp64 patches,<br>
we were thinking on apply one patch at the end of the fp64 series adding<br>
those helper functions (maybe just macros like NIR_GET_UNSIZED_TYPE and<br>
NIR_GET_TYPE_SIZE) and adapting the users of the mask.<br>
<br>
However, we can add them here and modify the rest of fp64 patches if<br>
you prefer it.<br></blockquote><div><br></div><div>Either is fine by me.  Just so long as it happens.<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Sam<br>
<span class=""><br>
>><br>
>>> + typedef enum { NIR_OP_IS_COMMUTATIVE = (1 << 0),<br>
>>> NIR_OP_IS_ASSOCIATIVE = (1 << 1), -- 2.7.0<br>
>>><br>
>>> _______________________________________________ mesa-dev<br>
>>> mailing list <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>
>> _______________________________________________ mesa-dev mailing<br>
>> list <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>
><br>
</span>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v2<br>
<br>
iQIcBAEBCAAGBQJW4nTAAAoJEH/0ujLxfcNDQmcP/3PDBMxX+z91XQ0wSY7QMuu8<br>
I4BVir0n1J3g05S8Yid+z61vCOMNdDB9xmUCJmV1Jv+YuS4SB5GaluHj9jFBPgvj<br>
YQtT5SnoGC1tBEViAPa+nNRwxF+fxh8xLKG+OQ2IXqDMAdIsx5V772Ea8/anClhi<br>
q4d8Fw93URPubBKTTh8IMt/dOa0oN3L0Cka7062bLl27+Y2Ml8MyPVLEQPBI2WP8<br>
ayMicIDco2ldRS3u/jteGc6R4GI9Ef8gIsSVyEYPKUYgNmVkun5LMJjpjbh2PXBB<br>
VaManLcCdv6Yf2GP9ehQjTp4rr0GLl2rcAaftt0pD7MN1ZzQlFp/opyIQpzFe+Ny<br>
hqzzvbn8wh/W4goKbfir6HpasaPC56AamTnHZ9zJVhaUIPjan/oSSRHRoK9kswib<br>
rpnj5WDQN9KKnuY89Pxoo/w8aesgyektLiFbsXQx7jbNVxKOdrvKwnhSjSQs0sUG<br>
C+e/2oLSMiH2VLnYT7iJoinD8IlQXgmYBo/IZvFgtcOfZdJRgSssrWQclfagv8MR<br>
dzNLUTR5sS6/GG+4nTuD14uGaswuToCRCNiq2CDnemFXMdtgkIkztj8dwZd8u9hY<br>
kP5UQKoW6KU+0fFf8PQez2YCFX/dxLXtRyP8uP+V5ZUh1y+Qv4TDwYacl/VG8Hlt<br>
kx7+UXIC4g/vUS5ONfP0<br>
=6z48<br>
-----END PGP SIGNATURE-----<br>
</blockquote></div><br></div></div>