diff options
author | Ilia Mirkin <[email protected]> | 2014-03-11 05:44:00 -0400 |
---|---|---|
committer | Ilia Mirkin <[email protected]> | 2014-03-18 05:56:34 -0400 |
commit | ce75a3e8d36e85214e98194ca212504282df47f9 (patch) | |
tree | b472a130d96ae62dbf9242ae1960164b639d97b1 /src/gallium/drivers | |
parent | 468cc866b4b308cee40470f06b31002c6c56da96 (diff) |
nv50/ir/gk110: fix control flow opcode emission, add sat flag
Signed-off-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp | 40 |
1 files changed, 18 insertions, 22 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 fe428cacee4..29e246d1571 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); } 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 ? 0x10800000 : 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; @@ -1113,13 +1112,10 @@ CodeEmitterGK110::emitFlow(const Instruction *i) if (!f) return; - // TODO - /* if (f->allWarp) - code[0] |= 1 << 15; + code[0] |= 1 << 9; if (f->limit) - code[0] |= 1 << 16; - */ + code[0] |= 1 << 8; if (f->op == OP_CALL) { if (f->builtin) { |