summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2020-12-29 11:21:27 +1300
committerMarge Bot <eric+marge@anholt.net>2021-01-18 20:49:45 +0000
commit3f7e7495fc36a2b167a798169d76be02383d24df (patch)
tree94a94f43e59ae102ee3028372ef6791a51d0fb37
parent2e372d0c3b1e40988f39d491c6837c6a0d73e714 (diff)
pan/bi: Lower umul_high
Also lower uadd_carry, which the mul_high lowering generates. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8358>
-rw-r--r--src/panfrost/bifrost/bifrost_compile.c2
-rw-r--r--src/panfrost/bifrost/bifrost_compile.h3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c
index a6a70cc0311..dc9b6f9d706 100644
--- a/src/panfrost/bifrost/bifrost_compile.c
+++ b/src/panfrost/bifrost/bifrost_compile.c
@@ -2162,6 +2162,8 @@ bi_optimize_nir(nir_shader *nir)
NIR_PASS(progress, nir, nir_opt_algebraic);
NIR_PASS(progress, nir, nir_opt_constant_folding);
+ NIR_PASS(progress, nir, nir_lower_alu);
+
if (lower_flrp != 0) {
bool lower_flrp_progress = false;
NIR_PASS(lower_flrp_progress,
diff --git a/src/panfrost/bifrost/bifrost_compile.h b/src/panfrost/bifrost/bifrost_compile.h
index 9c94087dba2..e424a23a91e 100644
--- a/src/panfrost/bifrost/bifrost_compile.h
+++ b/src/panfrost/bifrost/bifrost_compile.h
@@ -69,6 +69,9 @@ static const nir_shader_compiler_options bifrost_nir_options = {
.lower_doubles_options = nir_lower_dmod,
/* TODO: Don't lower supported 64-bit operations */
.lower_int64_options = ~0,
+ /* TODO: Use IMULD on v7 */
+ .lower_mul_high = true,
+ .lower_uadd_carry = true,
.lower_bitfield_extract_to_shifts = true,
.has_fsub = true,