From 1216a63ff22277fede7d7953019fc3412714a4af Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 10 Mar 2020 07:52:24 -0400 Subject: [PATCH] pan/bi: Implement fabs, fneg as fmov with mods Fusing will come later with the appropriate NIR support. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bifrost_compile.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 8dccb16bbe6..759f650f245 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -267,6 +267,8 @@ bi_class_for_nir_alu(nir_op op) return BI_MINMAX; case nir_op_fsat: + case nir_op_fneg: + case nir_op_fabs: case nir_op_mov: return BI_MOV; @@ -353,6 +355,12 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr) case nir_op_fsat: alu.outmod = BIFROST_SAT; /* MOV */ break; + case nir_op_fneg: + alu.src_neg[0] = true; /* MOV */ + break; + case nir_op_fabs: + alu.src_abs[0] = true; /* MOV */ + break; case nir_op_fmax: case nir_op_imax: case nir_op_umax: -- 2.30.2