r300: don't read from output transform_r300_vertex_SEQ/SNE

Native rewrite in current form doesn't check
type of register and may use output as a
temp.

Helps with 218 deqp-gles2 tests.

Cc: mesa-stable

Reviewed-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17736>
This commit is contained in:
Filip Gawin 2022-07-25 16:18:04 +02:00 committed by Marge Bot
parent 19f8d33876
commit 875ee25e98

View file

@ -699,25 +699,25 @@ static void transform_r300_vertex_SEQ(struct radeon_compiler *c,
struct rc_instruction *inst)
{
/* x = y <==> x >= y && y >= x */
int tmp = rc_find_free_temporary(c);
/* x <= y */
struct rc_dst_register dst0 = try_to_reuse_dst(c, inst);
emit2(c, inst->Prev, RC_OPCODE_SGE, NULL,
dstregtmpmask(tmp, inst->U.I.DstReg.WriteMask),
dst0,
inst->U.I.SrcReg[0],
inst->U.I.SrcReg[1]);
/* y <= x */
int tmp = rc_find_free_temporary(c);
emit2(c, inst->Prev, RC_OPCODE_SGE, NULL,
inst->U.I.DstReg,
dstregtmpmask(tmp, inst->U.I.DstReg.WriteMask),
inst->U.I.SrcReg[1],
inst->U.I.SrcReg[0]);
/* x && y = x * y */
emit2(c, inst->Prev, RC_OPCODE_MUL, NULL,
inst->U.I.DstReg,
srcreg(RC_FILE_TEMPORARY, tmp),
srcreg(inst->U.I.DstReg.File, inst->U.I.DstReg.Index));
srcreg(dst0.File, dst0.Index),
srcreg(RC_FILE_TEMPORARY, tmp));
rc_remove_instruction(inst);
}
@ -726,25 +726,25 @@ static void transform_r300_vertex_SNE(struct radeon_compiler *c,
struct rc_instruction *inst)
{
/* x != y <==> x < y || y < x */
int tmp = rc_find_free_temporary(c);
/* x < y */
struct rc_dst_register dst0 = try_to_reuse_dst(c, inst);
emit2(c, inst->Prev, RC_OPCODE_SLT, NULL,
dstregtmpmask(tmp, inst->U.I.DstReg.WriteMask),
dst0,
inst->U.I.SrcReg[0],
inst->U.I.SrcReg[1]);
/* y < x */
int tmp = rc_find_free_temporary(c);
emit2(c, inst->Prev, RC_OPCODE_SLT, NULL,
inst->U.I.DstReg,
dstregtmpmask(tmp, inst->U.I.DstReg.WriteMask),
inst->U.I.SrcReg[1],
inst->U.I.SrcReg[0]);
/* x || y = max(x, y) */
emit2(c, inst->Prev, RC_OPCODE_MAX, NULL,
inst->U.I.DstReg,
srcreg(RC_FILE_TEMPORARY, tmp),
srcreg(inst->U.I.DstReg.File, inst->U.I.DstReg.Index));
srcreg(dst0.File, dst0.Index),
srcreg(RC_FILE_TEMPORARY, tmp));
rc_remove_instruction(inst);
}