always define SHORT_IMMEDIATES_SIGN_EXTEND

gcc/ChangeLog:

2015-07-08  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* combine.c (update_rsp_from_reg_equal): Don't check if
	SHORT_IMMEDIATES_SIGN_EXTEND is defined.
	(reg_nonzero_bits_for_combine): Likewise.
	* config/alpha/alpha.h: Define SHORT_IMMEDIATES_SIGN_EXTEND to
	1.
	* config/frv/frv.h: Likewise.
	* config/lm32/lm32.h: Likewise.
	* config/mep/mep.h: Likewise.
	* config/mips/mips.h: Likewise.
	* config/rs6000/rs6000.h: Likewise.
	* config/sh/sh.h: Likewise.
	* config/tilegx/tilegx.h (enum reg_class): Likewise.
	* config/tilepro/tilepro.h: Likewise.
	* defaults.h: Add default for SHORT_IMMEDIATES_SIGN_EXTEND.
	* doc/tm.texi: Regenerate.
	* doc/tm.texi.in: Adjust.
	* rtlanal.c (nonzero_bits1): Likewise.

From-SVN: r225593
This commit is contained in:
Trevor Saunders 2015-07-09 02:50:07 +00:00 committed by Trevor Saunders
parent be1a835d86
commit 58f2ae18ff
15 changed files with 46 additions and 25 deletions

View File

@ -1,3 +1,23 @@
2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* combine.c (update_rsp_from_reg_equal): Don't check if
SHORT_IMMEDIATES_SIGN_EXTEND is defined.
(reg_nonzero_bits_for_combine): Likewise.
* config/alpha/alpha.h: Define SHORT_IMMEDIATES_SIGN_EXTEND to
1.
* config/frv/frv.h: Likewise.
* config/lm32/lm32.h: Likewise.
* config/mep/mep.h: Likewise.
* config/mips/mips.h: Likewise.
* config/rs6000/rs6000.h: Likewise.
* config/sh/sh.h: Likewise.
* config/tilegx/tilegx.h (enum reg_class): Likewise.
* config/tilepro/tilepro.h: Likewise.
* defaults.h: Add default for SHORT_IMMEDIATES_SIGN_EXTEND.
* doc/tm.texi: Regenerate.
* doc/tm.texi.in: Adjust.
* rtlanal.c (nonzero_bits1): Likewise.
2015-07-08 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* combine.c (do_SUBST_MODE): Don't check the value of HAVE_cc0

View File

