(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.

Co-Authored-By: Nick Clifton <nickc@redhat.com>

From-SVN: r173696
This commit is contained in:
DJ Delorie 2011-05-12 06:33:57 -04:00 committed by Nick Clifton
parent 5f2f13fde2
commit 87e91fca2d
2 changed files with 31 additions and 10 deletions

View File

@ -1,3 +1,12 @@
2011-05-12 DJ Delorie <dj@redhat.com>
(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-12 DJ Delorie <dj@redhat.com>
Nick Clifton <nickc@redhat.com>
@ -6,18 +15,11 @@
(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_legitimate_constant_p): Rename to 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.
(TARGET_LEGITIMATE_CONSTANT_P): Use renamed function.
2011-05-11 Jason Merrill <jason@redhat.com>

View File

@ -1930,10 +1930,13 @@ enum rx_builtin
RX_BUILTIN_max
};
static GTY(()) tree rx_builtins[(int) RX_BUILTIN_max];
static void
rx_init_builtins (void)
{
#define ADD_RX_BUILTIN1(UC_NAME, LC_NAME, RET_TYPE, ARG_TYPE) \
rx_builtins[RX_BUILTIN_##UC_NAME] = \
add_builtin_function ("__builtin_rx_" LC_NAME, \
build_function_type_list (RET_TYPE##_type_node, \
ARG_TYPE##_type_node, \
@ -1942,6 +1945,7 @@ rx_init_builtins (void)
BUILT_IN_MD, NULL, NULL_TREE)
#define ADD_RX_BUILTIN2(UC_NAME, LC_NAME, RET_TYPE, ARG_TYPE1, ARG_TYPE2) \
rx_builtins[RX_BUILTIN_##UC_NAME] = \
add_builtin_function ("__builtin_rx_" LC_NAME, \
build_function_type_list (RET_TYPE##_type_node, \
ARG_TYPE1##_type_node,\
@ -1951,6 +1955,7 @@ rx_init_builtins (void)
BUILT_IN_MD, NULL, NULL_TREE)
#define ADD_RX_BUILTIN3(UC_NAME,LC_NAME,RET_TYPE,ARG_TYPE1,ARG_TYPE2,ARG_TYPE3) \
rx_builtins[RX_BUILTIN_##UC_NAME] = \
add_builtin_function ("__builtin_rx_" LC_NAME, \
build_function_type_list (RET_TYPE##_type_node, \
ARG_TYPE1##_type_node,\
@ -1982,6 +1987,17 @@ rx_init_builtins (void)
ADD_RX_BUILTIN1 (WAIT, "wait", void, void);
}
/* Return the RX builtin for CODE. */
static tree
rx_builtin_decl (unsigned code, bool initialize_p ATTRIBUTE_UNUSED)
{
if (code >= RX_BUILTIN_max)
return error_mark_node;
return rx_builtins[code];
}
static rtx
rx_expand_void_builtin_1_arg (rtx arg, rtx (* gen_func)(rtx), bool reg)
{
@ -2955,6 +2971,9 @@ rx_adjust_insn_length (rtx insn, int current_length)
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS rx_init_builtins
#undef TARGET_BUILTIN_DECL
#define TARGET_BUILTIN_DECL rx_builtin_decl
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN rx_expand_builtin
@ -3068,4 +3087,4 @@ rx_adjust_insn_length (rtx insn, int current_length)
struct gcc_target targetm = TARGET_INITIALIZER;
/* #include "gt-rx.h" */
#include "gt-rx.h"