On Sat, Jan 10, 2015 at 7:22 PM, Roy Spliet <[email protected]> wrote: > If liveness analysis indicates it's good, this should improve the chances > of being able to emit the short MAD form. > > Signed-off-by: Roy Spliet <[email protected]> > --- > src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp > b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp > index 898653c..1273449 100644 > --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp > +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_ra.cpp > @@ -627,6 +627,7 @@ RegAlloc::BuildIntervalsPass::visit(BasicBlock *bb) > #define JOIN_MASK_UNION (1 << 1) > #define JOIN_MASK_MOV (1 << 2) > #define JOIN_MASK_TEX (1 << 3) > +#define JOIN_MASK_MAD (1 << 4) > > class GCRA > { > @@ -851,7 +852,7 @@ GCRA::coalesce(ArrayList& insns) > case 0x80: > case 0x90: > case 0xa0: > - ret = doCoalesce(insns, JOIN_MASK_UNION | JOIN_MASK_TEX); > + ret = doCoalesce(insns, JOIN_MASK_UNION | JOIN_MASK_TEX | > JOIN_MASK_MAD); > break; > case 0xc0: > case 0xd0: > @@ -995,6 +996,13 @@ GCRA::doCoalesce(ArrayList& insns, unsigned int mask) > copyCompound(insn->getSrc(0), insn->getDef(0)); > } > break; > + case OP_MAD: > + if (!(mask & JOIN_MASK_MAD)) > + break; > + if (insn->srcExists(2) && insn->src(2).getFile() == FILE_GPR && > + insn->def(0).getFile() == FILE_GPR)
Use the same check here as you do elsewhere... check that insn->defExists(0). It might not in case that only flags are returned I guess? Not sure if mad actually allows that. > + coalesceValues(insn->getDef(0), insn->getSrc(2), false); > + break; > case OP_TEX: > case OP_TXB: > case OP_TXL: > -- > 2.1.0 > > > > _______________________________________________ > Nouveau mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/nouveau _______________________________________________ Nouveau mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/nouveau
