summaryrefslogtreecommitdiff
path: root/src/panfrost/midgard/midgard_address.c
diff options
context:
space:
mode:
authorIcecream95 <ixn@disroot.org>2021-01-01 01:29:04 +1300
committerMarge Bot <eric+marge@anholt.net>2021-01-01 02:58:49 +0000
commit3665855c2e6c8c7022495ce2ff323faf51e360e3 (patch)
tree8863337157b9f9e585cb5e5eb3b943c751193cae /src/panfrost/midgard/midgard_address.c
parentb504602370293c08e9dda4b262f03b7a3c5b537e (diff)
pan/mdg: Pass the memory type to mir_set_offset directly
We want to add support for more memory types, so replace the is_shared bool with an integer that is directly stored to load_store.arg_1. The new memory type values are off by 0x40, as that bit now comes from the index type. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8264>
Diffstat (limited to 'src/panfrost/midgard/midgard_address.c')
-rw-r--r--src/panfrost/midgard/midgard_address.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/panfrost/midgard/midgard_address.c b/src/panfrost/midgard/midgard_address.c
index 88726b8c626..3dbbd72eaca 100644
--- a/src/panfrost/midgard/midgard_address.c
+++ b/src/panfrost/midgard/midgard_address.c
@@ -220,7 +220,7 @@ mir_match_offset(nir_ssa_def *offset, bool first_free)
}
void
-mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset, bool is_shared)
+mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset, unsigned seg)
{
for(unsigned i = 0; i < 16; ++i) {
ins->swizzle[1][i] = 0;
@@ -232,7 +232,7 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
bool force_sext = (nir_src_bit_size(*offset) < 64);
if (!offset->is_ssa) {
- ins->load_store.arg_1 |= is_shared ? 0x6E : 0x7E;
+ ins->load_store.arg_1 |= seg;
ins->src[2] = nir_src_index(ctx, offset);
ins->src_types[2] = nir_type_uint | nir_src_bit_size(*offset);
@@ -244,14 +244,16 @@ mir_set_offset(compiler_context *ctx, midgard_instruction *ins, nir_src *offset,
return;
}
- struct mir_address match = mir_match_offset(offset->ssa, !is_shared);
+ bool first_free = (seg == LDST_GLOBAL);
+
+ struct mir_address match = mir_match_offset(offset->ssa, first_free);
if (match.A.def) {
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;
} else
- ins->load_store.arg_1 |= is_shared ? 0x6E : 0x7E;
+ ins->load_store.arg_1 |= seg;
if (match.B.def) {
ins->src[2] = nir_ssa_index(match.B.def);