Mesa (master): aco: replace == GFX10 with >= GFX10 where it's needed

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 19 06:48:09 UTC 2020


Module: Mesa
Branch: master
Commit: 8c144482ea1a12ea681ea35b44b4cfcb632da488
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8c144482ea1a12ea681ea35b44b4cfcb632da488

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Jun  8 18:45:35 2020 +0200

aco: replace == GFX10 with >= GFX10 where it's needed

Assume the GFX10.3 ISA is similar to GFX10 which is likely (except
possible minor changes and new instructions for raytracing).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5389>

---

 src/amd/compiler/aco_assembler.cpp         | 8 ++++----
 src/amd/compiler/aco_lower_to_hw_instr.cpp | 2 +-
 src/amd/compiler/aco_print_asm.cpp         | 4 ++--
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/amd/compiler/aco_assembler.cpp b/src/amd/compiler/aco_assembler.cpp
index 3bdea63201d..c36e8c9b51e 100644
--- a/src/amd/compiler/aco_assembler.cpp
+++ b/src/amd/compiler/aco_assembler.cpp
@@ -21,7 +21,7 @@ struct asm_context {
          opcode = &instr_info.opcode_gfx7[0];
       else if (chip_class <= GFX9)
          opcode = &instr_info.opcode_gfx9[0];
-      else if (chip_class == GFX10)
+      else if (chip_class >= GFX10)
          opcode = &instr_info.opcode_gfx10[0];
    }
 
@@ -278,7 +278,7 @@ void emit_instruction(asm_context& ctx, std::vector<uint32_t>& out, Instruction*
           instr->opcode == aco_opcode::v_interp_p2_f16) {
          if (ctx.chip_class == GFX8 || ctx.chip_class == GFX9) {
             encoding = (0b110100 << 26);
-         } else if (ctx.chip_class == GFX10) {
+         } else if (ctx.chip_class >= GFX10) {
             encoding = (0b110101 << 26);
          } else {
             unreachable("Unknown chip_class.");
@@ -548,7 +548,7 @@ void emit_instruction(asm_context& ctx, std::vector<uint32_t>& out, Instruction*
          uint32_t encoding;
          if (ctx.chip_class <= GFX9) {
             encoding = (0b110100 << 26);
-         } else if (ctx.chip_class == GFX10) {
+         } else if (ctx.chip_class >= GFX10) {
             encoding = (0b110101 << 26);
          } else {
             unreachable("Unknown chip_class.");
@@ -586,7 +586,7 @@ void emit_instruction(asm_context& ctx, std::vector<uint32_t>& out, Instruction*
          uint32_t encoding;
          if (ctx.chip_class == GFX9) {
             encoding = (0b110100111 << 23);
-         } else if (ctx.chip_class == GFX10) {
+         } else if (ctx.chip_class >= GFX10) {
             encoding = (0b110011 << 26);
          } else {
             unreachable("Unknown chip_class.");
diff --git a/src/amd/compiler/aco_lower_to_hw_instr.cpp b/src/amd/compiler/aco_lower_to_hw_instr.cpp
index 441e1b6b8e5..10ba9b82d3a 100644
--- a/src/amd/compiler/aco_lower_to_hw_instr.cpp
+++ b/src/amd/compiler/aco_lower_to_hw_instr.cpp
@@ -1832,7 +1832,7 @@ void lower_to_hw_instr(Program* program)
             {
                if (ctx.program->chip_class <= GFX7)
                   emit_gfx6_bpermute(program, instr, bld);
-               else if (ctx.program->chip_class == GFX10 && ctx.program->wave_size == 64)
+               else if (ctx.program->chip_class >= GFX10 && ctx.program->wave_size == 64)
                   emit_gfx10_wave64_bpermute(program, instr, bld);
                else
                   unreachable("Current hardware supports ds_bpermute, don't emit p_bpermute.");
diff --git a/src/amd/compiler/aco_print_asm.cpp b/src/amd/compiler/aco_print_asm.cpp
index 0c69b8c7de3..f2b924bffe0 100644
--- a/src/amd/compiler/aco_print_asm.cpp
+++ b/src/amd/compiler/aco_print_asm.cpp
@@ -134,7 +134,7 @@ void print_asm(Program *program, std::vector<uint32_t>& binary,
 
       /* mask out src2 on v_writelane_b32 */
       if (((program->chip_class == GFX8 || program->chip_class == GFX9) && (binary[pos] & 0xffff8000) == 0xd28a0000) ||
-          (program->chip_class == GFX10 && (binary[pos] & 0xffff8000) == 0xd7610000)) {
+          (program->chip_class >= GFX10 && (binary[pos] & 0xffff8000) == 0xd7610000)) {
          binary[pos+1] = binary[pos+1] & 0xF803FFFF;
       }
 
@@ -152,7 +152,7 @@ void print_asm(Program *program, std::vector<uint32_t>& binary,
          bool has_literal = program->chip_class >= GFX10 &&
                             (((binary[pos+1] & 0x1ff) == 0xff) || (((binary[pos+1] >> 9) & 0x1ff) == 0xff));
          new_pos = pos + 2 + has_literal;
-      } else if (program->chip_class == GFX10 && l == 4 && ((binary[pos] & 0xfe0001ff) == 0x020000f9)) {
+      } else if (program->chip_class >= GFX10 && l == 4 && ((binary[pos] & 0xfe0001ff) == 0x020000f9)) {
          out << std::left << std::setw(align_width) << std::setfill(' ') << "\tv_cndmask_b32 + sdwa";
          new_pos = pos + 2;
       } else if (!l) {



More information about the mesa-commit mailing list