Mesa (master): gk110/ir: add partial BAR support
Ilia Mirkin
imirkin at kemper.freedesktop.org
Wed Jan 20 22:17:25 UTC 2016
Module: Mesa
Branch: master
Commit: 9f23007a7a56d576c8f20b76583ca2416e94a75d
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f23007a7a56d576c8f20b76583ca2416e94a75d
Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date: Wed Jan 20 17:12:59 2016 -0500
gk110/ir: add partial BAR support
This is enough for the plain TGSI BARRIER implementation.
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
.../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 20 ++++++++++++++++++--
1 file changed, 18 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 b1064bf..d79f306 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
More information about the mesa-commit
mailing list