diff options
Diffstat (limited to 'src/gallium/drivers/nouveau')
-rw-r--r-- | src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp index a7d81774a83..b32bc13f755 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp @@ -1465,6 +1465,20 @@ GCRA::allocateRegisters(ArrayList& insns) if (lval) { nodes[i].init(regs, lval); RIG.insert(&nodes[i]); + + if (lval->inFile(FILE_GPR) && lval->defs.size() > 0 && + prog->getTarget()->getChipset() < 0xc0) { + Instruction *insn = lval->getInsn(); + if (insn->op == OP_MAD || insn->op == OP_SAD) + // Short encoding only possible if they're all GPRs, no need to + // affect them otherwise. + if (insn->flagsDef < 0 && + isFloatType(insn->dType) && + insn->src(0).getFile() == FILE_GPR && + insn->src(1).getFile() == FILE_GPR && + insn->src(2).getFile() == FILE_GPR) + nodes[i].addRegPreference(getNode(insn->getSrc(2)->asLValue())); + } } } |