diff options
author | Samuel Pitoiset <[email protected]> | 2016-04-18 18:50:24 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2016-04-26 19:47:49 +0200 |
commit | fddd8523d48f456d3fd614179ecd66e46625c774 (patch) | |
tree | 9788d7b61a60ab78eef1b6dd9cab151b6939e601 /src/gallium/drivers/nouveau | |
parent | c2ce22ca4641343e9bad446811a882c5c3930419 (diff) |
gk110/ir: add emission for OP_MADSP
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.cpp | 23 |
1 files changed, 23 insertions, 0 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 0968f94a1f1..a34a0d30d80 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_emit_gk110.cpp @@ -95,6 +95,7 @@ private: void emitISAD(const Instruction *); void emitFMAD(const Instruction *); void emitDMAD(const Instruction *); + void emitMADSP(const Instruction *i); void emitNOT(const Instruction *); void emitLogicOp(const Instruction *, uint8_t subOp); @@ -517,6 +518,25 @@ CodeEmitterGK110::emitDMAD(const Instruction *i) } void +CodeEmitterGK110::emitMADSP(const Instruction *i) +{ + emitForm_21(i, 0x140, 0xa40); + + if (i->subOp == NV50_IR_SUBOP_MADSP_SD) { + code[1] |= 0x00c00000; + } else { + code[1] |= (i->subOp & 0x00f) << 19; // imadp1 + code[1] |= (i->subOp & 0x0f0) << 20; // imadp2 + code[1] |= (i->subOp & 0x100) << 11; // imadp3 + code[1] |= (i->subOp & 0x200) << 15; // imadp3 + code[1] |= (i->subOp & 0xc00) << 12; // imadp3 + } + + if (i->flagsDef >= 0) + code[1] |= 1 << 18; +} + +void CodeEmitterGK110::emitFMUL(const Instruction *i) { bool neg = (i->src(0).mod ^ i->src(1).mod).neg(); @@ -2025,6 +2045,9 @@ CodeEmitterGK110::emitInstruction(Instruction *insn) else emitIMAD(insn); break; + case OP_MADSP: + emitMADSP(insn); + break; case OP_SAD: emitISAD(insn); break; |