]> gcc.gnu.org Git - gcc.git/commitdiff
Use the SIGNED_16BIT_OFFSET_EXTRA_P macro for 16-bit signed tests.
authorMichael Meissner <meissner@linux.ibm.com>
Thu, 3 Oct 2019 00:13:40 +0000 (00:13 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Thu, 3 Oct 2019 00:13:40 +0000 (00:13 +0000)
2019-10-02   Michael Meissner  <meissner@linux.ibm.com>

* config/rs6000/rs6000.c (mem_operand_gpr): Use
SIGNED_16BIT_OFFSET_EXTRA_P.
(mem_operand_ds_form): Use SIGNED_16BIT_OFFSET_EXTRA_P.
(rs6000_mode_dependent_address): Use SIGNED_16BIT_OFFSET_EXTRA_P.

From-SVN: r276498

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

index 26c5c427b9432e20d73543d2c75406b71396178e..2d6bdba71134678de9750fe8b3fda589db418de8 100644 (file)
@@ -1,3 +1,11 @@
+2019-10-02   Michael Meissner  <meissner@linux.ibm.com>
+
+       * config/rs6000/rs6000.c (mem_operand_gpr): Use
+       SIGNED_16BIT_OFFSET_EXTRA_P macro.
+       (mem_operand_ds_form): Use SIGNED_16BIT_OFFSET_EXTRA_P macro.
+       (rs6000_mode_dependent_address): Use SIGNED_16BIT_OFFSET_EXTRA_P
+       macro.
+
 2019-10-02  Joseph Myers  <joseph@codesourcery.com>
 
        * ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change
index 345d9c337af8928fcb33cb19da95e766797c30be..2e13a7ea8e760c80db9bbcc715d7fb5362db2d45 100644 (file)
 ;; Return 1 if OP is a constant but not a valid add_operand.
 (define_predicate "non_add_cint_operand"
   (and (match_code "const_int")
-       (not (match_operand 0 "add_operand"))))
+       (match_test "!satisfies_constraint_I (op)
+                   && !satisfies_constraint_L (op)")))
 
 ;; Return 1 if the operand is a constant that can be used as the operand
 ;; of an AND, OR or XOR.
index 330e2490301950ab0d9ae61571d20468a6d3787b..a4a38822b43ec2d7cb0037499f3d000f53e41ae1 100644 (file)
@@ -7372,7 +7372,7 @@ mem_operand_gpr (rtx op, machine_mode mode)
        causes a wrap, so test only the low 16 bits.  */
     offset = ((offset & 0xffff) ^ 0x8000) - 0x8000;
 
-  return offset + 0x8000 < 0x10000u - extra;
+  return SIGNED_16BIT_OFFSET_EXTRA_P (offset, extra);
 }
 
 /* As above, but for DS-FORM VSX insns.  Unlike mem_operand_gpr,
@@ -7405,7 +7405,7 @@ mem_operand_ds_form (rtx op, machine_mode mode)
        causes a wrap, so test only the low 16 bits.  */
     offset = ((offset & 0xffff) ^ 0x8000) - 0x8000;
 
-  return offset + 0x8000 < 0x10000u - extra;
+  return SIGNED_16BIT_OFFSET_EXTRA_P (offset, extra);
 }
 \f
 /* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address_p.  */
@@ -7754,8 +7754,7 @@ rs6000_legitimate_offset_address_p (machine_mode mode, rtx x,
       break;
     }
 
-  offset += 0x8000;
-  return offset < 0x10000 - extra;
+  return SIGNED_16BIT_OFFSET_EXTRA_P (offset, extra);
 }
 
 bool
@@ -8772,8 +8771,9 @@ rs6000_mode_dependent_address (const_rtx addr)
          && XEXP (addr, 0) != arg_pointer_rtx
          && CONST_INT_P (XEXP (addr, 1)))
        {
-         unsigned HOST_WIDE_INT val = INTVAL (XEXP (addr, 1));
-         return val + 0x8000 >= 0x10000 - (TARGET_POWERPC64 ? 8 : 12);
+         HOST_WIDE_INT val = INTVAL (XEXP (addr, 1));
+         HOST_WIDE_INT extra = TARGET_POWERPC64 ? 8 : 12;
+         return !SIGNED_16BIT_OFFSET_EXTRA_P (val, extra);
        }
       break;
 
This page took 0.125652 seconds and 5 git commands to generate.