This tiny series moves the pass that Bas wrote for lowering vote
instructions to ballots into common code.  As you can see from the diffstat
below, it cuts the size of the pass in half by removing boilerplate.  The
new version (in nir_lower_subgroups) also contains two bugfixes:

 1) The old pass wasn't actually inserting the RFI instruction

 2) The old pass wouldn't handle NaN correctly in feq because it switched
    to effectively using ineg(fne(a, b)) which is not the same as feq(a, b)
    when NaN is present.

This has not been tested at all beyond compile-testing (and I didn't even
compile-test radv).

Cc: Bas Nieuwenhuizen <>
Cc: Timothy Arceri <>

Jason Ekstrand (2):
  nir/subgroups: Add lowering for vote_ieq/vote_feq to a ballot
  ac/nir: Use lower_vote_eq_to_ballot instead of ac_nir_lower_subgroups

 src/amd/Makefile.sources                     |  1 -
 src/amd/common/ac_lower_subgroups.c          | 92 ----------------------------
 src/amd/common/ac_nir_to_llvm.c              |  3 -
 src/amd/common/ac_nir_to_llvm.h              |  2 -
 src/amd/common/                   |  1 -
 src/compiler/nir/nir.h                       |  1 +
 src/compiler/nir/nir_lower_subgroups.c       | 48 +++++++++++++++
 src/gallium/drivers/radeonsi/si_shader_nir.c |  1 +
 8 files changed, 50 insertions(+), 99 deletions(-)
 delete mode 100644 src/amd/common/ac_lower_subgroups.c


mesa-dev mailing list

Reply via email to