pan/mdg: Fix disassembly of store instructions
authorIcecream95 <ixn@disroot.org>
Fri, 10 Dec 2021 10:46:37 +0000 (23:46 +1300)
committerMarge Bot <emma+marge@anholt.net>
Tue, 10 May 2022 13:16:50 +0000 (13:16 +0000)
The mask does apply for store instructions, so pass it onto
print_vec_swizzle after converting it to the right format.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16382>

src/panfrost/midgard/disassemble.c

index 1d8ee51..98cdf66 100644 (file)
@@ -1420,9 +1420,15 @@ print_load_store_instr(disassemble_context *ctx, FILE *fp, uint64_t data, bool v
                         swizzle = 0xE4;
                 print_ldst_mask(fp, word->mask, swizzle);
         } else {
+                uint8_t mask =
+                        (word->mask & 0x1) |
+                        ((word->mask & 0x2) << 1) |
+                        ((word->mask & 0x4) << 2) |
+                        ((word->mask & 0x8) << 3);
+                mask |= mask << 1;
                 print_ldst_read_reg(fp, word->reg);
                 print_vec_swizzle(fp, word->swizzle, midgard_src_passthrough,
-                                  midgard_reg_mode_32, 0xFF);
+                                  midgard_reg_mode_32, mask);
         }
 
         /* ld_ubo args */