From 9f23007a7a56d576c8f20b76583ca2416e94a75d Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Wed, 20 Jan 2016 17:12:59 -0500 Subject: gk110/ir: add partial BAR support This is enough for the plain TGSI BARRIER implementation. Signed-off-by: Ilia Mirkin --- .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers') 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 b1064bf0a92..d79f3060beb 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -1252,8 +1252,24 @@ CodeEmitterGK110::emitPIXLD(const Instruction *i) void CodeEmitterGK110::emitBAR(const Instruction *i) { - /* TODO */ - emitNOP(i); + code[0] = 0x00000002; + code[1] = 0x85400000; + + switch (i->subOp) { + case NV50_IR_SUBOP_BAR_ARRIVE: code[1] |= 0x08; break; + case NV50_IR_SUBOP_BAR_RED_AND: code[1] |= 0x50; break; + case NV50_IR_SUBOP_BAR_RED_OR: code[1] |= 0x90; break; + case NV50_IR_SUBOP_BAR_RED_POPC: code[1] |= 0x10; break; + default: + code[1] |= 0x20; + assert(i->subOp == NV50_IR_SUBOP_BAR_SYNC); + break; + } + + emitPredicate(i); + + srcId(i->src(0), 10); + srcId(i->src(1), 23); } void -- cgit v1.2.3