[gcc(refs/users/meissner/heads/work076)] Mark XXSPLTIW/XXSPLTIDP as prefixed -- PR 104136

Michael Meissner meissner@gcc.gnu.org
Thu Jan 20 19:43:07 GMT 2022


https://gcc.gnu.org/g:32714598c49395b189e524e4d79dcccf3dd8fdc4

commit 32714598c49395b189e524e4d79dcccf3dd8fdc4
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Thu Jan 20 14:42:46 2022 -0500

    Mark XXSPLTIW/XXSPLTIDP as prefixed -- PR 104136
    
    If you compile module_advect_em.F90 with -Ofast -mcpu=power10, one module
    is large enough that we can't use a single conditional jump to span the
    function.  Instead, GCC has to reverse the condition, and do a conditional
    jump around an unconditional branch.  It turns out when xxspltiw and
    xxspltdp instructions were generated, they were not marked as being
    prefixed (i.e. length of 12 bytes instead of 4 bytes).  This meant the
    calculations for the branch length were off, which in turn meant the
    assembler raised an error because it couldn't do the conditional jump.
    
    The fix is to explicitly set the prefixed attribute when we are loading up
    vector constants with the xxspltiw or xxspltidp instructions.
    
    gcc/
    2022-01-20  Michael Meissner  <meissner@the-meissners.org>
    
            PR target/104136
            * gcc/config/vsx.md (vsx_mov<mode>_64bit): Explicitly set the
            prefixed attribute for xxspltiw and xxspltidp instructions.
            (vsx_mov<mode>_32bit): Likewise.

Diff:
---
 gcc/config/rs6000/vsx.md | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/vsx.md b/gcc/config/rs6000/vsx.md
index e84ffb6a6db..c8c891e13f4 100644
--- a/gcc/config/rs6000/vsx.md
+++ b/gcc/config/rs6000/vsx.md
@@ -1237,7 +1237,12 @@
                "<VSisa>,   <VSisa>,   <VSisa>,   *,         *,         *,
                 *,         *,         *,         *,         p9v,       *,
                 p10,       p10,
-                <VSisa>,   *,         *,         *,         *")])
+                <VSisa>,   *,         *,         *,         *")
+   (set_attr "prefixed"
+               "*,         *,         *,         *,         *,         *,
+                *,         *,         *,         *,         *,         *,
+                *,         yes,
+                *,         *,         *,         *,         *")])
 
 ;;              VSX store  VSX load   VSX move   GPR load   GPR store  GPR move
 ;;              LXVKQ      XXSPLTI*
@@ -1276,6 +1281,11 @@
                "<VSisa>,   <VSisa>,   <VSisa>,   *,         *,         *,
                 p10,       p10,
                 p9v,       *,         <VSisa>,   *,         *,
+                *,         *")
+   (set_attr "prefixed"
+               "*,         *,         *,         *,         *,         *,
+                *,         yes,
+                *,         *,         *,         *,         *,
                 *,         *")])
 
 ;; Explicit  load/store expanders for the builtin functions


More information about the Gcc-cvs mailing list