summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nouveau
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2016-02-28 22:43:50 +0100
committerSamuel Pitoiset <[email protected]>2016-03-07 18:39:46 +0100
commitf4d2d491522aea8c7de46311c3f5e9c588307dd2 (patch)
tree770f7d68eb2452c84d2e6d45bbf22d50276805f0 /src/gallium/drivers/nouveau
parentcba89fdaa1e7360808cef0f6871930c90ca3ef4d (diff)
gk110/ir: allow to emit immediates for BAR
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r--src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp23
1 files changed, 21 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 0e7a23709d3..e5d638b5a8a 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,27 @@ 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);
+ assert(imm->reg.data.u32 <= 0xfff);
+ code[0] |= imm->reg.data.u32 << 23;
+ code[1] |= imm->reg.data.u32 >> 9;
+ code[1] |= 0x4000;
+ }
}
void CodeEmitterGK110::emitMEMBAR(const Instruction *i)