[Nouveau] [RFC 9/9] nv50/ir/tgsi: split mad to mul+add
Karol Herbst
karolherbst at gmail.com
Sun Jun 11 18:42:39 UTC 2017
fixes
KHR-GL44.gpu_shader5.precise_qualifier
KHR-GL45.gpu_shader5.precise_qualifier
Signed-off-by: Karol Herbst <karolherbst at gmail.com>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
index c633185893..cd45e82426 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
@@ -3184,6 +3184,20 @@ Converter::handleInstruction(const struct tgsi_full_instruction *insn)
break;
case TGSI_OPCODE_MAD:
case TGSI_OPCODE_UMAD:
+ FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi) {
+ val0 = getSSA();
+ src0 = fetchSrc(0, c);
+ src1 = fetchSrc(1, c);
+ src2 = fetchSrc(2, c);
+ geni = mkOp2(OP_MUL, dstTy, val0, src0, src1);
+ if (dstTy == TYPE_F32)
+ geni->dnz = info->io.mul_zero_wins;
+ geni->precise = insn->Instruction.Precise;
+
+ geni = mkOp2(OP_ADD, dstTy, dst0[c], val0, src2);
+ geni->precise = insn->Instruction.Precise;
+ }
+ break;
case TGSI_OPCODE_SAD:
case TGSI_OPCODE_FMA:
FOR_EACH_DST_ENABLED_CHANNEL(0, c, tgsi) {
--
2.13.1
More information about the Nouveau
mailing list