nir/subgroups: Add lowering for vote_ieq/vote_feq to a ballot

This is based heavily on 97f10934ed, "ac/nir: Add vote_ieq/vote_feq
lowering pass." from Bas Nieuwenhuizen.  This version is a bit more
general since it's in common code.  It also properly handles NaN due to
not flipping the comparison for floats.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Jason Ekstrand
2018-03-10 10:05:58 -08:00
parent 8247a30838
commit 3d1d7e8561
2 changed files with 49 additions and 0 deletions

View File

@@ -2557,6 +2557,7 @@ typedef struct nir_lower_subgroups_options {
uint8_t ballot_bit_size;
bool lower_to_scalar:1;
bool lower_vote_trivial:1;
bool lower_vote_eq_to_ballot:1;
bool lower_subgroup_masks:1;
bool lower_shuffle:1;
bool lower_quad:1;