[Mesa-dev] [PATCH v2 2/3] gk110/ir: allow to emit immediates for BAR
Ilia Mirkin
imirkin at alum.mit.edu
Sun Mar 6 22:28:34 UTC 2016
On Mon, Feb 29, 2016 at 3:54 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> ---
> .../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 <imirkin at alum.mit.edu>
> }
>
> void CodeEmitterGK110::emitMEMBAR(const Instruction *i)
> --
> 2.7.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list