Skip to content

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

Faith Ekstrand requested to merge gfxstrand/mesa:wip/fs-csel into main

This MR re-instates 52c7df16 which was reverted in 2fca325e. I'm leaving this MR WIP because there are a number of things that need to be fixed before we can re-instate the pass:

  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.

Hopefully having an MR outstanding will help us remember to fix it one day.

Merge request reports