gm107/ir: emit barrier sources for quadon/pop

We drop them later on, but it's actually how that needs to be done on
Volta.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11061>
This commit is contained in:
Karol Herbst 2020-07-14 22:36:47 +02:00 committed by Marge Bot
parent de666cc418
commit f4847077c7
2 changed files with 23 additions and 2 deletions

View file

@ -76,10 +76,28 @@ GM107LegalizeSSA::handleLOAD(Instruction *i)
i->op = OP_MOV;
}
void
GM107LegalizeSSA::handleQUADON(Instruction *i)
{
i->setDef(0, NULL);
}
void
GM107LegalizeSSA::handleQUADPOP(Instruction *i)
{
i->setSrc(0, NULL);
}
bool
GM107LegalizeSSA::visit(Instruction *i)
{
switch (i->op) {
case OP_QUADON:
handleQUADON(i);
break;
case OP_QUADPOP:
handleQUADPOP(i);
break;
case OP_PFETCH:
handlePFETCH(i);
break;
@ -118,9 +136,10 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i)
tmp = bld.getScratch();
for (l = 0; l < 4; ++l) {
Value *bar = bld.getSSA(4, FILE_BARRIER);
Value *src[3], *val;
Value *lane = bld.mkImm(l);
bld.mkOp(OP_QUADON, TYPE_NONE, NULL);
bld.mkOp(OP_QUADON, TYPE_U32, bar);
// Make sure lane 0 has the appropriate array/depth compare values
if (l != 0) {
if (array)
@ -179,7 +198,7 @@ GM107LoweringPass::handleManualTXD(TexInstruction *i)
if (l != 0)
for (c = 0; i->defExists(c); ++c)
bld.mkOp3(OP_SHFL, TYPE_F32, tex->getDef(c), tex->getDef(c), bld.mkImm(0), quad);
bld.mkOp(OP_QUADPOP, TYPE_NONE, NULL);
bld.mkOp1(OP_QUADPOP, TYPE_U32, NULL, bar)->fixed = 1;
// save results
for (c = 0; i->defExists(c); ++c) {

View file

@ -24,6 +24,8 @@ private:
protected:
void handlePFETCH(Instruction *);
void handleLOAD(Instruction *);
void handleQUADON(Instruction *);
void handleQUADPOP(Instruction *);
};
} // namespace nv50_ir