From 91d7e40176328d0a256d9b9cf0ff749604035c51 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 11 Jun 2020 15:38:07 +0100 Subject: [PATCH] aco: don't create byte-aligned short loads MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The ISA docs don't seem to say if this is allowed, so just assume short loads require short alignment. In practice, the only situation this should affect are byte-aligned u8vec2 loads. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index b36c41d8474..0af920b5629 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -3111,7 +3111,9 @@ void emit_load(isel_context *ctx, Builder& bld, const LoadEmitInfo *info) int byte_align = align_mul % 4 == 0 ? align_offset % 4 : -1; if (byte_align) { - if ((bytes_needed > 2 || !supports_8bit_16bit_loads) && byte_align_loads) { + if ((bytes_needed > 2 || + (bytes_needed == 2 && (align_mul % 2 || align_offset % 2)) || + !supports_8bit_16bit_loads) && byte_align_loads) { if (info->component_stride) { assert(supports_8bit_16bit_loads && "unimplemented"); bytes_needed = 2; -- 2.30.2