From 5877e54ea0ab4f38f9046a12633de4fa6671e925 Mon Sep 17 00:00:00 2001 From: John David Anglin Date: Fri, 18 Sep 2015 18:56:10 +0000 Subject: [PATCH] pa-protos.h (pa_cint_ok_for_move): Change argument type to unsigned. * config/pa/pa-protos.h (pa_cint_ok_for_move): Change argument type to unsigned. (pa_ldil_cint_p): Likewise. * config/pa/pa.c (pa_cint_ok_for_move): likewise. (pa_ldil_cint_p): Likewise. Change signed casts to unsigned. Update callers. * config/pa/pa.md: Likewise. From-SVN: r227920 --- gcc/ChangeLog | 10 ++++++++++ gcc/config/pa/pa-protos.h | 4 ++-- gcc/config/pa/pa.c | 15 ++++++++------- gcc/config/pa/pa.md | 6 +++--- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 830ce8cbe12..7b8b1f14432 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2014-09-18 John David Anglin + + * config/pa/pa-protos.h (pa_cint_ok_for_move): Change argument type to + unsigned. + (pa_ldil_cint_p): Likewise. + * config/pa/pa.c (pa_cint_ok_for_move): likewise. + (pa_ldil_cint_p): Likewise. Change signed casts to unsigned. + Update callers. + * config/pa/pa.md: Likewise. + 2015-09-18 David Malcolm * Makefile.in (OBJS-libcommon): Add diagnostic-show-locus.o. diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h index 58cc463b7c4..8bf2453815f 100644 --- a/gcc/config/pa/pa-protos.h +++ b/gcc/config/pa/pa-protos.h @@ -82,9 +82,9 @@ extern rtx pa_get_deferred_plabel (rtx); #endif /* RTX_CODE */ extern int pa_and_mask_p (unsigned HOST_WIDE_INT); -extern int pa_cint_ok_for_move (HOST_WIDE_INT); +extern int pa_cint_ok_for_move (unsigned HOST_WIDE_INT); extern int pa_ior_mask_p (unsigned HOST_WIDE_INT); -extern int pa_ldil_cint_p (HOST_WIDE_INT); +extern int pa_ldil_cint_p (unsigned HOST_WIDE_INT); extern int pa_mem_shadd_constant_p (int); extern int pa_shadd_constant_p (int); extern int pa_zdepi_cint_p (unsigned HOST_WIDE_INT); diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index e16e58d14ef..a3dc17b2f35 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -707,7 +707,7 @@ pa_symbolic_expression_p (rtx x) /* Accept any constant that can be moved in one instruction into a general register. */ int -pa_cint_ok_for_move (HOST_WIDE_INT ival) +pa_cint_ok_for_move (unsigned HOST_WIDE_INT ival) { /* OK if ldo, ldil, or zdepi, can be used. */ return (VAL_14_BITS_P (ival) @@ -719,11 +719,12 @@ pa_cint_ok_for_move (HOST_WIDE_INT ival) significant 11 bits of the value must be zero and the value must not change sign when extended from 32 to 64 bits. */ int -pa_ldil_cint_p (HOST_WIDE_INT ival) +pa_ldil_cint_p (unsigned HOST_WIDE_INT ival) { - HOST_WIDE_INT x = ival & (((HOST_WIDE_INT) -1 << 31) | 0x7ff); + unsigned HOST_WIDE_INT x; - return x == 0 || x == ((HOST_WIDE_INT) -1 << 31); + x = ival & (((unsigned HOST_WIDE_INT) -1 << 31) | 0x7ff); + return x == 0 || x == ((unsigned HOST_WIDE_INT) -1 << 31); } /* True iff zdepi can be used to generate this CONST_INT. @@ -1858,7 +1859,7 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg) if (register_operand (operand1, mode) || (GET_CODE (operand1) == CONST_INT - && pa_cint_ok_for_move (INTVAL (operand1))) + && pa_cint_ok_for_move (UINTVAL (operand1))) || (operand1 == CONST0_RTX (mode)) || (GET_CODE (operand1) == HIGH && !symbolic_operand (XEXP (operand1, 0), VOIDmode)) @@ -2134,7 +2135,7 @@ pa_emit_move_sequence (rtx *operands, machine_mode mode, rtx scratch_reg) operands[1] = tmp; } else if (GET_CODE (operand1) != CONST_INT - || !pa_cint_ok_for_move (INTVAL (operand1))) + || !pa_cint_ok_for_move (UINTVAL (operand1))) { rtx temp; rtx_insn *insn; @@ -10252,7 +10253,7 @@ pa_legitimate_constant_p (machine_mode mode, rtx x) && !reload_in_progress && !reload_completed && !LEGITIMATE_64BIT_CONST_INT_P (INTVAL (x)) - && !pa_cint_ok_for_move (INTVAL (x))) + && !pa_cint_ok_for_move (UINTVAL (x))) return false; if (function_label_operand (x, mode)) diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index 46fc0f5719c..8ea669a4f73 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -5035,7 +5035,7 @@ (plus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "const_int_operand" ""))) (clobber (match_operand:SI 4 "register_operand" ""))] - "! pa_cint_ok_for_move (INTVAL (operands[2])) + "! pa_cint_ok_for_move (UINTVAL (operands[2])) && VAL_14_BITS_P (INTVAL (operands[2]) >> 1)" [(set (match_dup 4) (plus:SI (match_dup 1) (match_dup 2))) (set (match_dup 0) (plus:SI (match_dup 4) (match_dup 3)))] @@ -5054,13 +5054,13 @@ (plus:SI (match_operand:SI 1 "register_operand" "") (match_operand:SI 2 "const_int_operand" ""))) (clobber (match_operand:SI 4 "register_operand" ""))] - "! pa_cint_ok_for_move (INTVAL (operands[2]))" + "! pa_cint_ok_for_move (UINTVAL (operands[2]))" [(set (match_dup 4) (match_dup 2)) (set (match_dup 0) (plus:SI (ashift:SI (match_dup 4) (match_dup 3)) (match_dup 1)))] " { - HOST_WIDE_INT intval = INTVAL (operands[2]); + unsigned HOST_WIDE_INT intval = UINTVAL (operands[2]); /* Try dividing the constant by 2, then 4, and finally 8 to see if we can get a constant which can be loaded into a register -- 2.30.2