pan/mdg: Fix 64-bit address arithmetic

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19238>
(cherry picked from commit 9e2ce225e682eb7880c70733dcdd51054ad7529b)
This commit is contained in:
Alyssa Rosenzweig 2022-10-21 15:34:52 -04:00 committed by Dylan Baker
parent 6a2d462191
commit ca852a09af
2 changed files with 6 additions and 2 deletions

View File

@ -2425,7 +2425,7 @@
"description": "pan/mdg: Fix 64-bit address arithmetic",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@ -256,9 +256,13 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
struct mir_address match = mir_match_offset(offset->ssa, first_free, true);
if (match.A.def) {
unsigned bitsize = match.A.def->bit_size;
assert(bitsize == 32 || bitsize == 64);
ins->src[1] = nir_ssa_index(match.A.def);
ins->swizzle[1][0] = match.A.comp;
ins->src_types[1] = nir_type_uint | match.A.def->bit_size;
ins->src_types[1] = nir_type_uint | bitsize;
ins->load_store.bitsize_toggle = (bitsize == 64);
} else {
ins->load_store.bitsize_toggle = true;
ins->load_store.arg_comp = seg & 0x3;