Ilia Mirkin
2014-Mar-11 09:47 UTC
[Nouveau] [PATCH] nv50/ir/gk110: fix some instruction emission
Information for this was gathered from nvdisasm. Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- Entirely untested. Ben, do you think you'll be able to give this a shot? .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 33 +++++++++++----------- 1 file changed, 16 insertions(+), 17 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 fe428ca..84f4413 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -738,8 +738,7 @@ CodeEmitterGK110::emitSFnOp(const Instruction *i, uint8_t subOp) NEG_(33, 0); ABS_(31, 0); - - // XXX: find saturate + SAT_(35, 0); } void @@ -1073,32 +1072,32 @@ CodeEmitterGK110::emitFlow(const Instruction *i) switch (i->op) { case OP_BRA: - code[1] = f->absolute ? 0x00000 : 0x12000000; // XXX - // if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) - // code[0] |= 0x4000; + code[1] = f->absolute ? 0x11000000 : 0x12000000; + if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) + code[0] |= 0x80; mask = 3; break; case OP_CALL: - code[1] = f->absolute ? 0x00000 : 0x13000000; // XXX - // if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) - // code[0] |= 0x4000; + code[1] = f->absolute ? 0x11000000 : 0x13000000; + if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) + code[0] |= 0x80; mask = 2; break; case OP_EXIT: code[1] = 0x18000000; mask = 1; break; case OP_RET: code[1] = 0x19000000; mask = 1; break; - case OP_DISCARD: code[1] = 0x19800000; mask = 1; break; // XXX: guess - case OP_BREAK: code[1] = 0x1a800000; mask = 1; break; // XXX: guess - case OP_CONT: code[1] = 0x1b000000; mask = 1; break; // XXX: guess + case OP_DISCARD: code[1] = 0x19800000; mask = 1; break; + case OP_BREAK: code[1] = 0x1a000000; mask = 1; break; + case OP_CONT: code[1] = 0x1a800000; mask = 1; break; case OP_JOINAT: code[1] = 0x14800000; mask = 2; break; - case OP_PREBREAK: code[1] = 0x15000000; mask = 2; break; // XXX: guess - case OP_PRECONT: code[1] = 0x15800000; mask = 2; break; // XXX: guess - case OP_PRERET: code[1] = 0x16000000; mask = 2; break; // XXX: guess + case OP_PREBREAK: code[1] = 0x15000000; mask = 2; break; + case OP_PRECONT: code[1] = 0x15800000; mask = 2; break; + case OP_PRERET: code[1] = 0x13800000; mask = 2; break; - case OP_QUADON: code[1] = 0x1c000000; mask = 0; break; // XXX: guess - case OP_QUADPOP: code[1] = 0x1c800000; mask = 0; break; // XXX: guess - case OP_BRKPT: code[1] = 0x1d000000; mask = 0; break; // XXX: guess + case OP_QUADON: code[1] = 0x1b000000; mask = 0; break; + case OP_QUADPOP: code[1] = 0x1c000000; mask = 0; break; + case OP_BRKPT: code[1] = 0x00000000; mask = 0; break; default: assert(!"invalid flow operation"); return; -- 1.8.3.2
Ben Skeggs
2014-Mar-11 09:57 UTC
[Nouveau] [PATCH] nv50/ir/gk110: fix some instruction emission
On Tue, Mar 11, 2014 at 7:47 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:> Information for this was gathered from nvdisasm. > > Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> > --- > > Entirely untested. Ben, do you think you'll be able to give this a shot?I'll try and take a moment in the next couple of days to give it a go.> > .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 33 +++++++++++----------- > 1 file changed, 16 insertions(+), 17 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 fe428ca..84f4413 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp > @@ -738,8 +738,7 @@ CodeEmitterGK110::emitSFnOp(const Instruction *i, uint8_t subOp) > > NEG_(33, 0); > ABS_(31, 0); > - > - // XXX: find saturate > + SAT_(35, 0); > } > > void > @@ -1073,32 +1072,32 @@ CodeEmitterGK110::emitFlow(const Instruction *i) > > switch (i->op) { > case OP_BRA: > - code[1] = f->absolute ? 0x00000 : 0x12000000; // XXX > - // if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) > - // code[0] |= 0x4000; > + code[1] = f->absolute ? 0x11000000 : 0x12000000; > + if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) > + code[0] |= 0x80; > mask = 3; > break; > case OP_CALL: > - code[1] = f->absolute ? 0x00000 : 0x13000000; // XXX > - // if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) > - // code[0] |= 0x4000; > + code[1] = f->absolute ? 0x11000000 : 0x13000000; > + if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) > + code[0] |= 0x80; > mask = 2; > break; > > case OP_EXIT: code[1] = 0x18000000; mask = 1; break; > case OP_RET: code[1] = 0x19000000; mask = 1; break; > - case OP_DISCARD: code[1] = 0x19800000; mask = 1; break; // XXX: guess > - case OP_BREAK: code[1] = 0x1a800000; mask = 1; break; // XXX: guess > - case OP_CONT: code[1] = 0x1b000000; mask = 1; break; // XXX: guess > + case OP_DISCARD: code[1] = 0x19800000; mask = 1; break; > + case OP_BREAK: code[1] = 0x1a000000; mask = 1; break; > + case OP_CONT: code[1] = 0x1a800000; mask = 1; break; > > case OP_JOINAT: code[1] = 0x14800000; mask = 2; break; > - case OP_PREBREAK: code[1] = 0x15000000; mask = 2; break; // XXX: guess > - case OP_PRECONT: code[1] = 0x15800000; mask = 2; break; // XXX: guess > - case OP_PRERET: code[1] = 0x16000000; mask = 2; break; // XXX: guess > + case OP_PREBREAK: code[1] = 0x15000000; mask = 2; break; > + case OP_PRECONT: code[1] = 0x15800000; mask = 2; break; > + case OP_PRERET: code[1] = 0x13800000; mask = 2; break; > > - case OP_QUADON: code[1] = 0x1c000000; mask = 0; break; // XXX: guess > - case OP_QUADPOP: code[1] = 0x1c800000; mask = 0; break; // XXX: guess > - case OP_BRKPT: code[1] = 0x1d000000; mask = 0; break; // XXX: guess > + case OP_QUADON: code[1] = 0x1b000000; mask = 0; break; > + case OP_QUADPOP: code[1] = 0x1c000000; mask = 0; break; > + case OP_BRKPT: code[1] = 0x00000000; mask = 0; break; > default: > assert(!"invalid flow operation"); > return; > -- > 1.8.3.2 > > _______________________________________________ > Nouveau mailing list > Nouveau at lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/nouveau
Ilia Mirkin
2014-Mar-11 12:40 UTC
[Nouveau] [PATCH] nv50/ir/gk110: fix some instruction emission
On Tue, Mar 11, 2014 at 5:57 AM, Ben Skeggs <skeggsb at gmail.com> wrote:> On Tue, Mar 11, 2014 at 7:47 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote: >> Information for this was gathered from nvdisasm. >> >> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> >> --- >> >> Entirely untested. Ben, do you think you'll be able to give this a shot? > I'll try and take a moment in the next couple of days to give it a go.There's actually a small typo in this one [ SAT_(35, 0) -> SAT_(35) ]. When you do get around to testing, you could just grab my gk110 branch (https://github.com/imirkin/mesa/commits/gk110). There is another commit there filling out texture support a bit. There may be more by the time you get to it too. Thanks, -ilia> >> >> .../drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 33 +++++++++++----------- >> 1 file changed, 16 insertions(+), 17 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 fe428ca..84f4413 100644 >> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp >> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp >> @@ -738,8 +738,7 @@ CodeEmitterGK110::emitSFnOp(const Instruction *i, uint8_t subOp) >> >> NEG_(33, 0); >> ABS_(31, 0); >> - >> - // XXX: find saturate >> + SAT_(35, 0); >> } >> >> void >> @@ -1073,32 +1072,32 @@ CodeEmitterGK110::emitFlow(const Instruction *i) >> >> switch (i->op) { >> case OP_BRA: >> - code[1] = f->absolute ? 0x00000 : 0x12000000; // XXX >> - // if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) >> - // code[0] |= 0x4000; >> + code[1] = f->absolute ? 0x11000000 : 0x12000000; >> + if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) >> + code[0] |= 0x80; >> mask = 3; >> break; >> case OP_CALL: >> - code[1] = f->absolute ? 0x00000 : 0x13000000; // XXX >> - // if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) >> - // code[0] |= 0x4000; >> + code[1] = f->absolute ? 0x11000000 : 0x13000000; >> + if (i->srcExists(0) && i->src(0).getFile() == FILE_MEMORY_CONST) >> + code[0] |= 0x80; >> mask = 2; >> break; >> >> case OP_EXIT: code[1] = 0x18000000; mask = 1; break; >> case OP_RET: code[1] = 0x19000000; mask = 1; break; >> - case OP_DISCARD: code[1] = 0x19800000; mask = 1; break; // XXX: guess >> - case OP_BREAK: code[1] = 0x1a800000; mask = 1; break; // XXX: guess >> - case OP_CONT: code[1] = 0x1b000000; mask = 1; break; // XXX: guess >> + case OP_DISCARD: code[1] = 0x19800000; mask = 1; break; >> + case OP_BREAK: code[1] = 0x1a000000; mask = 1; break; >> + case OP_CONT: code[1] = 0x1a800000; mask = 1; break; >> >> case OP_JOINAT: code[1] = 0x14800000; mask = 2; break; >> - case OP_PREBREAK: code[1] = 0x15000000; mask = 2; break; // XXX: guess >> - case OP_PRECONT: code[1] = 0x15800000; mask = 2; break; // XXX: guess >> - case OP_PRERET: code[1] = 0x16000000; mask = 2; break; // XXX: guess >> + case OP_PREBREAK: code[1] = 0x15000000; mask = 2; break; >> + case OP_PRECONT: code[1] = 0x15800000; mask = 2; break; >> + case OP_PRERET: code[1] = 0x13800000; mask = 2; break; >> >> - case OP_QUADON: code[1] = 0x1c000000; mask = 0; break; // XXX: guess >> - case OP_QUADPOP: code[1] = 0x1c800000; mask = 0; break; // XXX: guess >> - case OP_BRKPT: code[1] = 0x1d000000; mask = 0; break; // XXX: guess >> + case OP_QUADON: code[1] = 0x1b000000; mask = 0; break; >> + case OP_QUADPOP: code[1] = 0x1c000000; mask = 0; break; >> + case OP_BRKPT: code[1] = 0x00000000; mask = 0; break; >> default: >> assert(!"invalid flow operation"); >> return; >> -- >> 1.8.3.2 >> >> _______________________________________________ >> Nouveau mailing list >> Nouveau at lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/nouveau
Possibly Parallel Threads
- [PATCH] nv50/ir/gk110: fix some instruction emission
- [PATCH] nv50/ir/gk110: fix set with f32 dest
- [PATCH mesa 3/6] nouveau: codegen: gk110: Make emitSTORE offset handling identical to emitLOAD
- [PATCH 1/3] gk110/ir: emit texbar the same way that the blob does
- [PATCH 1/2] nvc0: add support for texture gather