pan/mdg: Ingest actual isub ops
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 30 Apr 2020 19:41:10 +0000 (15:41 -0400)
committerMarge Bot <eric+marge@anholt.net>
Fri, 1 May 2020 18:26:36 +0000 (18:26 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4852>

src/panfrost/midgard/midgard_compile.h
src/panfrost/midgard/midgard_nir_algebraic.py

index c59732fbd60fc95177445a028862a36593c122fc..bf98342c4f6793ddb127e7b11358b333d36e8e13 100644 (file)
@@ -38,7 +38,6 @@ midgard_compile_shader_nir(nir_shader *nir, panfrost_program *program, bool is_b
 
 static const nir_shader_compiler_options midgard_nir_options = {
         .lower_ffma = true,
-        .lower_sub = true,
         .lower_scmp = true,
         .lower_flrp16 = true,
         .lower_flrp32 = true,
index 3dc1900cca1797728fd1c6f4ec54119c2723879e..e8547a5067c863b7f0690d7360a388d3dcfbb3cc 100644 (file)
@@ -37,6 +37,9 @@ algebraic_late = [
 
     (('ineg', a), ('isub', 0, a)),
 
+    # Likewise we want fsub lowered but not isub
+    (('fsub', a, b), ('fadd', a, ('fneg', b))),
+
     # These two special-cases save space/an op than the actual csel op +
     # scheduler flexibility