Module: Mesa
Branch: master
Commit: dab0af061641bae1a69793ee39cad230725a3203
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=dab0af061641bae1a69793ee39cad230725a3203

Author: Tony Wasserka <[email protected]>
Date:   Sat Aug 29 13:14:23 2020 +0200

aco/isel: Simplify nested branching code

Reviewed-by: Daniel Schürmann <[email protected]>
Reviewed-by: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6504>

---

 src/amd/compiler/aco_instruction_selection.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp 
b/src/amd/compiler/aco_instruction_selection.cpp
index 0a798568abf..3ea30a73f94 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -2978,12 +2978,15 @@ void emit_load(isel_context *ctx, Builder &bld, const 
LoadEmitInfo *info,
       unsigned bytes_needed = load_size - bytes_read;
 
       /* add buffer for unaligned loads */
-      int byte_align = align_mul % 4 == 0 ? align_offset % 4 : -1;
+      int byte_align = 0;
+      if (params.byte_align_loads) {
+         byte_align = align_mul % 4 == 0 ? align_offset % 4 : -1;
+      }
 
       if (byte_align) {
-         if (params.byte_align_loads && (bytes_needed > 2 ||
-              (bytes_needed == 2 && (align_mul % 2 || align_offset % 2)) ||
-              !params.supports_8bit_16bit_loads)) {
+         if (bytes_needed > 2 ||
+             (bytes_needed == 2 && (align_mul % 2 || align_offset % 2)) ||
+             !params.supports_8bit_16bit_loads) {
             if (info->component_stride) {
                assert(params.supports_8bit_16bit_loads && "unimplemented");
                bytes_needed = 2;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to