freedreno/ir3: add rule to generate imad24
authorRob Clark <robdclark@chromium.org>
Fri, 27 Sep 2019 18:36:43 +0000 (11:36 -0700)
committerRob Clark <robdclark@chromium.org>
Fri, 18 Oct 2019 22:08:54 +0000 (15:08 -0700)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
src/freedreno/ir3/ir3_nir_imul.py

index f648cd11071b30fcc4626a03e11bb97847ed7383..45dee61ca1d58fda6180dfc33a4dd17ae2be5254 100644 (file)
@@ -27,6 +27,11 @@ import sys
 
 imul_lowering = [
        (('imul', 'a@32', 'b@32'), ('imadsh_mix16', 'b', 'a', ('imadsh_mix16', 'a', 'b', ('umul_low', 'a', 'b')))),
+        # We want to run the imad24 rule late so that it doesn't fight
+        # with constant folding the (imul24, a, b).  Since this pass is
+        # run late, and this is kinda imul related, this seems like a
+        # good place for it:
+        (('iadd', ('imul24', 'a', 'b'), 'c'), ('imad24_ir3', 'a', 'b', 'c')),
 ]