Module: Mesa
Branch: main
Commit: 9e2ce225e682eb7880c70733dcdd51054ad7529b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e2ce225e682eb7880c70733dcdd51054ad7529b

Author: Alyssa Rosenzweig <[email protected]>
Date:   Fri Oct 21 15:34:52 2022 -0400

pan/mdg: Fix 64-bit address arithmetic

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19238>

---

 src/panfrost/midgard/midgard_address.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/panfrost/midgard/midgard_address.c 
b/src/panfrost/midgard/midgard_address.c
index beb661ec50c..8b80f042ad0 100644
--- a/src/panfrost/midgard/midgard_address.c
+++ b/src/panfrost/midgard/midgard_address.c
@@ -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;

Reply via email to