projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
44d32e6
)
nir/lower_locals_to_regs: cast array index to 32 bit
author
Karol Herbst
<kherbst@redhat.com>
Fri, 15 Mar 2019 15:06:22 +0000
(16:06 +0100)
committer
Karol Herbst
<karolherbst@gmail.com>
Tue, 19 Mar 2019 04:08:07 +0000
(
04:08
+0000)
local memory is too small to require 64 bit pointers, so cast the array index
to a 32 bit value to save up on 64 bit operations.
Signed-off-by: Karol Herbst <kherbst@redhat.com>
src/compiler/nir/nir_lower_locals_to_regs.c
patch
|
blob
|
history
diff --git
a/src/compiler/nir/nir_lower_locals_to_regs.c
b/src/compiler/nir/nir_lower_locals_to_regs.c
index 88599f4978913d15e66dbf469622fdbf6e96b608..0316c8aead8fb6231f5c9543c496d1a3216344b0 100644
(file)
--- a/
src/compiler/nir/nir_lower_locals_to_regs.c
+++ b/
src/compiler/nir/nir_lower_locals_to_regs.c
@@
-165,10
+165,10
@@
get_deref_reg_src(nir_deref_instr *deref, struct locals_to_regs_state *state)
}
assert(src.reg.indirect->is_ssa);
+ nir_ssa_def *index = nir_i2i(b, nir_ssa_for_src(b, d->arr.index, 1), 32);
src.reg.indirect->ssa =
nir_iadd(b, src.reg.indirect->ssa,
- nir_imul(b, nir_ssa_for_src(b, d->arr.index, 1),
- nir_imm_int(b, inner_array_size)));
+ nir_imul(b, index, nir_imm_int(b, inner_array_size)));
}
inner_array_size *= glsl_get_length(nir_deref_instr_parent(d)->type);