Skip to content
  • Jason Ekstrand's avatar
    nir/opcodes: Add algebraic properties metadata · 46f3e1ab
    Jason Ekstrand authored
    
    
    This commit adds some algebraic properties to the metadata of each opcode
    in NIR.  In particular, you now know, just from the metadata, if a given
    opcode is commutative or associative.  This will be useful for algebraic
    transformation passes that want to be able to match a + b as well as b + a
    in one go.
    
    v2: Make algebraic properties all caps.  This was more consistent with the
        intrinsics flags and seems better for flags in general.
    
        Also, the enums are now declared with (1 << n) rather then hex values.
    
    v3: fmin and fmax technically aren't commutative or associative.  Things
        get funny when one of the arguments is a NaN.
    
    Reviewed-by: default avatarConnor Abbott <cwabbott0@gmail.com>
    46f3e1ab