aco: fix shared subdword loads
authorDaniel Schürmann <daniel@schuermann.dev>
Fri, 12 Jun 2020 10:59:27 +0000 (11:59 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Jun 2020 13:56:12 +0000 (13:56 +0000)
Shared subdword loads don't need byte alignment as they are split
into multiple loads if necessary.

Fixes: 5cde4989d3c8c25b0ba2a11ec450625e30092b16 ('aco: remove unnecessary split- and create_vector instructions for subdword loads')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5441>

src/amd/compiler/aco_instruction_selection.cpp

index ffe5f2e4619730cac5fa231fc40d40624b906c6a..38bf449c83b2a78cfb346cac88b5e3f320941dda 100644 (file)
@@ -3192,7 +3192,7 @@ void emit_load(isel_context *ctx, Builder& bld, const LoadEmitInfo *info)
       }
 
       /* shift result right if needed */
-      if (info->component_size < 4) {
+      if (info->component_size < 4 && byte_align_loads) {
          Operand align((uint32_t)byte_align);
          if (byte_align == -1) {
             if (offset.isConstant())