radeonsi: use nir_umul_high for fast udiv

nir has dedicated alu op for it. Also for removing int64
multiply which aco does not support.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23096>
This commit is contained in:
Qiang Yu 2023-05-11 19:41:20 +08:00
parent 95ff215be2
commit 90b56e99f4

View file

@ -32,8 +32,7 @@ fast_udiv_nuw(nir_builder *b, nir_ssa_def *num, nir_ssa_def *divisor)
num = nir_ushr(b, num, pre_shift);
num = nir_iadd_nuw(b, num, increment);
num = nir_imul(b, nir_u2u64(b, num), nir_u2u64(b, multiplier));
num = nir_unpack_64_2x32_split_y(b, num);
num = nir_umul_high(b, num, multiplier);
return nir_ushr(b, num, post_shift);
}