diff --git a/src/compiler/nir/nir_intrinsics.py b/src/compiler/nir/nir_intrinsics.py index 7200491551a..ed38714f4bb 100644 --- a/src/compiler/nir/nir_intrinsics.py +++ b/src/compiler/nir/nir_intrinsics.py @@ -567,11 +567,11 @@ intrinsic("vote_ieq", src_comp=[0], dest_comp=1, flags=SUBGROUP_FLAGS) # on a uvec4 which is treated as a 128bit integer. Also, they are, in # general, free to ignore any bits which are above the subgroup size. intrinsic("ballot_bitfield_extract", src_comp=[4, 1], dest_comp=1, bit_sizes=[1], flags=[CAN_REORDER, CAN_ELIMINATE]) -intrinsic("ballot_bit_count_reduce", src_comp=[4], dest_comp=1, flags=[CAN_REORDER, CAN_ELIMINATE]) -intrinsic("ballot_bit_count_inclusive", src_comp=[4], dest_comp=1, flags=[CAN_REORDER, CAN_ELIMINATE]) -intrinsic("ballot_bit_count_exclusive", src_comp=[4], dest_comp=1, flags=[CAN_REORDER, CAN_ELIMINATE]) -intrinsic("ballot_find_lsb", src_comp=[4], dest_comp=1, flags=[CAN_REORDER, CAN_ELIMINATE]) -intrinsic("ballot_find_msb", src_comp=[4], dest_comp=1, flags=[CAN_REORDER, CAN_ELIMINATE]) +intrinsic("ballot_bit_count_reduce", src_comp=[4], dest_comp=1, bit_sizes=[32], flags=[CAN_REORDER, CAN_ELIMINATE]) +intrinsic("ballot_bit_count_inclusive", src_comp=[4], dest_comp=1, bit_sizes=[32], flags=[CAN_REORDER, CAN_ELIMINATE]) +intrinsic("ballot_bit_count_exclusive", src_comp=[4], dest_comp=1, bit_sizes=[32], flags=[CAN_REORDER, CAN_ELIMINATE]) +intrinsic("ballot_find_lsb", src_comp=[4], dest_comp=1, bit_sizes=[32], flags=[CAN_REORDER, CAN_ELIMINATE]) +intrinsic("ballot_find_msb", src_comp=[4], dest_comp=1, bit_sizes=[32], flags=[CAN_REORDER, CAN_ELIMINATE]) # Shuffle operations from SPIR-V. intrinsic("shuffle", src_comp=[0, 1], dest_comp=0, bit_sizes=src0, flags=SUBGROUP_FLAGS) diff --git a/src/compiler/nir/nir_lower_subgroups.c b/src/compiler/nir/nir_lower_subgroups.c index 7002a430efb..540ee7329e1 100644 --- a/src/compiler/nir/nir_lower_subgroups.c +++ b/src/compiler/nir/nir_lower_subgroups.c @@ -764,7 +764,7 @@ build_scan_reduce(nir_builder *b, nir_intrinsic_op op, nir_op red_op, * take into account in the accumulator. */ nir_def *has_buddy = nir_bany_inequal(b, remaining, nir_imm_int(b, 0)); - nir_def *buddy = nir_ballot_find_msb(b, 32, remaining); + nir_def *buddy = nir_ballot_find_msb(b, remaining); /* Accumulate with our buddy channel, if any */ nir_def *buddy_data = nir_shuffle(b, data, buddy); @@ -789,7 +789,7 @@ build_scan_reduce(nir_builder *b, nir_intrinsic_op op, nir_op red_op, */ nir_def *lower = nir_iand(b, mask, lt_mask); nir_def *has_buddy = nir_bany_inequal(b, lower, nir_imm_int(b, 0)); - nir_def *buddy = nir_ballot_find_msb(b, 32, lower); + nir_def *buddy = nir_ballot_find_msb(b, lower); nir_def *buddy_data = nir_shuffle(b, data, buddy); nir_def *identity = build_identity(b, data->bit_size, red_op); @@ -801,7 +801,7 @@ build_scan_reduce(nir_builder *b, nir_intrinsic_op op, nir_op red_op, case nir_intrinsic_reduce: { /* For reductions, we need to take the top value of the scan */ - nir_def *idx = nir_ballot_find_msb(b, 32, mask); + nir_def *idx = nir_ballot_find_msb(b, mask); return nir_shuffle(b, data, idx); } @@ -995,7 +995,7 @@ static nir_def * lower_first_invocation_to_ballot(nir_builder *b, nir_intrinsic_instr *intrin, const nir_lower_subgroups_options *options) { - return nir_ballot_find_lsb(b, 32, nir_ballot(b, 4, 32, nir_imm_true(b))); + return nir_ballot_find_lsb(b, nir_ballot(b, 4, 32, nir_imm_true(b))); } static nir_def * diff --git a/src/compiler/nir/nir_opt_uniform_subgroup.c b/src/compiler/nir/nir_opt_uniform_subgroup.c index 429dfb8295a..721c9be3dd2 100644 --- a/src/compiler/nir/nir_opt_uniform_subgroup.c +++ b/src/compiler/nir/nir_opt_uniform_subgroup.c @@ -74,7 +74,7 @@ ballot_bit_count(nir_builder *b, nir_def *ballot) { return ballot->num_components == 1 ? nir_bit_count(b, ballot) - : nir_ballot_bit_count_reduce(b, ballot->bit_size, ballot); + : nir_ballot_bit_count_reduce(b, ballot); } static nir_def *