pan/mdg: Handle 32-bit offsets from store_shared

Implicitly zero-extended for the 64-bit address.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6321>
This commit is contained in:
Alyssa Rosenzweig 2020-08-13 18:56:40 -04:00 committed by Marge Bot
parent 06c31031e7
commit af97331aba
1 changed files with 7 additions and 1 deletions

View File

@ -198,10 +198,16 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
ins->swizzle[2][i] = 0;
}
bool force_zext = (nir_src_bit_size(*offset) < 64);
if (!offset->is_ssa) {
ins->load_store.arg_1 |= is_shared ? 0x6E : 0x7E;
ins->src[2] = nir_src_index(ctx, offset);
ins->src_types[2] = nir_type_uint | nir_src_bit_size(*offset);
if (force_zext)
ins->load_store.arg_1 |= 0x80;
return;
}
@ -221,7 +227,7 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
} else
ins->load_store.arg_2 = 0x1E;
if (match.zext)
if (match.zext || force_zext)
ins->load_store.arg_1 |= 0x80;
assert(match.shift <= 7);