From: Alyssa Rosenzweig Date: Tue, 10 Mar 2020 11:56:14 +0000 (-0400) Subject: pan/bi: Disable lower_sub X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=acab788578cd1ccd67b042798786a39394ad5f03;p=mesa.git pan/bi: Disable lower_sub For float, fixing up the modifier ourselves is easy. For int, we have a dedicated isub instruction anyway. Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index 759f650f245..6fa982e50f4 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -231,6 +231,7 @@ bi_class_for_nir_alu(nir_op op) switch (op) { case nir_op_iadd: case nir_op_fadd: + case nir_op_fsub: return BI_ADD; case nir_op_i2i8: @@ -361,6 +362,9 @@ emit_alu(bi_context *ctx, nir_alu_instr *instr) case nir_op_fabs: alu.src_abs[0] = true; /* MOV */ break; + case nir_op_fsub: + alu.src_neg[1] = true; /* ADD */ + break; case nir_op_fmax: case nir_op_imax: case nir_op_umax: diff --git a/src/panfrost/bifrost/bifrost_compile.h b/src/panfrost/bifrost/bifrost_compile.h index f06e0b58700..8f1e9f1bc8d 100644 --- a/src/panfrost/bifrost/bifrost_compile.h +++ b/src/panfrost/bifrost/bifrost_compile.h @@ -35,7 +35,6 @@ void bifrost_compile_shader_nir(nir_shader *nir, bifrost_program *program, unsig static const nir_shader_compiler_options bifrost_nir_options = { .lower_ffma = true, - .lower_sub = true, .lower_scmp = true, .lower_flrp32 = true, .lower_flrp64 = true,