From: Timur Kristóf Date: Thu, 26 Sep 2019 15:51:51 +0000 (+0200) Subject: aco: Support GFX10 VOP3 and VOP1 as VOP3 in aco_assembler. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=89b074be8659f70f6f1b536605159b5f4870fb0d;p=mesa.git aco: Support GFX10 VOP3 and VOP1 as VOP3 in aco_assembler. Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann --- diff --git a/src/amd/compiler/aco_assembler.cpp b/src/amd/compiler/aco_assembler.cpp index 9070d88e1c6..fcad107f34c 100644 --- a/src/amd/compiler/aco_assembler.cpp +++ b/src/amd/compiler/aco_assembler.cpp @@ -442,17 +442,29 @@ void emit_instruction(asm_context& ctx, std::vector& out, Instruction* if ((uint16_t) instr->format & (uint16_t) Format::VOP3A) { VOP3A_instruction* vop3 = static_cast(instr); - if ((uint16_t) instr->format & (uint16_t) Format::VOP2) + if ((uint16_t) instr->format & (uint16_t) Format::VOP2) { opcode = opcode + 0x100; - else if ((uint16_t) instr->format & (uint16_t) Format::VOP1) - opcode = opcode + 0x140; - else if ((uint16_t) instr->format & (uint16_t) Format::VOPC) + } else if ((uint16_t) instr->format & (uint16_t) Format::VOP1) { + if (ctx.chip_class <= GFX9) { + opcode = opcode + 0x140; + } else { + /* RDNA ISA doc says this is 0x140, but that doesn't work */ + opcode = opcode + 0x180; + } + } else if ((uint16_t) instr->format & (uint16_t) Format::VOPC) { opcode = opcode + 0x0; - else if ((uint16_t) instr->format & (uint16_t) Format::VINTRP) + } else if ((uint16_t) instr->format & (uint16_t) Format::VINTRP) { opcode = opcode + 0x270; + } // TODO: op_sel - uint32_t encoding = (0b110100 << 26); + uint32_t encoding; + if (ctx.chip_class <= GFX9) { + encoding = (0b110100 << 26); + } else if (ctx.chip_class == GFX10) { + encoding = (0b110101 << 26); + } + encoding |= opcode << 16; encoding |= (vop3->clamp ? 1 : 0) << 15; for (unsigned i = 0; i < 3; i++)