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 <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2019-04-30 04:52:36 +00:00
parent 576a27fd55
commit 055f6def30
1 changed files with 11 additions and 0 deletions

View File

@ -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;