From 9e27816252b9090868dbff1f1e640a7e99c13a97 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timur=20Krist=C3=B3f?= Date: Thu, 26 Sep 2019 17:47:51 +0200 Subject: [PATCH] aco: Support GFX10 MUBUF in aco_assembler. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann --- src/amd/compiler/aco_assembler.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_assembler.cpp b/src/amd/compiler/aco_assembler.cpp index 8e44050b653..5136001abcb 100644 --- a/src/amd/compiler/aco_assembler.cpp +++ b/src/amd/compiler/aco_assembler.cpp @@ -264,14 +264,22 @@ void emit_instruction(asm_context& ctx, std::vector& out, Instruction* MUBUF_instruction* mubuf = static_cast(instr); uint32_t encoding = (0b111000 << 26); encoding |= opcode << 18; - encoding |= (mubuf->slc ? 1 : 0) << 17; encoding |= (mubuf->lds ? 1 : 0) << 16; encoding |= (mubuf->glc ? 1 : 0) << 14; encoding |= (mubuf->idxen ? 1 : 0) << 13; encoding |= (mubuf->offen ? 1 : 0) << 12; + if (ctx.chip_class <= GFX9) { + assert(!mubuf->dlc); /* Device-level coherent is not supported on GFX9 and lower */ + encoding |= (mubuf->slc ? 1 : 0) << 17; + } else if (ctx.chip_class >= GFX10) { + encoding |= (mubuf->dlc ? 1 : 0) << 15; + } encoding |= 0x0FFF & mubuf->offset; out.push_back(encoding); encoding = 0; + if (ctx.chip_class >= GFX10) { + encoding |= (mubuf->slc ? 1 : 0) << 22; + } encoding |= instr->operands[2].physReg() << 24; encoding |= (mubuf->tfe ? 1 : 0) << 23; encoding |= (instr->operands[1].physReg() >> 2) << 16; -- 2.30.2