diff options
author | Alyssa Rosenzweig <[email protected]> | 2020-05-11 15:33:43 -0400 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-05-21 17:49:14 +0000 |
commit | b833702cc1b53cb6e0f0e486a56aa62d9650e79b (patch) | |
tree | 033ec548accc30668f793d1c88e9b95d63e72264 | |
parent | cd26bd9425e80dc3236942913f6bf6d670943003 (diff) |
pan/mdg: Print constant vectors less wrong
For !32-bit types, we need to pay attention to rep_low/high/half to
determine the effective swizzle.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5151>
-rw-r--r-- | src/panfrost/midgard/disassemble.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index 30939b21d9c..ce70cbc561d 100644 --- a/src/panfrost/midgard/disassemble.c +++ b/src/panfrost/midgard/disassemble.c @@ -365,10 +365,7 @@ print_vector_constants(FILE *fp, unsigned src_binary, comp_mask = effective_writemask(alu, condense_writemask(alu->mask, bits)); num_comp = util_bitcount(comp_mask); - fprintf(fp, "#"); - if (num_comp > 1) - fprintf(fp, "vec%d(", num_comp); - + fprintf(fp, "<"); bool first = true; for (unsigned i = 0; i < max_comp; ++i) { @@ -376,6 +373,17 @@ print_vector_constants(FILE *fp, unsigned src_binary, unsigned c = (src->swizzle >> (i * 2)) & 3; + if (bits == 16 && !src->half) { + if (i < 4) + c += (src->rep_high * 4); + else + c += (!src->rep_low * 4); + } else if (bits == 32 && !src->half) { + /* Implicitly ok */ + } else { + printf(" (%d%d%d)", src->rep_low, src->rep_high, src->half); + } + if (first) first = false; else @@ -386,7 +394,7 @@ print_vector_constants(FILE *fp, unsigned src_binary, } if (num_comp > 1) - fprintf(fp, ")"); + fprintf(fp, ">"); } static void |