summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorDaniel Schürmann <[email protected]>2019-12-04 10:43:14 +0100
committerDaniel Schürmann <[email protected]>2019-12-07 11:23:11 +0100
commit23319add93bb22744ba48e9026dcc40ecd30628c (patch)
tree42dafd3497a6d7de0121a5db79a2c05b9668b2e2 /src/amd
parent6fc9ddfef88d730517e721b699b43a24346bffb4 (diff)
aco: fix disassembly of writelane instructions.
ACO writes an unused 3rd operand for internal usage which makes LLVM recoginize it as illegal instruction. Reviewed-by: Rhys Perry <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/compiler/aco_print_asm.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp
index deb15a8b256..743824888d6 100644
--- a/src/amd/compiler/aco_print_asm.cpp
+++ b/src/amd/compiler/aco_print_asm.cpp
@@ -51,13 +51,19 @@ void print_asm(Program *program, std::vector<uint32_t>& binary,
next_block++;
}
+ /* mask out src2 on v_writelane_b32 */
+ if (((program->chip_class == GFX8 || program->chip_class == GFX9) && (binary[pos] & 0xffff8000) == 0xd28a0000) ||
+ (program->chip_class == GFX10 && (binary[pos] & 0xffff8000) == 0xd7610000)) {
+ binary[pos+1] = binary[pos+1] & 0xF803FFFF;
+ }
+
size_t l = LLVMDisasmInstruction(disasm, (uint8_t *) &binary[pos],
(exec_size - pos) * sizeof(uint32_t), pos * 4,
outline, sizeof(outline));
size_t new_pos;
const int align_width = 60;
- if (program->chip_class == GFX9 && !l && ((binary[pos] & 0xffff8000) == 0xd1348000)) { /* not actually an invalid instruction */
+ if (!l && program->chip_class == GFX9 && ((binary[pos] & 0xffff8000) == 0xd1348000)) { /* not actually an invalid instruction */
out << std::left << std::setw(align_width) << std::setfill(' ') << "\tv_add_u32_e64 + clamp";
new_pos = pos + 2;
} else if (!l) {