1. 06 May, 2021 1 commit
    • Alyssa Rosenzweig's avatar
      nir/opt_algebraic: Add fmul(a, 2.0) -> fadd(a, a) · 8f91e489
      Alyssa Rosenzweig authored
      
      
      Investigated for Bifrost, but should be the same or cheaper for any
      reasonable architecture. For the compilers I maintain:
      
      * Bifrost - fadd can be scheduled 2x as frequently as ffma, there is no
        fmul separate from ffma.
      * Midgard - fadd x, x is used as a canonical form, again for easier
        scheduling.
      * AGX - fmul and fadd are both native ops, but fmul is heavier weight
        (unknown whether this is a performance issue or just power
         consumption). Also saves a move / uniform file slot for the constant.
      
      Since floating point multiplication is inherently more expensive than
      addition, presumably this is a win for everyone else too.
      
      Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
      8f91e489
  2. 05 May, 2021 39 commits