Commit e0c556d3 by Alan Modra Committed by Alan Modra

pa.c (uint32_operand): Don't use long constant >= 2^32.

	* pa.c (uint32_operand): Don't use long constant >= 2^32.
	(emit_move_sequence): Use HOST_WIDE_INT constants.  Don't worry
	about 32->64 bit sign extension if 32 bit HOST_WIDE_INTs.
	(compute_movstrsi_length): Make `align' unsigned to avoid warning.
	(output_64bit_and): Use plain `int's for shift counts.
	(output_64bit_ior): Likewise.
	(function_arg_partial_nregs): Use unsigned vars to avoid warnings.
	* pa.h (CONST_OK_FOR_LETTER_P): Use HOST_WIDE_INT constants for case
	`N', and simplify.

From-SVN: r41328
parent cdbff0ab
2001-04-13 Alan Modra <amodra@one.net.au> 2001-04-13 Alan Modra <amodra@one.net.au>
* pa.c (uint32_operand): Don't use long constant >= 2^32.
(emit_move_sequence): Use HOST_WIDE_INT constants. Don't worry
about 32->64 bit sign extension if 32 bit HOST_WIDE_INTs.
(compute_movstrsi_length): Make `align' unsigned to avoid warning.
(output_64bit_and): Use plain `int's for shift counts.
(output_64bit_ior): Likewise.
(function_arg_partial_nregs): Use unsigned vars to avoid warnings.
* pa.h (CONST_OK_FOR_LETTER_P): Use HOST_WIDE_INT constants for case
`N', and simplify.
* pa-hpux10.h (NEW_HP_ASSEMBLER): Define to 1. * pa-hpux10.h (NEW_HP_ASSEMBLER): Define to 1.
* pa-hpux11.h (NEW_HP_ASSEMBLER): Likewise. * pa-hpux11.h (NEW_HP_ASSEMBLER): Likewise.
* pa.h (LEGITIMATE_CONSTANT_P) Collapse two defines depending on * pa.h (LEGITIMATE_CONSTANT_P) Collapse two defines depending on
......
...@@ -568,7 +568,7 @@ uint32_operand (op, mode) ...@@ -568,7 +568,7 @@ uint32_operand (op, mode)
#if HOST_BITS_PER_WIDE_INT > 32 #if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */ /* All allowed constants will fit a CONST_INT. */
return (GET_CODE (op) == CONST_INT return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) >= 0 && INTVAL (op) < 0x100000000L)); && (INTVAL (op) >= 0 && INTVAL (op) < (HOST_WIDE_INT) 1 << 32));
#else #else
return (GET_CODE (op) == CONST_INT return (GET_CODE (op) == CONST_INT
|| (GET_CODE (op) == CONST_DOUBLE || (GET_CODE (op) == CONST_DOUBLE
...@@ -1595,16 +1595,18 @@ emit_move_sequence (operands, mode, scratch_reg) ...@@ -1595,16 +1595,18 @@ emit_move_sequence (operands, mode, scratch_reg)
int need_zero_extend = 0; int need_zero_extend = 0;
if (TARGET_64BIT && GET_CODE (operand1) == CONST_INT if (TARGET_64BIT && GET_CODE (operand1) == CONST_INT
&& HOST_BITS_PER_WIDE_INT > 32
&& GET_MODE_BITSIZE (GET_MODE (operand0)) > 32) && GET_MODE_BITSIZE (GET_MODE (operand0)) > 32)
{ {
HOST_WIDE_INT val = INTVAL (operand1); HOST_WIDE_INT val = INTVAL (operand1);
HOST_WIDE_INT nval = INTVAL (operand1); HOST_WIDE_INT nval;
/* If the value is the same after a 32->64bit sign /* If the value is the same after a 32->64bit sign
extension, then we can use it as-is. Else we will extension, then we can use it as-is. Else we will
need to sign extend the constant from 32->64bits need to sign extend the constant from 32->64bits
then zero extend the result from 32->64bits. */ then zero extend the result from 32->64bits. */
nval = ((val & 0xffffffff) ^ (~0x7fffffff)) + 0x80000000; nval = ((val & (((HOST_WIDE_INT) 2 << 31) - 1))
^ ((HOST_WIDE_INT) 1 << 31)) - ((HOST_WIDE_INT) 1 << 31);
if (val != nval) if (val != nval)
{ {
need_zero_extend = 1; need_zero_extend = 1;
...@@ -2285,7 +2287,7 @@ compute_movstrsi_length (insn) ...@@ -2285,7 +2287,7 @@ compute_movstrsi_length (insn)
rtx insn; rtx insn;
{ {
rtx pat = PATTERN (insn); rtx pat = PATTERN (insn);
int align = INTVAL (XEXP (XVECEXP (pat, 0, 6), 0)); unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 6), 0));
unsigned long n_bytes = INTVAL (XEXP (XVECEXP (pat, 0, 5), 0)); unsigned long n_bytes = INTVAL (XEXP (XVECEXP (pat, 0, 5), 0));
unsigned int n_insns = 0; unsigned int n_insns = 0;
...@@ -2372,22 +2374,22 @@ output_64bit_and (operands) ...@@ -2372,22 +2374,22 @@ output_64bit_and (operands)
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0) if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
{ {
unsigned HOST_WIDE_INT mask = INTVAL (operands[2]); unsigned HOST_WIDE_INT mask = INTVAL (operands[2]);
unsigned HOST_WIDE_INT ls0, ls1, ms0, p, len; int ls0, ls1, ms0, p, len;
for (ls0 = 0; ls0 < HOST_BITS_PER_WIDE_INT; ls0++) for (ls0 = 0; ls0 < HOST_BITS_PER_WIDE_INT; ls0++)
if ((mask & ((unsigned HOST_WIDE_INT)1 << ls0)) == 0) if ((mask & ((unsigned HOST_WIDE_INT) 1 << ls0)) == 0)
break; break;
for (ls1 = ls0; ls1 < HOST_BITS_PER_WIDE_INT; ls1++) for (ls1 = ls0; ls1 < HOST_BITS_PER_WIDE_INT; ls1++)
if ((mask & ((unsigned HOST_WIDE_INT)1 << ls1)) != 0) if ((mask & ((unsigned HOST_WIDE_INT) 1 << ls1)) != 0)
break; break;
for (ms0 = ls1; ms0 < HOST_BITS_PER_WIDE_INT; ms0++) for (ms0 = ls1; ms0 < HOST_BITS_PER_WIDE_INT; ms0++)
if ((mask & ((unsigned HOST_WIDE_INT)1 << ms0)) == 0) if ((mask & ((unsigned HOST_WIDE_INT) 1 << ms0)) == 0)
break; break;
if (ms0 != HOST_BITS_PER_WIDE_INT) if (ms0 != HOST_BITS_PER_WIDE_INT)
abort(); abort ();
if (ls1 == HOST_BITS_PER_WIDE_INT) if (ls1 == HOST_BITS_PER_WIDE_INT)
{ {
...@@ -2452,22 +2454,22 @@ output_64bit_ior (operands) ...@@ -2452,22 +2454,22 @@ output_64bit_ior (operands)
rtx *operands; rtx *operands;
{ {
unsigned HOST_WIDE_INT mask = INTVAL (operands[2]); unsigned HOST_WIDE_INT mask = INTVAL (operands[2]);
unsigned HOST_WIDE_INT bs0, bs1, p, len; int bs0, bs1, p, len;
if (INTVAL (operands[2]) == 0) if (INTVAL (operands[2]) == 0)
return "copy %1,%0"; return "copy %1,%0";
for (bs0 = 0; bs0 < HOST_BITS_PER_WIDE_INT; bs0++) for (bs0 = 0; bs0 < HOST_BITS_PER_WIDE_INT; bs0++)
if ((mask & ((unsigned HOST_WIDE_INT)1 << bs0)) != 0) if ((mask & ((unsigned HOST_WIDE_INT) 1 << bs0)) != 0)
break; break;
for (bs1 = bs0; bs1 < HOST_BITS_PER_WIDE_INT; bs1++) for (bs1 = bs0; bs1 < HOST_BITS_PER_WIDE_INT; bs1++)
if ((mask & ((unsigned HOST_WIDE_INT)1 << bs1)) == 0) if ((mask & ((unsigned HOST_WIDE_INT) 1 << bs1)) == 0)
break; break;
if (bs1 != HOST_BITS_PER_WIDE_INT if (bs1 != HOST_BITS_PER_WIDE_INT
&& ((unsigned HOST_WIDE_INT) 1 << bs1) <= mask) && ((unsigned HOST_WIDE_INT) 1 << bs1) <= mask)
abort(); abort ();
p = 63 - bs0; p = 63 - bs0;
len = bs1 - bs0; len = bs1 - bs0;
...@@ -7113,13 +7115,13 @@ function_arg_partial_nregs (cum, mode, type, named) ...@@ -7113,13 +7115,13 @@ function_arg_partial_nregs (cum, mode, type, named)
tree type; tree type;
int named ATTRIBUTE_UNUSED; int named ATTRIBUTE_UNUSED;
{ {
int max_arg_words = 8; unsigned int max_arg_words = 8;
int offset = 0; unsigned int offset = 0;
if (FUNCTION_ARG_SIZE(mode, type) > 1 && (cum->words & 1)) if (FUNCTION_ARG_SIZE (mode, type) > 1 && (cum->words & 1))
offset = 1; offset = 1;
if (cum->words + offset + FUNCTION_ARG_SIZE(mode, type) <= max_arg_words) if (cum->words + offset + FUNCTION_ARG_SIZE (mode, type) <= max_arg_words)
/* Arg fits fully into registers. */ /* Arg fits fully into registers. */
return 0; return 0;
else if (cum->words + offset >= max_arg_words) else if (cum->words + offset >= max_arg_words)
......
...@@ -546,16 +546,16 @@ extern void hppa_init_pic_save PARAMS ((void)); ...@@ -546,16 +546,16 @@ extern void hppa_init_pic_save PARAMS ((void));
*/ */
#define CONST_OK_FOR_LETTER_P(VALUE, C) \ #define CONST_OK_FOR_LETTER_P(VALUE, C) \
((C) == 'I' ? VAL_11_BITS_P (VALUE) \ ((C) == 'I' ? VAL_11_BITS_P (VALUE) \
: (C) == 'J' ? VAL_14_BITS_P (VALUE) \ : (C) == 'J' ? VAL_14_BITS_P (VALUE) \
: (C) == 'K' ? zdepi_cint_p (VALUE) \ : (C) == 'K' ? zdepi_cint_p (VALUE) \
: (C) == 'L' ? VAL_5_BITS_P (VALUE) \ : (C) == 'L' ? VAL_5_BITS_P (VALUE) \
: (C) == 'M' ? (VALUE) == 0 \ : (C) == 'M' ? (VALUE) == 0 \
: (C) == 'N' ? (((VALUE) & (unsigned long)0x7ff) == 0 \ : (C) == 'N' ? (((VALUE) & (((HOST_WIDE_INT) -1 << 31) | 0x7ff)) == 0 \
&& (VALUE) == ((((VALUE) & 0xffffffff) ^ (~0x7fffffff)) \ || (((VALUE) & (((HOST_WIDE_INT) -1 << 31) | 0x7ff)) \
+ 0x80000000)) \ == (HOST_WIDE_INT) -1 << 31)) \
: (C) == 'O' ? (((VALUE) & ((VALUE) + (long)1)) == 0) \ : (C) == 'O' ? (((VALUE) & ((VALUE) + 1)) == 0) \
: (C) == 'P' ? and_mask_p (VALUE) \ : (C) == 'P' ? and_mask_p (VALUE) \
: 0) : 0)
/* Similar, but for floating or large integer constants, and defining letters /* Similar, but for floating or large integer constants, and defining letters
......
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