Mesa (10.3): freedreno/ir3: don't pass consts to madsh.m16 in MOD logic

Emil Velikov evelikov at kemper.freedesktop.org
Fri Nov 28 17:28:16 UTC 2014


Module: Mesa
Branch: 10.3
Commit: 4739c7766d57cb584f9b515ddf823d3f102d0af8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4739c7766d57cb584f9b515ddf823d3f102d0af8

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Wed Nov 26 17:37:45 2014 -0500

freedreno/ir3: don't pass consts to madsh.m16 in MOD logic

madsh.m16 can't handle a const in src1, make sure to unconst it

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Rob Clark <robdclark at gmail.com>
Cc: "10.3 10.4" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit 37fe347542aad40aac5be9066c21f65f55d0f48c)

---

 src/gallium/drivers/freedreno/ir3/ir3_compiler.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
index eb320fa..fdd62ef 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c
@@ -2374,6 +2374,9 @@ trans_idiv(const struct instr_translater *t,
 	if (t->tgsi_opc == TGSI_OPCODE_MOD || t->tgsi_opc == TGSI_OPCODE_UMOD) {
 		/* The division result will have ended up in q. */
 
+		if (is_rel_or_const(b))
+			b = get_unconst(ctx, b);
+
 		/* mull.u r, q, b */
 		instr = instr_create(ctx, 2, OPC_MULL_U);
 		vectorize(ctx, instr, &r_dst, 2, q_src, 0, b, 0);




More information about the mesa-commit mailing list