From: Alyssa Rosenzweig Date: Wed, 29 Apr 2020 22:10:43 +0000 (-0400) Subject: pan/mdg: Apply abs/neg modifiers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b124f5315cf5b6a81ddfc18643a3a52ed9a87a83;p=mesa.git pan/mdg: Apply abs/neg modifiers Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index 0f57ba67626..96a8c1c9397 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -603,6 +603,15 @@ static void mir_copy_src(midgard_instruction *ins, nir_alu_instr *instr, unsigned i, unsigned to, bool *abs, bool *neg, bool is_int, unsigned bcast_count) { nir_alu_src src = instr->src[i]; + + if (!is_int) { + if (pan_has_source_mod(&src, nir_op_fneg)) + *neg = !(*neg); + + if (pan_has_source_mod(&src, nir_op_fabs)) + *abs = true; + } + unsigned bits = nir_src_bit_size(src.src); ins->src[to] = nir_src_index(NULL, &src.src);