diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-04-30 04:52:36 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-05-04 19:08:50 +0000 |
commit | 055f6def3036d17e9290bbad9b12dc7f0a9b7321 (patch) | |
tree | 6da048e7d502111e1d23aa74f45a60e727cf9da2 /src/gallium | |
parent | 576a27fd552c82008d247991ad7c038e3fa28be1 (diff) |
panfrost/midgard/disasm: Catch mask errors
We silently ignored certain bits of the mask, which causes issues when
disassembly 8/64-bit ops.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/midgard/disassemble.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/midgard/disassemble.c b/src/gallium/drivers/panfrost/midgard/disassemble.c index ba1ab2bca5b..7b71a9937ff 100644 --- a/src/gallium/drivers/panfrost/midgard/disassemble.c +++ b/src/gallium/drivers/panfrost/midgard/disassemble.c @@ -260,10 +260,21 @@ print_vector_field(const char *name, uint16_t *words, uint16_t reg_word, mask = alu_field->mask >> 4; } } else { + /* For full 32-bit, every other bit is duplicated, so we only + * pick every other to find the effective mask */ + mask = alu_field->mask & 1; mask |= (alu_field->mask & 4) >> 1; mask |= (alu_field->mask & 16) >> 2; mask |= (alu_field->mask & 64) >> 3; + + /* ... but verify! */ + + unsigned checked = alu_field->mask & 0x55; + unsigned opposite = alu_field->mask & 0xAA; + + if ((checked << 1) != opposite) + printf("/* %X */ ", alu_field->mask); } out_half = half; |