From b124f5315cf5b6a81ddfc18643a3a52ed9a87a83 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 29 Apr 2020 18:10:43 -0400 Subject: [PATCH] pan/mdg: Apply abs/neg modifiers Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/midgard/midgard_compile.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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); -- 2.30.2