Mesa (main): r600: ignore dest sel for non-write targets when counting registers

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 12 12:16:40 UTC 2022


Module: Mesa
Branch: main
Commit: 3c4644afb0820db974aa0dfe6dc51da830aeff7b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c4644afb0820db974aa0dfe6dc51da830aeff7b

Author: Gert Wollny <gert.wollny at collabora.com>
Date:   Sun Feb  6 17:23:27 2022 +0100

r600: ignore dest sel for non-write targets when counting registers

Since the value is not written, there is no need to allocate
a register for it, so don't take it into account.

Signed-off-by: Gert Wollny <gert.wollny at collabora.com>
Acked-by: Emma Anholt <emma at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15714>

---

 src/gallium/drivers/r600/r600_asm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/drivers/r600/r600_asm.c b/src/gallium/drivers/r600/r600_asm.c
index a2690f23015..bce21abf178 100644
--- a/src/gallium/drivers/r600/r600_asm.c
+++ b/src/gallium/drivers/r600/r600_asm.c
@@ -1302,7 +1302,7 @@ int r600_bytecode_add_alu_type(struct r600_bytecode *bc,
 			r600_bytecode_special_constants(nalu->src[i].value,
 				&nalu->src[i].sel);
 	}
-	if (nalu->dst.sel >= bc->ngpr) {
+	if (nalu->dst.write && nalu->dst.sel >= bc->ngpr) {
 		bc->ngpr = nalu->dst.sel + 1;
 	}
 	list_addtail(&nalu->list, &bc->cf_last->alu);



More information about the mesa-commit mailing list