nir/lower_amul: do not lower 64bit amul to imul24

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13300>
This commit is contained in:
Danylo Piliaiev 2021-01-26 12:11:44 +02:00 committed by Marge Bot
parent b83c9b21a6
commit 1eee1fda11
1 changed files with 8 additions and 1 deletions

View File

@ -300,6 +300,9 @@ nir_lower_amul(nir_shader *shader,
/* At this point, all 'amul's used in calculating an offset into
* a large variable have been replaced with 'imul'. So remaining
* 'amul's can be replaced with 'imul24':
*
* Note the exception for 64b (such as load/store_global where
* address size is 64b) as imul24 cannot have 64b bitsize
*/
nir_foreach_function(function, shader) {
nir_function_impl *impl = function->impl;
@ -316,7 +319,11 @@ nir_lower_amul(nir_shader *shader,
if (alu->op != nir_op_amul)
continue;
alu->op = nir_op_imul24;
if (nir_dest_bit_size(alu->dest.dest) <= 32)
alu->op = nir_op_imul24;
else
alu->op = nir_op_imul;
state.progress |= true;
}
}