diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-10-26 14:06:17 -0400 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-11-01 01:01:47 +0000 |
commit | 70072a20e0086ad2d3714216a2b8fb4a97776385 (patch) | |
tree | a57dc18b5ebdcb9a852832d9f621b296790ccaaf /src/panfrost/midgard/midgard_print.c | |
parent | e7fd14ca8ac29406e2873c0f33837a8b7283b55e (diff) |
pan/midgard: Refactor swizzles
Rather than having hw-specific swizzles encoded directly in the
instructions, have a unified swizzle arary so we can manipulate swizzles
generically.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/panfrost/midgard/midgard_print.c')
-rw-r--r-- | src/panfrost/midgard/midgard_print.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/panfrost/midgard/midgard_print.c b/src/panfrost/midgard/midgard_print.c index 8eedcda5315..44fd888d584 100644 --- a/src/panfrost/midgard/midgard_print.c +++ b/src/panfrost/midgard/midgard_print.c @@ -66,6 +66,15 @@ mir_print_mask(unsigned mask) } } +static void +mir_print_swizzle(unsigned *swizzle) +{ + printf("."); + + for (unsigned i = 0; i < 16; ++i) + putchar(components[swizzle[i]]); +} + static const char * mir_get_unit(unsigned unit) { @@ -143,15 +152,19 @@ mir_print_instruction(midgard_instruction *ins) printf(", "); mir_print_index(ins->src[0]); + mir_print_swizzle(ins->swizzle[0]); printf(", "); if (ins->has_inline_constant) printf("#%d", ins->inline_constant); - else + else { mir_print_index(ins->src[1]); + mir_print_swizzle(ins->swizzle[1]); + } printf(", "); mir_print_index(ins->src[2]); + mir_print_swizzle(ins->swizzle[2]); if (ins->has_constants) { uint32_t *uc = ins->constants; |