aco: apply the clamped integer addition disassembly workaround for v_add3
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 1 Oct 2020 08:12:44 +0000 (10:12 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 2 Oct 2020 12:21:31 +0000 (14:21 +0200)
LLVM fails to disassemble v_add3 + clamp.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3563
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6961>

src/amd/compiler/aco_print_asm.cpp

index b9a6226..1e81814 100644 (file)
@@ -164,7 +164,9 @@ void print_asm(Program *program, std::vector<uint32_t>& binary,
       if (!l &&
           ((program->chip_class >= GFX9 && (binary[pos] & 0xffff8000) == 0xd1348000) || /* v_add_u32_e64 + clamp */
            (program->chip_class >= GFX10 && (binary[pos] & 0xffff8000) == 0xd7038000) || /* v_add_u16_e64 + clamp */
-           (program->chip_class <= GFX9 && (binary[pos] & 0xffff8000) == 0xd1268000)) /* v_add_u16_e64 + clamp */) {
+           (program->chip_class <= GFX9 && (binary[pos] & 0xffff8000) == 0xd1268000) || /* v_add_u16_e64 + clamp */
+           (program->chip_class >= GFX10 && (binary[pos] & 0xffff8000) == 0xd76d8000) || /* v_add3_u32 + clamp */
+           (program->chip_class == GFX9 && (binary[pos] & 0xffff8000) == 0xd1ff8000)) /* v_add3_u32 + clamp */) {
          out << "\tinteger addition + clamp";
          bool has_literal = program->chip_class >= GFX10 &&
                             (((binary[pos+1] & 0x1ff) == 0xff) || (((binary[pos+1] >> 9) & 0x1ff) == 0xff));