Module: Mesa
Branch: master
Commit: acab788578cd1ccd67b042798786a39394ad5f03
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=acab788578cd1ccd67b042798786a39394ad5f03

Author: Alyssa Rosenzweig <alyssa.rosenzw...@collabora.com>
Date:   Tue Mar 10 07:56:14 2020 -0400

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 <alyssa.rosenzw...@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4139>

---

 src/panfrost/bifrost/bifrost_compile.c | 4 ++++
 src/panfrost/bifrost/bifrost_compile.h | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

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,

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to