nvir/gm107: implement OP_PERMT

PFETCH lowering will be changed to use this as it's more SM70-friendly,
and this will also allow us to implement extract_byte/word opcodes.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5377>
This commit is contained in:
Ben Skeggs
2020-06-07 09:52:21 +10:00
committed by Marge Bot
parent 9670c087a7
commit 4f7798be9f

View File

@@ -170,6 +170,7 @@ private:
void emitBFI();
void emitBFE();
void emitFLO();
void emitPRMT();
void emitLDSTs(int, DataType);
void emitLDSTc(int);
@@ -2371,6 +2372,33 @@ CodeEmitterGM107::emitFLO()
emitGPR (0x00, insn->def(0));
}
void
CodeEmitterGM107::emitPRMT()
{
switch (insn->src(1).getFile()) {
case FILE_GPR:
emitInsn(0x5bc00000);
emitGPR (0x14, insn->src(1));
break;
case FILE_MEMORY_CONST:
emitInsn(0x4bc00000);
emitCBUF(0x22, -1, 0x14, 16, 2, insn->src(1));
break;
case FILE_IMMEDIATE:
emitInsn(0x36c00000);
emitIMMD(0x14, 19, insn->src(1));
break;
default:
assert(!"bad src1 file");
break;
}
emitField(0x30, 3, insn->subOp);
emitGPR (0x27, insn->src(2));
emitGPR (0x08, insn->src(0));
emitGPR (0x00, insn->def(0));
}
/*******************************************************************************
* memory
******************************************************************************/
@@ -3537,6 +3565,9 @@ CodeEmitterGM107::emitInstruction(Instruction *i)
case OP_BFIND:
emitFLO();
break;
case OP_PERMT:
emitPRMT();
break;
case OP_SLCT:
if (isFloatType(insn->dType))
emitFCMP();