From e5ec901cec9de5295bb323f538d6addd479bac46 Mon Sep 17 00:00:00 2001 From: Michael Meissner Date: Thu, 3 Oct 2019 00:13:40 +0000 Subject: [PATCH] Use the SIGNED_16BIT_OFFSET_EXTRA_P macro for 16-bit signed tests. 2019-10-02 Michael Meissner * 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 | 8 ++++++++ gcc/config/rs6000/predicates.md | 3 ++- gcc/config/rs6000/rs6000.c | 12 ++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 26c5c427b94..2d6bdba7113 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2019-10-02 Michael Meissner + + * 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 * ginclude/stdint-gcc.h [__STDC_WANT_IEC_60559_BFP_EXT__]: Change diff --git a/gcc/config/rs6000/predicates.md b/gcc/config/rs6000/predicates.md index 345d9c337af..2e13a7ea8e7 100644 --- a/gcc/config/rs6000/predicates.md +++ b/gcc/config/rs6000/predicates.md @@ -851,7 +851,8 @@ ;; 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. diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 330e2490301..a4a38822b43 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -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); } /* 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; -- 2.30.2