+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>
(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>
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, \
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,\
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,\
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)
{
#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
struct gcc_target targetm = TARGET_INITIALIZER;
-/* #include "gt-rx.h" */
+#include "gt-rx.h"