aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2018-01-30 12:18:13 -0500
committerRob Clark <[email protected]>2018-02-10 14:54:58 -0500
commitaea223741fa008c704e8bc66fe00bde05d51b2c7 (patch)
tree3cf97a5d7ccd926a1995e57df1852e231df6b85d /src/gallium/drivers/freedreno
parent242a8a1957c631e557c6148b5d024dc647b493ed (diff)
freedreno/ir3: handle IMMED for mad 2nd src special case
Consider also immediates for swapping the first two srcs, because they can be lowered to constant. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_cp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_cp.c b/src/gallium/drivers/freedreno/ir3/ir3_cp.c
index ca4ced73483..11d39a4093e 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_cp.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_cp.c
@@ -367,12 +367,13 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr,
*/
if ((n == 1) && is_mad(instr->opc) &&
!(instr->regs[0 + 1]->flags & (IR3_REG_CONST | IR3_REG_RELATIV)) &&
- valid_flags(instr, 0, new_flags)) {
+ valid_flags(instr, 0, new_flags & ~IR3_REG_IMMED)) {
/* swap src[0] and src[1]: */
struct ir3_register *tmp;
tmp = instr->regs[0 + 1];
instr->regs[0 + 1] = instr->regs[1 + 1];
instr->regs[1 + 1] = tmp;
+
n = 0;
} else {
return;
@@ -437,7 +438,8 @@ reg_cp(struct ir3_cp_ctx *ctx, struct ir3_instruction *instr,
debug_assert((opc_cat(instr->opc) == 1) ||
(opc_cat(instr->opc) == 6) ||
- ir3_cat2_int(instr->opc));
+ ir3_cat2_int(instr->opc) ||
+ (is_mad(instr->opc) && (n == 0)));
if (new_flags & IR3_REG_SABS)
iim_val = abs(iim_val);