mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
gallivm: fix non-32 bit popcounts.
Fixes OpenCL CTS integer_ops popcount Reviewed-by: Roland Scheidegger <sroland@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12285>
This commit is contained in:
parent
9922ea7e66
commit
ff99270923
1 changed files with 4 additions and 0 deletions
|
|
@ -591,6 +591,10 @@ static LLVMValueRef do_alu_action(struct lp_build_nir_context *bld_base,
|
|||
break;
|
||||
case nir_op_bit_count:
|
||||
result = lp_build_popcount(get_int_bld(bld_base, false, src_bit_size[0]), src[0]);
|
||||
if (src_bit_size[0] < 32)
|
||||
result = LLVMBuildZExt(builder, result, bld_base->int_bld.vec_type, "");
|
||||
else if (src_bit_size[0] > 32)
|
||||
result = LLVMBuildTrunc(builder, result, bld_base->int_bld.vec_type, "");
|
||||
break;
|
||||
case nir_op_bitfield_select:
|
||||
result = lp_build_xor(&bld_base->uint_bld, src[2], lp_build_and(&bld_base->uint_bld, src[0], lp_build_xor(&bld_base->uint_bld, src[1], src[2])));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue