[Mesa-dev] [PATCH] nir: fix an assertion for 16-bit integers in nir_imm_intN_t()

Samuel Pitoiset samuel.pitoiset at gmail.com
Mon Nov 19 09:40:22 UTC 2018


Fixes dEQP-VK.spirv_assembly.type.scalar.i16.*

Fixes: 1f29f4db1e ("nir/builder: Assert that intN_t immediates fit")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/compiler/nir/nir_builder.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index e37aba23dc..1f29209157 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -332,7 +332,8 @@ nir_imm_intN_t(nir_builder *build, uint64_t x, unsigned bit_size)
 
    assert(bit_size == 64 ||
           (int64_t)x >> bit_size == 0 ||
-          (int64_t)x >> bit_size == -1);
+          (int64_t)x >> bit_size == -1 ||
+          (int64_t)x >> bit_size == 65535);
 
    memset(&v, 0, sizeof(v));
    assert(bit_size <= 64);
-- 
2.19.1



More information about the mesa-dev mailing list