Просмотр исходного кода

panfrost: Verify and print brx condition in disasm

The condition code in extended branches is repeated 8 times for unclear
reasons; accordingly, the code would be disassembled as "unknown5555",
"unknownAAAA", etc. This patch correctly masks off the lower two bits to
find the true code to print, verifying that the code is repeated as
believed to be necessary (providing some assurance for compiler quality
and an assert trip in case we encounter a shader in the wild that breaks
the convention).

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
tags/19.1-branchpoint
Alyssa Rosenzweig 7 лет назад
Родитель
Сommit
705723e6be
1 измененных файлов: 10 добавлений и 1 удалений
  1. 10
    1
      src/gallium/drivers/panfrost/midgard/disassemble.c

+ 10
- 1
src/gallium/drivers/panfrost/midgard/disassemble.c Просмотреть файл

printf("brx."); printf("brx.");


print_branch_op(br.op); print_branch_op(br.op);
print_branch_cond(br.cond);

/* Condition repeated 8 times in all known cases. Check this. */

unsigned cond = br.cond & 0x3;

for (unsigned i = 0; i < 16; i += 2) {
assert(((br.cond >> i) & 0x3) == cond);
}

print_branch_cond(cond);


if (br.unknown) if (br.unknown)
printf(".unknown%d", br.unknown); printf(".unknown%d", br.unknown);

Загрузка…
Отмена
Сохранить