On Mon, Feb 29, 2016 at 3:54 PM, Samuel Pitoiset
<[email protected]> wrote:
> Signed-off-by: Samuel Pitoiset <[email protected]>
> ---
>  .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 22 
> ++++++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp 
> b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
> index 21138b1..46caa3c 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp
> @@ -1279,8 +1279,26 @@ CodeEmitterGK110::emitBAR(const Instruction *i)
>
>     emitPredicate(i);
>
> -   srcId(i->src(0), 10);
> -   srcId(i->src(1), 23);
> +   // barrier id
> +   if (i->src(0).getFile() == FILE_GPR) {
> +      srcId(i->src(0), 10);
> +   } else {
> +      ImmediateValue *imm = i->getSrc(0)->asImm();
> +      assert(imm);
> +      code[0] |= imm->reg.data.u32 << 10;
> +      code[1] |= 0x8000;
> +   }
> +
> +   // thread count
> +   if (i->src(1).getFile() == FILE_GPR) {
> +      srcId(i->src(1), 23);
> +   } else {
> +      ImmediateValue *imm = i->getSrc(0)->asImm();
> +      assert(imm);
> +      code[0] |= imm->reg.data.u32 << 23;
> +      code[1] |= imm->reg.data.u32 >> 9;
> +      code[1] |= 0x4000;
> +   }

Please ensure that both of these u32 values fit. Not sure what the
limit is, but you should figure it out and then assert that it's less
than that. With that accounted for, this is

Reviewed-by: Ilia Mirkin <[email protected]>

>  }
>
>  void CodeEmitterGK110::emitMEMBAR(const Instruction *i)
> --
> 2.7.1
>
> _______________________________________________
> mesa-dev mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to