summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-18 18:56:10 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2015-09-18 18:56:10 +0000
commit1e5769bdcb033c6791939dbf2397831fe18a58e6 (patch)
tree6292f388f1cc2290e6a1e71bff131d6424fcfbeb
parentfee30e0544efe7907241ffccff99aa0cc894fb01 (diff)
downloadgcc-1e5769bdcb033c6791939dbf2397831fe18a58e6.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227920 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/pa/pa-protos.h4
-rw-r--r--gcc/config/pa/pa.c15
-rw-r--r--gcc/config/pa/pa.md6
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 <danglin@gcc.gnu.org>
+
+ * 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 <dmalcolm@redhat.com>
* 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