predicates.md (cint34_operand): Update SIGNED_34BIT_OFFSET_P call.
authorMichael Meissner <meissner@linux.ibm.com>
Wed, 10 Jul 2019 19:34:03 +0000 (19:34 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Wed, 10 Jul 2019 19:34:03 +0000 (19:34 +0000)
2019-07-10  Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/predicates.md (cint34_operand): Update
SIGNED_34BIT_OFFSET_P call.
(pcrel_address): Update SIGNED_34BIT_OFFSET_P call.
(pcrel_external_address): Update SIGNED_34BIT_OFFSET_P call.
* config/rs6000/rs6000.c (rs6000_prefixed_address): Update
SIGNED_16BIT_OFFSET_P and SIGNED_34BIT_OFFSET_P calls.
* config/rs6000/rs6000.h (SIGNED_16BIT_OFFSET_P): Remove EXTRA
argument.
(SIGNED_34BIT_OFFSET_P): Remove EXTRA argument.
(SIGNED_16BIT_OFFSET_EXTRA_P): New macro, like
SIGNED_16BIT_OFFSET_P with an EXTRA argument.
(SIGNED_34BIT_OFFSET_EXTRA_P): New macro, like
SIGNED_34BIT_OFFSET_P with an EXTRA argument.

From-SVN: r273370

gcc/ChangeLog
gcc/config/rs6000/predicates.md
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h

index 5d3c8d42401c68f503e283bc4ab87a94486623a5..e5c05e5e88d0210ace5c3c4f24146548b390aadf 100644 (file)
@@ -1,3 +1,19 @@
+2019-07-10  Michael Meissner  <meissner@linux.ibm.com>
+
+       * config/rs6000/predicates.md (cint34_operand): Update
+       SIGNED_34BIT_OFFSET_P call.
+       (pcrel_address): Update SIGNED_34BIT_OFFSET_P call.
+       (pcrel_external_address): Update SIGNED_34BIT_OFFSET_P call.
+       * config/rs6000/rs6000.c (rs6000_prefixed_address): Update
+       SIGNED_16BIT_OFFSET_P and SIGNED_34BIT_OFFSET_P calls.
+       * config/rs6000/rs6000.h (SIGNED_16BIT_OFFSET_P): Remove EXTRA
+       argument.
+       (SIGNED_34BIT_OFFSET_P): Remove EXTRA argument.
+       (SIGNED_16BIT_OFFSET_EXTRA_P): New macro, like
+       SIGNED_16BIT_OFFSET_P with an EXTRA argument.
+       (SIGNED_34BIT_OFFSET_EXTRA_P): New macro, like
+       SIGNED_34BIT_OFFSET_P with an EXTRA argument.
+
 2019-07-10  Iain Sandoe  <iain@sandoe.co.uk>
 
        * config/rs6000/darwin.h (LIB_SPEC): Collate this spec here.
index 45fa40a404509fb919a3e38e659c21b80390596e..e64f772de02fc1cab8694c5bc305b9f4fd6ec720 100644 (file)
   if (!TARGET_PREFIXED_ADDR)
     return 0;
 
-  return SIGNED_34BIT_OFFSET_P (INTVAL (op), 0);
+  return SIGNED_34BIT_OFFSET_P (INTVAL (op));
 })
 
 ;; Return 1 if op is a register that is not special.
       rtx op0 = XEXP (op, 0);
       rtx op1 = XEXP (op, 1);
 
-      if (!CONST_INT_P (op1) || !SIGNED_34BIT_OFFSET_P (INTVAL (op1), 0))
+      if (!CONST_INT_P (op1) || !SIGNED_34BIT_OFFSET_P (INTVAL (op1)))
        return false;
 
       op = op0;
       rtx op0 = XEXP (op, 0);
       rtx op1 = XEXP (op, 1);
 
-      if (!CONST_INT_P (op1) || !SIGNED_34BIT_OFFSET_P (INTVAL (op1), 0))
+      if (!CONST_INT_P (op1) || !SIGNED_34BIT_OFFSET_P (INTVAL (op1)))
        return false;
 
       op = op0;
index ccc9d764382958d2a16b6ae4e0fa6807af8ac1e7..39fa6ec382bd7332357cddce1832019f5016fb67 100644 (file)
@@ -21523,11 +21523,11 @@ rs6000_prefixed_address (rtx addr, machine_mode mode)
        return false;
 
       HOST_WIDE_INT value = INTVAL (op1);
-      if (!SIGNED_34BIT_OFFSET_P (value, 0))
+      if (!SIGNED_34BIT_OFFSET_P (value))
        return false;
 
       /* Offset larger than 16-bits?  */
-      if (!SIGNED_16BIT_OFFSET_P (value, 0))
+      if (!SIGNED_16BIT_OFFSET_P (value))
        return true;
 
       /* DQ instruction (bottom 4 bits must be 0) for vectors.  */
index 9193d9e8a54a8590d8e179ef7b1591e01b47d32b..5f3b9edd388071e0477dc290990f53c4a057a76a 100644 (file)
@@ -2526,16 +2526,27 @@ typedef struct GTY(()) machine_function
 #pragma GCC poison TARGET_FLOAT128 OPTION_MASK_FLOAT128 MASK_FLOAT128
 #endif
 
-/* Whether a given VALUE is a valid 16- or 34-bit signed offset.  EXTRA is the
-   amount that we can't touch at the high end of the range (typically if the
-   address is split into smaller addresses, the extra covers the addresses
-   which might be generated when the insn is split).  */
-#define SIGNED_16BIT_OFFSET_P(VALUE, EXTRA)                            \
-  IN_RANGE (VALUE,                                                     \
+/* Whether a given VALUE is a valid 16 or 34-bit signed offset.  */
+#define SIGNED_16BIT_OFFSET_P(VALUE)                                   \
+  IN_RANGE ((VALUE),                                                   \
+           -(HOST_WIDE_INT_1 << 15),                                   \
+           (HOST_WIDE_INT_1 << 15) - 1)
+
+#define SIGNED_34BIT_OFFSET_P(VALUE)                                   \
+  IN_RANGE ((VALUE),                                                   \
+           -(HOST_WIDE_INT_1 << 33),                                   \
+           (HOST_WIDE_INT_1 << 33) - 1)
+
+/* Like SIGNED_16BIT_OFFSET_P and SIGNED_34BIT_OFFSET_P, but with an extra
+   argument that gives a length to validate a range of addresses, to allow for
+   splitting insns into several insns, each of which has an offsettable
+   address.  */
+#define SIGNED_16BIT_OFFSET_EXTRA_P(VALUE, EXTRA)                      \
+  IN_RANGE ((VALUE),                                                   \
            -(HOST_WIDE_INT_1 << 15),                                   \
            (HOST_WIDE_INT_1 << 15) - 1 - (EXTRA))
 
-#define SIGNED_34BIT_OFFSET_P(VALUE, EXTRA)                            \
-  IN_RANGE (VALUE,                                                     \
+#define SIGNED_34BIT_OFFSET_EXTRA_P(VALUE, EXTRA)                      \
+  IN_RANGE ((VALUE),                                                   \
            -(HOST_WIDE_INT_1 << 33),                                   \
            (HOST_WIDE_INT_1 << 33) - 1 - (EXTRA))