aco: remove excess offset handling for load/store_shared

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37453>
This commit is contained in:
Daniel Schürmann 2025-09-18 12:25:38 +02:00 committed by Marge Bot
parent dbb20a4e23
commit d041640b88

View file

@ -15,6 +15,7 @@
#include "ac_nir.h"
#include "amdgfxregs.h"
#include <numeric>
#include <stdint.h>
namespace aco {
namespace {
@ -2932,12 +2933,7 @@ visit_load_shared(isel_context* ctx, nir_intrinsic_instr* instr)
}
unsigned const_offset = nir_intrinsic_base(instr);
unsigned const_offset_range = 65536;
if (const_offset >= const_offset_range) {
unsigned excess = const_offset - (const_offset % const_offset_range);
address = bld.vadd32(bld.def(v1), address, Operand::c32(excess));
const_offset -= excess;
}
assert(const_offset <= UINT16_MAX);
Definition def = dst.regClass().type() == RegType::sgpr
? bld.def(RegClass::get(RegType::vgpr, bytes))
@ -2992,12 +2988,7 @@ visit_store_shared(isel_context* ctx, nir_intrinsic_instr* instr)
}
unsigned const_offset = nir_intrinsic_base(instr);
unsigned const_offset_range = 65536;
if (const_offset >= const_offset_range) {
unsigned excess = const_offset - (const_offset % const_offset_range);
address = bld.vadd32(bld.def(v1), address, Operand::c32(excess));
const_offset -= excess;
}
assert(const_offset <= UINT16_MAX);
Instruction* ds = bld.ds(op, address, data, m, const_offset);
ds->ds().sync = memory_sync_info(storage_shared);