<div dir="ltr">agreed.<br></div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 19, 2018 at 5:57 AM Connor Abbott <<a href="mailto:cwabbott0@gmail.com">cwabbott0@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This will cause the assert to pass when it shouldn't in some cases<br>
with a 32-bit bitsize, and seems like a hack since it's subverting the<br>
point of the assert, which is guarantee that we won't lose any<br>
information by truncating the source. It would be better to fix the<br>
caller that's hitting the assert, and maybe change the argument to be<br>
a int64_t too.<br>
On Mon, Nov 19, 2018 at 10:38 AM Samuel Pitoiset<br>
<<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>> wrote:<br>
><br>
> Fixes dEQP-VK.spirv_assembly.type.scalar.i16.*<br>
><br>
> Fixes: 1f29f4db1e ("nir/builder: Assert that intN_t immediates fit")<br>
> Signed-off-by: Samuel Pitoiset <<a href="mailto:samuel.pitoiset@gmail.com" target="_blank">samuel.pitoiset@gmail.com</a>><br>
> ---<br>
>  src/compiler/nir/nir_builder.h | 3 ++-<br>
>  1 file changed, 2 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h<br>
> index e37aba23dc..1f29209157 100644<br>
> --- a/src/compiler/nir/nir_builder.h<br>
> +++ b/src/compiler/nir/nir_builder.h<br>
> @@ -332,7 +332,8 @@ nir_imm_intN_t(nir_builder *build, uint64_t x, unsigned bit_size)<br>
><br>
>     assert(bit_size == 64 ||<br>
>            (int64_t)x >> bit_size == 0 ||<br>
> -          (int64_t)x >> bit_size == -1);<br>
> +          (int64_t)x >> bit_size == -1 ||<br>
> +          (int64_t)x >> bit_size == 65535);<br>
><br>
>     memset(&v, 0, sizeof(v));<br>
>     assert(bit_size <= 64);<br>
> --<br>
> 2.19.1<br>
><br>
> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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" target="_blank">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>
</blockquote></div>