Commit e5ec901c by Michael Meissner Committed by Michael Meissner

Use the SIGNED_16BIT_OFFSET_EXTRA_P macro for 16-bit signed tests.

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
parent 202be586
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> 2019-10-02 Joseph Myers <joseph@codesourcery.com>
* ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change * ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change
......
...@@ -851,7 +851,8 @@ ...@@ -851,7 +851,8 @@
;; Return 1 if OP is a constant but not a valid add_operand. ;; Return 1 if OP is a constant but not a valid add_operand.
(define_predicate "non_add_cint_operand" (define_predicate "non_add_cint_operand"
(and (match_code "const_int") (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 ;; Return 1 if the operand is a constant that can be used as the operand
;; of an AND, OR or XOR. ;; of an AND, OR or XOR.
......
...@@ -7372,7 +7372,7 @@ mem_operand_gpr (rtx op, machine_mode mode) ...@@ -7372,7 +7372,7 @@ mem_operand_gpr (rtx op, machine_mode mode)
causes a wrap, so test only the low 16 bits. */ causes a wrap, so test only the low 16 bits. */
offset = ((offset & 0xffff) ^ 0x8000) - 0x8000; 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, /* 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) ...@@ -7405,7 +7405,7 @@ mem_operand_ds_form (rtx op, machine_mode mode)
causes a wrap, so test only the low 16 bits. */ causes a wrap, so test only the low 16 bits. */
offset = ((offset & 0xffff) ^ 0x8000) - 0x8000; offset = ((offset & 0xffff) ^ 0x8000) - 0x8000;
return offset + 0x8000 < 0x10000u - extra; return SIGNED_16BIT_OFFSET_EXTRA_P (offset, extra);
} }
/* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address_p. */ /* Subroutines of rs6000_legitimize_address and rs6000_legitimate_address_p. */
...@@ -7754,8 +7754,7 @@ rs6000_legitimate_offset_address_p (machine_mode mode, rtx x, ...@@ -7754,8 +7754,7 @@ rs6000_legitimate_offset_address_p (machine_mode mode, rtx x,
break; break;
} }
offset += 0x8000; return SIGNED_16BIT_OFFSET_EXTRA_P (offset, extra);
return offset < 0x10000 - extra;
} }
bool bool
...@@ -8772,8 +8771,9 @@ rs6000_mode_dependent_address (const_rtx addr) ...@@ -8772,8 +8771,9 @@ rs6000_mode_dependent_address (const_rtx addr)
&& XEXP (addr, 0) != arg_pointer_rtx && XEXP (addr, 0) != arg_pointer_rtx
&& CONST_INT_P (XEXP (addr, 1))) && CONST_INT_P (XEXP (addr, 1)))
{ {
unsigned HOST_WIDE_INT val = INTVAL (XEXP (addr, 1)); HOST_WIDE_INT val = INTVAL (XEXP (addr, 1));
return val + 0x8000 >= 0x10000 - (TARGET_POWERPC64 ? 8 : 12); HOST_WIDE_INT extra = TARGET_POWERPC64 ? 8 : 12;
return !SIGNED_16BIT_OFFSET_EXTRA_P (val, extra);
} }
break; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment