summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRhys Perry <pendingchaos02@gmail.com>2022-05-30 12:45:10 +0100
committerMarge Bot <emma+marge@anholt.net>2022-06-06 17:47:59 +0000
commit4d9f3fcf9cab04c787211b15e645bd28e34a0227 (patch)
tree95135989e55d9eaf1415585af3869cd5651eff84
parent695f66cecd431eb3b8e38f7d3436ff9e44028384 (diff)
aco: fix SMEM load_global_amd with non-zero offset
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com> Reviewed-by: Timur Kristóf <timur.kristof@gmail.com> Fixes: 3e9517c7577 ("aco: implement _amd global access intrinsics") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16775>
-rw-r--r--src/amd/compiler/aco_instruction_selection.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index a81b24bd5ba..7bca54754a8 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -4344,6 +4344,8 @@ smem_load_callback(Builder& bld, const LoadEmitInfo& info, Temp offset, unsigned
if (offset.id() && const_offset)
load->operands[1] = bld.sop2(aco_opcode::s_add_u32, bld.def(s1), bld.def(s1, scc), offset,
Operand::c32(const_offset));
+ else if (offset.id())
+ load->operands[1] = Operand(offset);
else
load->operands[1] = Operand::c32(const_offset);
}