Skip to content

nir: ffma is partially commutative

This doesn't make any real difference now, but future work (not in this series) will add a LOT of ffma patterns. Having to duplicate all of them for ffma(a, b, c) and ffma(b, a, c) is just terrible.

I was a little surprised that adding CSE support for ffma being commutative didn't have any changes. I suspect that is because the Intel driver merges multiplies and adds after CSE has run quite a few times already. There are not very many explicit calls to GLSL's fma() in shader-db.

@jekstrand
@cwabbott0

Merge request reports