pan/bi: Disable lower_sub
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 10 Mar 2020 11:56:14 +0000 (07:56 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 10 Mar 2020 19:25:59 +0000 (19:25 +0000)
For float, fixing up the modifier ourselves is easy. For int, we have a
dedicated isub instruction anyway.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4139>

src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/bifrost_compile.h

index 759f650f245161af30c4d2a654a074abed5742fe..6fa982e50f4651cefe4d6e83e4875e266cd468db 100644 (file)
@@ -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:
index f06e0b587009afcf8ed5ad5b58852a20974c4db5..8f1e9f1bc8d48fc2312a58ae7bfeb006e207dd42 100644 (file)
@@ -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,