+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
}
}
-#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
return src;
}
-#endif
/* Update RSP for pseudo-register X from INSN's REG_EQUAL note (if one exists)
and 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)
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)
#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. */
#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. */
#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
#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
#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. */
#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
\f
/* Value is 1 if truncating an integer of INPREC bits to OUTPREC bits
is done just by pretending it is already truncated. */
: (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
#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. */
#define SHIFT_COUNT_TRUNCATED 1
-#define SHORT_IMMEDIATES_SIGN_EXTEND
+#define SHORT_IMMEDIATES_SIGN_EXTEND 1
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
#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
@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
@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
}
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);