pan/bi: Don't gobble zero ports

In case we've reading/writing R0.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4458>
This commit is contained in:
Alyssa Rosenzweig 2020-04-01 18:08:32 -04:00 committed by Marge Bot
parent c7a6df4638
commit 69dde49f80
1 changed files with 6 additions and 3 deletions

View File

@ -363,12 +363,15 @@ bi_pack_registers(struct bi_registers regs)
}
/* When port 3 isn't used, we have to set it to port 2, and vice versa,
* or we an INSTR_INVALID_ENC is raised. The reason is unknown. */
* or INSTR_INVALID_ENC is raised. The reason is unknown. */
if (!regs.port[3])
bool has_port2 = regs.write_fma || regs.write_add;
bool has_port3 = regs.read_port3 || (regs.write_fma && regs.write_add);
if (!has_port3)
regs.port[3] = regs.port[2];
if (!regs.port[2])
if (!has_port2)
regs.port[2] = regs.port[3];
s.reg3 = regs.port[3];