mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 05:08:08 +02:00
nir/builder: use amul over ishl on agx
ishl can wrap, amul cannot. so we need amul in the backend, or otherwise we would need to introduce an ashl opcode instead. that doesn't seem better. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31964>
This commit is contained in:
parent
9ab8d70fa6
commit
1f3c97547a
1 changed files with 2 additions and 0 deletions
|
|
@ -974,6 +974,8 @@ _nir_mul_imm(nir_builder *build, nir_def *x, uint64_t y, bool amul)
|
|||
return x;
|
||||
} else if ((!build->shader->options ||
|
||||
!build->shader->options->lower_bitops) &&
|
||||
!(amul && (!build->shader->options ||
|
||||
build->shader->options->has_amul)) &&
|
||||
util_is_power_of_two_or_zero64(y)) {
|
||||
return nir_ishl(build, x, nir_imm_int(build, ffsll(y) - 1));
|
||||
} else if (amul) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue