summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimur Kristóf <[email protected]>2019-09-26 17:51:51 +0200
committerTimur Kristóf <[email protected]>2019-10-10 09:57:53 +0200
commit89b074be8659f70f6f1b536605159b5f4870fb0d (patch)
tree1cfe1907c3c54a1142e7a8380fb4b3354dea3032 /src
parentd3a48c272fe83c1b8757565aff94d6c85e2492e0 (diff)
aco: Support GFX10 VOP3 and VOP1 as VOP3 in aco_assembler.
Signed-off-by: Timur Kristóf <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/compiler/aco_assembler.cpp24
1 files changed, 18 insertions, 6 deletions
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<uint32_t>& out, Instruction*
if ((uint16_t) instr->format & (uint16_t) Format::VOP3A) {
VOP3A_instruction* vop3 = static_cast<VOP3A_instruction*>(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++)