Skip to content

Revert "i965/fs: Merge CMP and SEL into CSEL on Gen8+"

Faith Ekstrand requested to merge gfxstrand/mesa:review/revert-csel into master

This reverts commit 52c7df16. The pass, while clearly useful for some shaders, has at least three bugs that I was able to find fairly quickly:

  1. It doesn't work for type-converting MOVs because f > 0 is not the same as f2i(f) > 0

  2. CSEL is a 3src instruction and only supports one source type; it doesn't take this into account and tries to create instructions which do a F compare and a D select. This is especially nasty to debug because you don't see that in the dumped assembly because we don't properly assert that types are the same in codegen.

  3. While you can handle 2, in theory, by reinterpreting types, you can't do that in the presence of source modifiers. This pass doesn't even attempt to detect that.

Those are just the ones I found with the one almost trival shader I was debugging. There very likely may be more and. Best thing to do for now is just shut it off until someone has the time to figure out how to do this properly and write tests to ensure it's correct.

Merge request reports