diff --git a/src/compiler/nir/nir_lower_subgroups.c b/src/compiler/nir/nir_lower_subgroups.c index a83a1710704..f29545ae4d8 100644 --- a/src/compiler/nir/nir_lower_subgroups.c +++ b/src/compiler/nir/nir_lower_subgroups.c @@ -742,7 +742,7 @@ lower_subgroups_instr(nir_builder *b, nir_instr *instr, void *_options) nir_udiv_imm(b, idx, int_val->bit_size)); } - return nir_i2b(b, nir_iand_imm(b, nir_ushr(b, int_val, idx), 1)); + return nir_test_mask(b, nir_ushr(b, int_val, idx), 1); } case nir_intrinsic_ballot_bit_count_reduce: return vec_bit_count(b, int_val); diff --git a/src/compiler/nir/nir_lower_texcoord_replace.c b/src/compiler/nir/nir_lower_texcoord_replace.c index fd3a0859a46..f9de2c890a3 100644 --- a/src/compiler/nir/nir_lower_texcoord_replace.c +++ b/src/compiler/nir/nir_lower_texcoord_replace.c @@ -123,8 +123,7 @@ nir_lower_texcoord_replace_impl(nir_function_impl *impl, nir_ishl(&b, nir_imm_int(&b, 1), nir_iadd_imm(&b, index, base)); - nir_ssa_def *cond = - nir_i2b(&b, nir_iand_imm(&b, mask, coord_replace)); + nir_ssa_def *cond = nir_test_mask(&b, mask, coord_replace); nir_ssa_def *result = nir_bcsel(&b, cond, new_coord, &intrin->dest.ssa); diff --git a/src/compiler/nir/nir_lower_ubo_vec4.c b/src/compiler/nir/nir_lower_ubo_vec4.c index 90885b133b4..17937ace895 100644 --- a/src/compiler/nir/nir_lower_ubo_vec4.c +++ b/src/compiler/nir/nir_lower_ubo_vec4.c @@ -142,10 +142,9 @@ nir_lower_ubo_vec4_lower(nir_builder *b, nir_instr *instr, void *data) BITSET_MASK(intr->num_components) << (align_chan_offset); nir_component_mask_t high_channels = low_channels << (8 / chan_size_bytes); - result = nir_bcsel(b, - nir_i2b(b, nir_iand_imm(b, byte_offset, 8)), - nir_channels(b, result, high_channels), - nir_channels(b, result, low_channels)); + result = nir_bcsel(b, nir_test_mask(b, byte_offset, 8), + nir_channels(b, result, high_channels), + nir_channels(b, result, low_channels)); } else { /* General fallback case: Per-result-channel bcsel-based extraction * from two separate vec4 loads.