From: Ilia Mirkin Date: Sat, 13 Aug 2016 19:45:35 +0000 (-0400) Subject: nv50/ir: properly clear upper bits of a bitset fill X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0b5f40b881d149d6c960d4ff8f69b58596cf9660;p=mesa.git 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 --- diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_util.cpp index 682c5690624..1daf778e934 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)