pan/bi: Implement nir_op_ffma
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 11 Mar 2020 19:15:41 +0000 (15:15 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 11 Mar 2020 20:28:21 +0000 (20:28 +0000)
We have native FMA which works for graphics usage (unlike Midgard where
it's really reserved for compute for various reasons), let's use it.

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

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

index 8e02437df5223d46183d5477bdeec61aedb1489e..8124970b6e895423957ea6cb283b342cfa0070f6 100644 (file)
@@ -322,6 +322,7 @@ bi_class_for_nir_alu(nir_op op)
         case nir_op_u2f64:
                 return BI_CONVERT;
 
+        case nir_op_ffma:
         case nir_op_fmul:
                 return BI_FMA;
 
index ff0e7c38428958403182ddcbe9f6ac6a5621b1c9..ddfde64d4722b152459c1f6db04e9215ef177a6b 100644 (file)
@@ -31,7 +31,6 @@
 void bifrost_compile_shader_nir(nir_shader *nir, panfrost_program *program, unsigned product_id);
 
 static const nir_shader_compiler_options bifrost_nir_options = {
-        .lower_ffma = true,
         .lower_scmp = true,
         .lower_flrp32 = true,
         .lower_flrp64 = true,
@@ -68,6 +67,7 @@ static const nir_shader_compiler_options bifrost_nir_options = {
 
         .lower_bitfield_extract_to_shifts = true,
         .vectorize_io = true,
+        .fuse_ffma = true,
         .use_interpolated_input_intrinsics = true
 };