Mesa (master): nir: don't emit ishl in _nir_mul_imm() if backend doesn't support bitops
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jan 23 21:35:29 UTC 2020
Module: Mesa
Branch: master
Commit: 3c754900b5f689b821cbb1162b821ce12bcaf23e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=3c754900b5f689b821cbb1162b821ce12bcaf23e
Author: Vasily Khoruzhick <anarsoul at gmail.com>
Date: Wed Jan 22 20:29:50 2020 -0800
nir: don't emit ishl in _nir_mul_imm() if backend doesn't support bitops
Otherwise we'll have to lower it later.
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Erico Nunes <nunes.erico at gmail.com>
Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3529>
---
src/compiler/nir/nir_builder.h | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/compiler/nir/nir_builder.h b/src/compiler/nir/nir_builder.h
index 8b5923211db..fb90fc2cdca 100644
--- a/src/compiler/nir/nir_builder.h
+++ b/src/compiler/nir/nir_builder.h
@@ -656,7 +656,8 @@ _nir_mul_imm(nir_builder *build, nir_ssa_def *x, uint64_t y, bool amul)
return nir_imm_intN_t(build, 0, x->bit_size);
} else if (y == 1) {
return x;
- } else if (util_is_power_of_two_or_zero64(y)) {
+ } else if (!build->shader->options->lower_bitops &&
+ util_is_power_of_two_or_zero64(y)) {
return nir_ishl(build, x, nir_imm_int(build, ffsll(y) - 1));
} else if (amul) {
return nir_amul(build, x, nir_imm_intN_t(build, y, x->bit_size));
More information about the mesa-commit
mailing list