From 8defd1bc16de53e32bd4ea349c16d0f48612ca80 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Mon, 2 Jun 2025 14:47:25 +0100 Subject: [PATCH] aco/gfx6: disallow global access with sgpr address and two offsets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No fossil-db changes (navi10, pitcairn). Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- .../instruction_selection/aco_select_nir_intrinsics.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/instruction_selection/aco_select_nir_intrinsics.cpp b/src/amd/compiler/instruction_selection/aco_select_nir_intrinsics.cpp index 660b16c34e2..aa1438cff57 100644 --- a/src/amd/compiler/instruction_selection/aco_select_nir_intrinsics.cpp +++ b/src/amd/compiler/instruction_selection/aco_select_nir_intrinsics.cpp @@ -846,7 +846,9 @@ lower_global_address(Builder& bld, uint32_t offset_in, Temp* address_inout, if (bld.program->gfx_level == GFX6) { /* GFX6 (MUBUF): (SGPR address, SGPR offset) or (VGPR address, SGPR offset) */ - if (offset.type() != RegType::sgpr) { + /* Disallow SGPR address with both a const_offset and offset because of possible overflow. */ + if (offset.id() && (offset.type() != RegType::sgpr || + (address.type() == RegType::sgpr && const_offset > 0))) { address = add64_32(bld, address, offset); offset = Temp(); }