diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-14 13:30:05 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-21 17:49:14 +0000 |
commit | f768cb04ed114d7ac65d8bfbaf130002c81448d6 (patch) | |
tree | ed330096df241795cddc6e2e4b29661fca78827b /src/panfrost | |
parent | 28201af08038343e428036d5b4676d5eb74b0199 (diff) |
pan/mdg: Implement vector constant printing for 8-bit
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
Diffstat (limited to 'src/panfrost')
-rw-r--r-- | src/panfrost/midgard/disassemble.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index ce70cbc561d..e97cee163a2 100644 --- a/src/panfrost/midgard/disassemble.c +++ b/src/panfrost/midgard/disassemble.c @@ -357,10 +357,11 @@ print_vector_constants(FILE *fp, unsigned src_binary, { midgard_vector_alu_src *src = (midgard_vector_alu_src *)&src_binary; unsigned bits = bits_for_mode_halved(alu->reg_mode, src->half); - unsigned max_comp = MIN2((sizeof(*consts) * 8) / bits, 8); + unsigned max_comp = (sizeof(*consts) * 8) / bits; unsigned comp_mask, num_comp = 0; assert(consts); + assert(max_comp <= 16); comp_mask = effective_writemask(alu, condense_writemask(alu->mask, bits)); num_comp = util_bitcount(comp_mask); @@ -380,6 +381,20 @@ print_vector_constants(FILE *fp, unsigned src_binary, c += (!src->rep_low * 4); } else if (bits == 32 && !src->half) { /* Implicitly ok */ + } else if (bits == 8) { + assert (!src->half); + unsigned index = (i >> 1) & 3; + unsigned base = (src->swizzle >> (index * 2)) & 3; + c = base * 2; + + if (i < 8) + c += (src->rep_high) * 8; + else + c += (!src->rep_low) * 8; + + /* We work on twos, actually */ + if (i & 1) + c++; } else { printf(" (%d%d%d)", src->rep_low, src->rep_high, src->half); } |