From 0906d754799f4b831150a62e2a73ee9a2f34fd1c Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 3 May 2021 18:29:35 -0400 Subject: [PATCH] pan/bi: Handle ineg Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 4 ++++ src/panfrost/bifrost/bifrost_nir_algebraic.py | 8 +------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 52b5eecd90f..ca1d33f862b 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -1969,6 +1969,10 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr) bi_hadd_to(b, nir_type_int, sz, dst, s0, s1, BI_ROUND_RTP); break; + case nir_op_ineg: + bi_isub_to(b, nir_type_int, sz, dst, bi_zero(), s0, false); + break; + case nir_op_isub: bi_isub_to(b, nir_type_int, sz, dst, s0, s1, false); break; diff --git a/src/panfrost/bifrost/bifrost_nir_algebraic.py b/src/panfrost/bifrost/bifrost_nir_algebraic.py index 81d2708573a..5dd553cb685 100644 --- a/src/panfrost/bifrost/bifrost_nir_algebraic.py +++ b/src/panfrost/bifrost/bifrost_nir_algebraic.py @@ -30,13 +30,7 @@ a = 'a' b = 'b' c = 'c' -algebraic_late = [ - # ineg must be lowered late, but only for integers; floats will try to - # have modifiers attached... hence why this has to be here rather than - # a more standard lower_negate approach - - (('ineg', a), ('isub', 0, a)), -] +algebraic_late = [] for isz in ('8', '16', '32'): for osz in ('16', '32', '64'):