From 5f2f13fde25c838309d1bf6c23bf58bd92442822 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Thu, 12 May 2011 06:30:28 -0400 Subject: [PATCH] rx.h (HAVE_PRE_DECREMENT): Fix typo. * 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. Co-Authored-By: Nick Clifton From-SVN: r173695 --- gcc/ChangeLog | 21 +++++++++++++++++++++ gcc/config/rx/rx.c | 26 ++++++++++++++------------ gcc/config/rx/rx.h | 2 +- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2f008f1b626..5b6a1b79d2b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,24 @@ +2011-05-12 DJ Delorie + Nick Clifton + + * 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 * tree.c (type_hash_canon): Use struct tree_type_non_common. diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index 30886dc3bc2..b26490e1436 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -58,7 +58,7 @@ static void rx_print_operand (FILE *, rtx, int); #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); @@ -85,7 +85,9 @@ rx_is_legitimate_address (enum machine_mode mode, rtx x, /* 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. */ @@ -125,7 +127,7 @@ rx_is_legitimate_address (enum machine_mode mode, rtx x, case 1: factor = 1; break; } - if (val >= (0x10000 * factor)) + if (val > (65535 * factor)) return false; return (val % factor) == 0; } @@ -1349,7 +1351,7 @@ gen_safe_add (rtx dest, rtx src, rtx val, bool is_frame_related) 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)); @@ -1932,7 +1934,7 @@ static void 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), \ @@ -2448,7 +2450,7 @@ rx_is_ms_bitfield_layout (const_tree record_type ATTRIBUTE_UNUSED) 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)) { @@ -2782,7 +2784,7 @@ rx_align_for_label (rtx lab, int uses_threshold) 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; @@ -2837,7 +2839,7 @@ rx_adjust_insn_length (rtx insn, int current_length) 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; @@ -2852,7 +2854,7 @@ rx_adjust_insn_length (rtx insn, int current_length) 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; @@ -2867,7 +2869,7 @@ rx_adjust_insn_length (rtx insn, int current_length) 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; @@ -2882,7 +2884,7 @@ rx_adjust_insn_length (rtx insn, int current_length) 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; @@ -3062,7 +3064,7 @@ rx_adjust_insn_length (rtx insn, int current_length) #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; diff --git a/gcc/config/rx/rx.h b/gcc/config/rx/rx.h index 1780867dcbf..67e8ce1c577 100644 --- a/gcc/config/rx/rx.h +++ b/gcc/config/rx/rx.h @@ -144,7 +144,7 @@ #define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1 -#define HAVE_PRE_DECCREMENT 1 +#define HAVE_PRE_DECREMENT 1 #define HAVE_POST_INCREMENT 1 #define MOVE_RATIO(SPEED) ((SPEED) ? 4 : 2) -- 2.30.2