From: Alyssa Rosenzweig Date: Fri, 12 Jun 2020 21:56:32 +0000 (-0400) Subject: pan/mdg: Reassociate adds for multiply-by-two X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89c8393a1632720ed0dec82cb9529c5c487fb86d;p=mesa.git pan/mdg: Reassociate adds for multiply-by-two Only a single shader-db change it looks like, and not even from scheduling, no fun. instructions helped: shader31 MESA_SHADER_FRAGMENT: 64 -> 63 (-1.56%) quadwords helped: shader31 MESA_SHADER_FRAGMENT: 66 -> 65 (-1.52%) registers HURT: shader31 MESA_SHADER_FRAGMENT: 2 -> 3 (50.00%) Signed-off-by: Alyssa Rosenzweig Part-of: --- diff --git a/src/panfrost/midgard/midgard_nir_algebraic.py b/src/panfrost/midgard/midgard_nir_algebraic.py index 108ecf6ed95..ad54757eee7 100644 --- a/src/panfrost/midgard/midgard_nir_algebraic.py +++ b/src/panfrost/midgard/midgard_nir_algebraic.py @@ -31,7 +31,10 @@ b = 'b' c = 'c' algebraic = [ - (('pack_unorm_4x8', a), ('pack_32_4x8', ('f2u8', ('fround_even', ('fmul', ('fsat', a), 255.0))))) + (('pack_unorm_4x8', a), ('pack_32_4x8', ('f2u8', ('fround_even', ('fmul', ('fsat', a), 255.0))))), + + # Allows us to schedule as a multiply by 2 + (('~fadd', ('fadd', a, b), a), ('fadd', ('fadd', a, a), b)), ] algebraic_late = [