nvc0/ir: make sure that thread count immediate for BAR fit
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 7 Mar 2016 17:26:43 +0000 (18:26 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 7 Mar 2016 17:39:41 +0000 (18:39 +0100)
The limit of the thread count immediate value is 12 bits.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp

index 7bd7c732c490b5b04681651a17a5ecbf750a4d92..8b9328b629684cfa46057512ccd1e68873e92eff 100644 (file)
@@ -1482,6 +1482,7 @@ CodeEmitterNVC0::emitBAR(const Instruction *i)
    } else {
       ImmediateValue *imm = i->getSrc(1)->asImm();
       assert(imm);
+      assert(imm->reg.data.u32 <= 0xfff);
       code[0] |= imm->reg.data.u32 << 26;
       code[1] |= imm->reg.data.u32 >> 6;
       code[1] |= 0x4000;