+2011-05-12 DJ Delorie <dj@redhat.com>
+ Nick Clifton <nickc@redhat.com>
+
+ * config/rx/rx.h (HAVE_PRE_DECREMENT): Fix typo.
+ * config/rx/rx.c (CC_FLAG_FP): Fix comment.
+ (rx_is_legitimate_address): Add pre-decrement and post-increment
+ addressing in HImode and QImode. Fix test for out of range
+ REG+INT addressing.
+ (rx_legitimate_constant_p): Rename ro rx_is_legitimate_constant.
+ (rx_align_for_label): Test label before extracting its usage
+ count.
+ (rx_adjust_insn_lengths): Fix selection of insn codes.
+ (TARGET_LEGITIMNATE_CONSTANT_P): Use renamed function.
+
+ (rx_builtins): New arrays - holds builtin functions.
+ (ADD_RX_BUILTIN1, ADD_RX_BUILTIN2, ADD_RX_BUILTIN3): Install
+ created builtin into rx_builtins array.
+ (rx_builtin_decl): New function.
+ (TARGET_BUITLIN_DECL): Define.
+ Include gt-rx.h.
+
2011-05-11 Jason Merrill <jason@redhat.com>
* tree.c (type_hash_canon): Use struct tree_type_non_common.
#define CC_FLAG_Z (1 << 1)
#define CC_FLAG_O (1 << 2)
#define CC_FLAG_C (1 << 3)
-#define CC_FLAG_FP (1 << 4) /* fake, to differentiate CC_Fmode */
+#define CC_FLAG_FP (1 << 4) /* Fake, to differentiate CC_Fmode. */
static unsigned int flags_from_mode (enum machine_mode mode);
static unsigned int flags_from_code (enum rtx_code code);
/* Register Indirect. */
return true;
- if (GET_MODE_SIZE (mode) <= 4
+ if ((GET_MODE_SIZE (mode) == 4
+ || GET_MODE_SIZE (mode) == 2
+ || GET_MODE_SIZE (mode) == 1)
&& (GET_CODE (x) == PRE_DEC || GET_CODE (x) == POST_INC))
/* Pre-decrement Register Indirect or
Post-increment Register Indirect. */
case 1: factor = 1; break;
}
- if (val >= (0x10000 * factor))
+ if (val > (65535 * factor))
return false;
return (val % factor) == 0;
}
insn = emit_insn (gen_addsi3 (dest, src, val));
else
{
- /* Wrap VAL in an UNSPEC so that rx_legitimate_constant_p
+ /* Wrap VAL in an UNSPEC so that rx_is_legitimate_constant
will not reject it. */
val = gen_rtx_CONST (SImode, gen_rtx_UNSPEC (SImode, gen_rtvec (1, val), UNSPEC_CONST));
insn = emit_insn (gen_addsi3 (dest, src, val));
rx_init_builtins (void)
{
#define ADD_RX_BUILTIN1(UC_NAME, LC_NAME, RET_TYPE, ARG_TYPE) \
- add_builtin_function ("__builtin_rx_" LC_NAME, \
+ add_builtin_function ("__builtin_rx_" LC_NAME, \
build_function_type_list (RET_TYPE##_type_node, \
ARG_TYPE##_type_node, \
NULL_TREE), \
operand on the RX. X is already known to satisfy CONSTANT_P. */
bool
-rx_legitimate_constant_p (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
+rx_is_legitimate_constant (enum machine_mode mode ATTRIBUTE_UNUSED, rtx x)
{
switch (GET_CODE (x))
{
because the delay due to the inserted NOPs would be greater than the delay
due to the misaligned branch. If uses_threshold is zero then the alignment
is always useful. */
- if (LABEL_NUSES (lab) < uses_threshold)
+ if (LABEL_P (lab) && LABEL_NUSES (lab) < uses_threshold)
return 0;
return optimize_size ? 1 : 3;
case CODE_FOR_smaxsi3_zero_extendhi:
case CODE_FOR_sminsi3_zero_extendhi:
case CODE_FOR_multsi3_zero_extendhi:
- case CODE_FOR_comparesi3_zero_extendqi:
+ case CODE_FOR_comparesi3_zero_extendhi:
zero = true;
factor = 2;
break;
case CODE_FOR_smaxsi3_sign_extendhi:
case CODE_FOR_sminsi3_sign_extendhi:
case CODE_FOR_multsi3_sign_extendhi:
- case CODE_FOR_comparesi3_zero_extendhi:
+ case CODE_FOR_comparesi3_sign_extendhi:
zero = false;
factor = 2;
break;
case CODE_FOR_smaxsi3_zero_extendqi:
case CODE_FOR_sminsi3_zero_extendqi:
case CODE_FOR_multsi3_zero_extendqi:
- case CODE_FOR_comparesi3_sign_extendqi:
+ case CODE_FOR_comparesi3_zero_extendqi:
zero = true;
factor = 1;
break;
case CODE_FOR_smaxsi3_sign_extendqi:
case CODE_FOR_sminsi3_sign_extendqi:
case CODE_FOR_multsi3_sign_extendqi:
- case CODE_FOR_comparesi3_sign_extendhi:
+ case CODE_FOR_comparesi3_sign_extendqi:
zero = false;
factor = 1;
break;
#define TARGET_FLAGS_REGNUM CC_REG
#undef TARGET_LEGITIMATE_CONSTANT_P
-#define TARGET_LEGITIMATE_CONSTANT_P rx_legitimate_constant_p
+#define TARGET_LEGITIMATE_CONSTANT_P rx_is_legitimate_constant
struct gcc_target targetm = TARGET_INITIALIZER;