nir: Use nir_test_mask instead of i2b(iand)
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17242>
This commit is contained in:
parent
e83bd87ee9
commit
4676b3d3dd
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue