From 37843e454e037701feb41cc36ca501c03e62f7db Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Wed, 20 Nov 2019 14:52:15 +0000 Subject: [PATCH] aco: allow constant offsets for global/scratch instructions on GFX10 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit I don't think the bug applies for global/scratch instructions and load_barycentric_at_sample selection expects this feature to work. Fixes various dEQP-VK.pipeline.multisample_interpolation.* tests on GFX10. Signed-off-by: Rhys Perry Reviewed-By: Timur Kristóf --- src/amd/compiler/aco_assembler.cpp | 5 ++++- src/amd/compiler/aco_ir.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/compiler/aco_assembler.cpp b/src/amd/compiler/aco_assembler.cpp index 9b76ba740dd..4b70b2c0ac7 100644 --- a/src/amd/compiler/aco_assembler.cpp +++ b/src/amd/compiler/aco_assembler.cpp @@ -399,11 +399,14 @@ void emit_instruction(asm_context& ctx, std::vector& out, Instruction* if (ctx.chip_class <= GFX9) { assert(flat->offset <= 0x1fff); encoding |= flat->offset & 0x1fff; - } else { + } else if (instr->format == Format::FLAT) { /* GFX10 has a 12-bit immediate OFFSET field, * but it has a hw bug: it ignores the offset, called FlatSegmentOffsetBug */ assert(flat->offset == 0); + } else { + assert(flat->offset <= 0xfff); + encoding |= flat->offset & 0xfff; } if (instr->format == Format::SCRATCH) encoding |= 1 << 14; diff --git a/src/amd/compiler/aco_ir.h b/src/amd/compiler/aco_ir.h index a0b5698bb67..98d59ea2d63 100644 --- a/src/amd/compiler/aco_ir.h +++ b/src/amd/compiler/aco_ir.h @@ -844,7 +844,7 @@ struct MIMG_instruction : public Instruction { * */ struct FLAT_instruction : public Instruction { - uint16_t offset; /* Vega only */ + uint16_t offset; /* Vega/Navi only */ bool slc; /* system level coherent */ bool glc; /* globally coherent */ bool dlc; /* NAVI: device level coherent */ -- 2.30.2