diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2017-02-05 18:09:02 -0500 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2017-02-09 12:57:48 -0500 |
commit | ab00a41a6e111a8243028bc4de5f52035aa30f36 (patch) | |
tree | 00156934bd52422bc83f4d78eb63eab1c4d918cd /src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | |
parent | 61d7676df779829e713cdbc2569f7ab50492078d (diff) |
nvc0/ir: make it possible to have the flags def in def0
There's all kinds of logic that doesn't like there being holes in defs
or srcs lists. Avoid them. This also fixes the sched logic for maxwell.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Diffstat (limited to 'src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp index 145868813e3..5467447e354 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_nvc0.cpp @@ -195,13 +195,15 @@ CodeEmitterNVC0::srcAddr32(const ValueRef& src, int pos, int shr) void CodeEmitterNVC0::defId(const ValueDef& def, const int pos) { - code[pos / 32] |= (def.get() ? DDATA(def).id : 63) << (pos % 32); + code[pos / 32] |= (def.get() && def.getFile() != FILE_FLAGS ? DDATA(def).id : 63) << (pos % 32); } -void CodeEmitterNVC0::defId(const Instruction *insn, int d, int pos) +void CodeEmitterNVC0::defId(const Instruction *insn, int d, const int pos) { - int r = insn->defExists(d) ? DDATA(insn->def(d)).id : 63; - code[pos / 32] |= r << (pos % 32); + if (insn->defExists(d)) + defId(insn->def(d), pos); + else + code[pos / 32] |= 63 << (pos % 32); } bool CodeEmitterNVC0::isLIMM(const ValueRef& ref, DataType ty) @@ -716,11 +718,11 @@ CodeEmitterNVC0::emitUADD(const Instruction *i) if (i->encSize == 8) { if (isLIMM(i->src(1), TYPE_U32)) { emitForm_A(i, HEX64(08000000, 00000002)); - if (i->defExists(1)) + if (i->flagsDef >= 0) code[1] |= 1 << 26; // write carry } else { emitForm_A(i, HEX64(48000000, 00000003)); - if (i->defExists(1)) + if (i->flagsDef >= 0) code[1] |= 1 << 16; // write carry } code[0] |= addOp; |