From: Ilia Mirkin Date: Wed, 26 Nov 2014 22:37:45 +0000 (-0500) Subject: freedreno/ir3: don't pass consts to madsh.m16 in MOD logic X-Git-Tag: upstream/17.1.0~22294 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37fe347542aad40aac5be9066c21f65f55d0f48c;p=platform%2Fupstream%2Fmesa.git 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 Reviewed-by: Rob Clark Cc: "10.3 10.4" --- diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c index aaf362d..275eec3 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c @@ -2350,6 +2350,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);