aco: allow constant offsets for global/scratch instructions on GFX10
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 20 Nov 2019 14:52:15 +0000 (14:52 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Tue, 26 Nov 2019 14:39:27 +0000 (14:39 +0000)
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 <pendingchaos02@gmail.com>
Reviewed-By: Timur Kristóf <timur.kristof@gmail.com>
src/amd/compiler/aco_assembler.cpp
src/amd/compiler/aco_ir.h

index 9b76ba740dd9cfa749bed14a107fb90941a400f0..4b70b2c0ac75105a8a02aec2f77879ec1fb88209 100644 (file)
@@ -399,11 +399,14 @@ void emit_instruction(asm_context& ctx, std::vector<uint32_t>& 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;
index a0b5698bb671f1a0e774bec0843bbedb7a200ecb..98d59ea2d63b8012f58ca360c3931844c1700fa3 100644 (file)
@@ -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 */