]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
amdgcn: Fix assembler version incompatibility
authorAndrew Stubbs <ams@codesourcery.com>
Thu, 30 Sep 2021 16:50:33 +0000 (17:50 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 18 Oct 2021 06:10:44 +0000 (08:10 +0200)
This is another case of the global_load instruction format changing in LLVM
(because they fixed a bug).  The configure test is already in place to detect
what is needed.

gcc/ChangeLog:

* config/gcn/gcn-valu.md (gather<mode>_insn_2offsets<exec>): Apply
HAVE_GCN_ASM_GLOBAL_LOAD_FIXED.
(scatter<mode>_insn_2offsets<exec_scatter>): Likewise.

(cherry picked from commit 81c362c7c2bccd72d798bf7ea6c74d4b1cc3931f)

gcc/config/gcn/gcn-valu.md

index 84ff67508b9955e507906b3bab999ff69b8b598c..01fdce64d42340cda53ecc769a9a24cf33d9d7b0 100644 (file)
        /* Work around assembler bug in which a 64-bit register is expected,
        but a 32-bit value would be correct.  */
        int reg = REGNO (operands[2]) - FIRST_VGPR_REG;
-       sprintf (buf, "global_load%%o0\t%%0, v[%d:%d], %%1 offset:%%3%s\;"
-                     "s_waitcnt\tvmcnt(0)", reg, reg + 1, glc);
+       if (HAVE_GCN_ASM_GLOBAL_LOAD_FIXED)
+         sprintf (buf, "global_load%%o0\t%%0, v%d, %%1 offset:%%3%s\;"
+                       "s_waitcnt\tvmcnt(0)", reg, glc);
+       else
+         sprintf (buf, "global_load%%o0\t%%0, v[%d:%d], %%1 offset:%%3%s\;"
+                       "s_waitcnt\tvmcnt(0)", reg, reg + 1, glc);
       }
     else
       gcc_unreachable ();
        /* Work around assembler bug in which a 64-bit register is expected,
        but a 32-bit value would be correct.  */
        int reg = REGNO (operands[1]) - FIRST_VGPR_REG;
-       sprintf (buf, "global_store%%s3\tv[%d:%d], %%3, %%0 offset:%%2%s",
-                reg, reg + 1, glc);
+       if (HAVE_GCN_ASM_GLOBAL_LOAD_FIXED)
+         sprintf (buf, "global_store%%s3\tv%d, %%3, %%0 offset:%%2%s",
+                  reg, glc);
+       else
+         sprintf (buf, "global_store%%s3\tv[%d:%d], %%3, %%0 offset:%%2%s",
+                  reg, reg + 1, glc);
       }
     else
       gcc_unreachable ();