From 208250b3765600681b768057d4772f5bb38f186d Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Mon, 22 Mar 2021 15:06:08 +0200 Subject: [PATCH] ir3: update info about applicability of saturation modifier On a6xx saturation doesn't work on cat4 and on bary.f Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/ir3/instr-a3xx.h | 4 +++- src/freedreno/ir3/ir3_compiler_nir.c | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/freedreno/ir3/instr-a3xx.h b/src/freedreno/ir3/instr-a3xx.h index 9eb4ea66f85..4fc1d51e565 100644 --- a/src/freedreno/ir3/instr-a3xx.h +++ b/src/freedreno/ir3/instr-a3xx.h @@ -1042,12 +1042,14 @@ static inline bool instr_sat(instr_t *instr) static inline bool is_sat_compatible(opc_t opc) { - /* TODO probably opc_cat==4 is ok too */ + /* On a6xx saturation doesn't work on cat4 */ if (opc_cat(opc) != 2 && opc_cat(opc) != 3) return false; switch (opc) { + /* On a3xx and a6xx saturation doesn't work on bary.f */ case OPC_BARY_F: + /* On a6xx saturation doesn't work on sel.* */ case OPC_SEL_B16: case OPC_SEL_B32: case OPC_SEL_S16: diff --git a/src/freedreno/ir3/ir3_compiler_nir.c b/src/freedreno/ir3/ir3_compiler_nir.c index 38a4aba3b4e..62be47c5f32 100644 --- a/src/freedreno/ir3/ir3_compiler_nir.c +++ b/src/freedreno/ir3/ir3_compiler_nir.c @@ -429,10 +429,6 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu) * (sat) bit, we can just fold the (sat) flag back to the * src instruction and create a mov. This is easier for cp * to eliminate. - * - * NOTE: a3xx definitely seen not working with flat bary.f. Same test - * uses ldlv on a4xx+, so not definitive. Seems rare enough to apply - * everywhere. */ if (alu->src[0].src.is_ssa && is_sat_compatible(src[0]->opc) &&