This patch adds an alternative to use PLI to load up large DImode constants if
-mcpu=future is used.

It is a slight reworking of patch V7 #1 after reformating the movdi_interal64
insn.  I have done bootstraps and make check on a power8 little endian system
and there were no regressions.  Can I check this patch in?

Patch V7 #1:
https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01301.html

2019-12-09  Michael Meissner  <meiss...@linux.ibm.com>

        * config/rs6000/rs6000.c (num_insns_constant_gpr): Return 1 if the
        constant can be loaded with PLI if -mcpu=future.
        * config/rs6000/rs6000.md (movdi_internal64): Add alternative to
        use PLI to load up 34-bit constants if -mcpu=future.

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c  (revision 279141)
+++ gcc/config/rs6000/rs6000.c  (working copy)
@@ -5541,6 +5541,10 @@ num_insns_constant_gpr (HOST_WIDE_INT va
           && (value >> 31 == -1 || value >> 31 == 0))
     return 1;
 
+  /* PADDI can support up to 34 bit signed integers.  */
+  else if (TARGET_PREFIXED_ADDR && SIGNED_34BIT_OFFSET_P (value))
+    return 1;
+
   else if (TARGET_POWERPC64)
     {
       HOST_WIDE_INT low  = ((value & 0xffffffff) ^ 0x80000000) - 0x80000000;
Index: gcc/config/rs6000/rs6000.md
===================================================================
--- gcc/config/rs6000/rs6000.md (revision 279141)
+++ gcc/config/rs6000/rs6000.md (working copy)
@@ -8828,7 +8828,7 @@ (define_split
 })
 
 ;;        GPR store   GPR load    GPR move
-;;        GPR li      GPR lis     GPR #
+;;        GPR li      GPR lis     GPR pli     GPR #
 ;;        FPR store   FPR load    FPR move
 ;;        AVX store   AVX store   AVX load    AVX load    VSX move
 ;;        P9 0        P9 -1       AVX 0/-1    VSX 0       VSX -1
@@ -8838,7 +8838,7 @@ (define_split
 (define_insn "*movdi_internal64"
   [(set (match_operand:DI 0 "nonimmediate_operand"
          "=YZ,        r,          r,
-          r,          r,          r,
+          r,          r,          r,          r,
           m,          ^d,         ^d,
           wY,         Z,          $v,         $v,         ^wa,
           wa,         wa,         v,          wa,         wa,
@@ -8847,7 +8847,7 @@ (define_insn "*movdi_internal64"
           ?r,         ?wa")
        (match_operand:DI 1 "input_operand"
          "r,          YZ,         r,
-          I,          L,          nF,
+          I,          L,          eI,         nF,
           ^d,         m,          ^d,
           ^v,         $v,         wY,         Z,          ^wa,
           Oj,         wM,         OjwM,       Oj,         wM,
@@ -8863,6 +8863,7 @@ (define_insn "*movdi_internal64"
    mr %0,%1
    li %0,%1
    lis %0,%v1
+   li %0,%1
    #
    stfd%U0%X0 %1,%0
    lfd%U1%X1 %0,%1
@@ -8886,7 +8887,7 @@ (define_insn "*movdi_internal64"
    mtvsrd %x0,%1"
   [(set_attr "type"
          "store,      load,       *,
-          *,          *,          *,
+          *,          *,          *,          *,
           fpstore,    fpload,     fpsimple,
           fpstore,    fpstore,    fpload,     fpload,     veclogical,
           vecsimple,  vecsimple,  vecsimple,  veclogical, veclogical,
@@ -8896,7 +8897,7 @@ (define_insn "*movdi_internal64"
    (set_attr "size" "64")
    (set_attr "length"
          "*,          *,          *,
-          *,          *,          20,
+          *,          *,          *,          20,
           *,          *,          *,
           *,          *,          *,          *,          *,
           *,          *,          *,          *,          *,
@@ -8905,7 +8906,7 @@ (define_insn "*movdi_internal64"
           *,          *")
    (set_attr "isa"
          "*,          *,          *,
-          *,          *,          *,
+          *,          *,          fut,        *,
           *,          *,          *,
           p9v,        p7v,        p9v,        p7v,        *,
           p9v,        p9v,        p7v,        *,          *,

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797

Reply via email to