@ -1624,7 +1624,6 @@ setup_incoming_promotions (rtx_insn *first)
}
}
#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
/* If MODE has a precision lower than PREC and SRC is a non-negative constant
that would appear negative in MODE, sign-extend SRC for use in nonzero_bits
because some machines (maybe most) will actually do the sign-extension and
@ -1644,7 +1643,6 @@ sign_extend_short_imm (rtx src, machine_mode mode, unsigned int prec)
return src;
}
#endif
/* Update RSP for pseudo-register X from INSN's REG_EQUAL note (if one exists)
and SET. */
@ -1661,11 +1659,12 @@ update_rsp_from_reg_equal (reg_stat_type *rsp, rtx_insn *insn, const_rtx set,
if (reg_equal_note)
reg_equal = XEXP (reg_equal_note, 0);
#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
src = sign_extend_short_imm (src, GET_MODE (x), BITS_PER_WORD);
if (reg_equal)
reg_equal = sign_extend_short_imm (reg_equal, GET_MODE (x), BITS_PER_WORD);
#endif
if (SHORT_IMMEDIATES_SIGN_EXTEND)
{
src = sign_extend_short_imm (src, GET_MODE (x), BITS_PER_WORD);
if (reg_equal)
reg_equal = sign_extend_short_imm (reg_equal, GET_MODE (x), BITS_PER_WORD);
}
/* Don't call nonzero_bits if it cannot change anything. */
if (rsp->nonzero_bits != ~(unsigned HOST_WIDE_INT) 0)
@ -9824,10 +9823,10 @@ reg_nonzero_bits_for_combine (const_rtx x, machine_mode mode,
if (tem)
{
#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
tem = sign_extend_short_imm (tem, GET_MODE (x),
GET_MODE_PRECISION (mode));
#endif
if (SHORT_IMMEDIATES_SIGN_EXTEND)
tem = sign_extend_short_imm (tem, GET_MODE (x),
GET_MODE_PRECISION (mode));
return tem;
}
else if (nonzero_sign_valid && rsp->nonzero_bits)

View File

@ -897,7 +897,7 @@ do { \
#define LOAD_EXTEND_OP(MODE) ((MODE) == SImode ? SIGN_EXTEND : ZERO_EXTEND)
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */

View File

@ -1899,7 +1899,7 @@ fprintf (STREAM, "\t.word .L%d\n", VALUE)
#define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
/* The maximum number of bytes that a single instruction can move quickly from
memory to memory. */

View File

@ -525,7 +525,7 @@ do { \
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
#define MOVE_MAX UNITS_PER_WORD
#define MAX_MOVE_MAX 4

View File

@ -765,7 +765,7 @@ typedef struct
#define WORD_REGISTER_OPERATIONS
#define LOAD_EXTEND_OP(MODE) SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
#define MOVE_MAX 4

View File

@ -1626,7 +1626,7 @@ FP_ASM_SPEC "\
#define POINTERS_EXTEND_UNSIGNED false
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
/* The [d]clz instructions have the natural values at 0. */

View File

@ -2046,7 +2046,7 @@ do { \
#define LOAD_EXTEND_OP(MODE) ZERO_EXTEND
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */

View File

@ -1827,7 +1827,7 @@ struct sh_args {
: (MODE) != SImode ? SIGN_EXTEND : UNKNOWN)
/* Define if loading short immediate values into registers sign extends. */
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
/* Nonzero if access to memory by bytes is no faster than for words. */
#define SLOW_BYTE_ACCESS 1

View File

@ -386,7 +386,7 @@ enum reg_class
#define SHIFT_COUNT_TRUNCATED 0
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
/* We represent all SI values as sign-extended DI values in
registers. */

View File

@ -346,7 +346,7 @@ enum reg_class
#define SHIFT_COUNT_TRUNCATED 1
#define SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 1
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1

View File

@ -1265,6 +1265,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define TARGET_SUPPORTS_WIDE_INT 0
#endif
#ifndef SHORT_IMMEDIATES_SIGN_EXTEND
#define SHORT_IMMEDIATES_SIGN_EXTEND 0
#endif
#ifdef GCC_INSN_FLAGS_H
/* Dependent default target macro definitions

View File

@ -10410,7 +10410,7 @@ is larger then @var{mem_mode} but still smaller than @code{word_mode}.
@end defmac
@defmac SHORT_IMMEDIATES_SIGN_EXTEND
Define this macro if loading short immediate values into registers sign
Define this macro to 1 if loading short immediate values into registers sign
extends.
@end defmac

View File

@ -7534,7 +7534,7 @@ is larger then @var{mem_mode} but still smaller than @code{word_mode}.
@end defmac
@defmac SHORT_IMMEDIATES_SIGN_EXTEND
Define this macro if loading short immediate values into registers sign
Define this macro to 1 if loading short immediate values into registers sign
extends.
@end defmac

View File

@ -4327,14 +4327,12 @@ nonzero_bits1 (const_rtx x, machine_mode mode, const_rtx known_x,
}
case CONST_INT:
#ifdef SHORT_IMMEDIATES_SIGN_EXTEND
/* If X is negative in MODE, sign-extend the value. */
if (INTVAL (x) > 0
if (SHORT_IMMEDIATES_SIGN_EXTEND && INTVAL (x) > 0
&& mode_width < BITS_PER_WORD
&& (UINTVAL (x) & ((unsigned HOST_WIDE_INT) 1 << (mode_width - 1)))
!= 0)
return UINTVAL (x) | (HOST_WIDE_INT_M1U << mode_width);
#endif
return UINTVAL (x);