summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-09-26 10:32:00 -0700
committerRob Clark <[email protected]>2019-10-18 15:08:54 -0700
commit6320e37d4be16407cd237c2049a46360405599d5 (patch)
tree7ab211ba6ac99da320f6586f19ed068adb11637f /src/compiler/glsl
parent0568761f8e7b9249ec8cffbd7826c24e38bf16d6 (diff)
nir: add amul instruction
Used for address/offset calculation (ie. array derefs), where we can potentially use less than 32b for the multiply of array idx by element size. For backends that support `imul24`, this gives a lowering pass an easy way to find multiplies that potentially can be converted to `imul24`. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eduardo Lima Mitev <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r--src/compiler/glsl/gl_nir_lower_buffers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/gl_nir_lower_buffers.c b/src/compiler/glsl/gl_nir_lower_buffers.c
index c7b58583d58..59bb582069a 100644
--- a/src/compiler/glsl/gl_nir_lower_buffers.c
+++ b/src/compiler/glsl/gl_nir_lower_buffers.c
@@ -59,7 +59,7 @@ get_block_array_index(nir_builder *b, nir_deref_instr *deref,
} else {
nir_ssa_def *arr_index = nir_ssa_for_src(b, deref->arr.index, 1);
arr_index = nir_umin(b, arr_index, nir_imm_int(b, arr_size - 1));
- nir_ssa_def *arr_offset = nir_imul_imm(b, arr_index, array_elements);
+ nir_ssa_def *arr_offset = nir_amul_imm(b, arr_index, array_elements);
if (nonconst_index)
nonconst_index = nir_iadd(b, nonconst_index, arr_offset);
else