agx/lower_address: Handle 16-bit offsets

These need to be upconverted for correctness.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21643>
This commit is contained in:
Alyssa Rosenzweig
2023-03-03 16:19:17 -05:00
committed by Marge Bot
parent 9f5a4a9604
commit 2a174f0019
@@ -224,6 +224,18 @@ pass(struct nir_builder *b, nir_instr *instr, UNUSED void *data)
match.shift = 0;
}
/* Hardware offsets must be 32-bits. Upconvert if the source code used
* smaller integers.
*/
if (offset->bit_size != 32) {
assert(offset->bit_size < 32);
if (match.sign_extend)
offset = nir_i2i32(b, offset);
else
offset = nir_u2u32(b, offset);
}
assert(match.shift >= 0);
nir_ssa_def *new_base = nir_channel(b, match.base.def, match.base.comp);