From: Alyssa Rosenzweig Date: Tue, 10 Mar 2020 11:52:24 +0000 (-0400) Subject: pan/bi: Implement fabs, fneg as fmov with mods X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1216a63ff22277fede7d7953019fc3412714a4af;p=mesa.git 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: --- 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: