nv50/ir: allow a mov to emit directly to a shader output

Under some very rare circumstances, the OP_EXPORT will refer to a def
provided by a mov. When we then try to make the defining op write to the
export directly, it blows up. Reuse the existing setDst helper which
handles this and more for the long encoding.

Fixes dEQP-GLES3.functional.shaders.precision.int.highp_mul_vertex

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8396>
This commit is contained in:
Ilia Mirkin 2021-01-06 14:18:05 -05:00 committed by Marge Bot
parent dd7d0b8a2f
commit 73fa50452c

View file

@ -785,13 +785,14 @@ CodeEmitterNV50::emitMOV(const Instruction *i)
} else {
if (i->encSize == 4) {
code[0] = 0x10008000;
defId(i->def(0), 2);
} else {
code[0] = 0x10000001;
code[1] = (typeSizeof(i->dType) == 2) ? 0 : 0x04000000;
code[1] |= (i->lanes << 14);
setDst(i, 0);
emitFlagsRd(i);
}
defId(i->def(0), 2);
srcId(i->src(0), 9);
}
if (df == FILE_SHADER_OUTPUT) {