From 0b5f40b881d149d6c960d4ff8f69b58596cf9660 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Sat, 13 Aug 2016 15:45:35 -0400 Subject: [PATCH] nv50/ir: properly clear upper bits of a bitset fill Found by inspection. In practice, val is always == 0, so this never got triggered. Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp index 682c569..1daf778 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp @@ -297,8 +297,8 @@ void BitSet::fill(uint32_t val) unsigned int i; for (i = 0; i < (size + 31) / 32; ++i) data[i] = val; - if (val) - data[i] &= ~(0xffffffff << (size % 32)); // BE ? + if (val && i) + data[i - 1] &= (1 << (size % 32)) - 1; } void BitSet::setOr(BitSet *pA, BitSet *pB) -- 2.7.4