From: DJ Delorie Date: Thu, 12 May 2011 10:33:57 +0000 (-0400) Subject: (rx_builtins): New arrays - holds builtin functions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87e91fca2d77911986c4107ea93ffaa4dfef0273;p=gcc.git (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 From-SVN: r173696 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b6a1b79d2b..8dcd8b95fd8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2011-05-12 DJ Delorie + + (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 Nick Clifton @@ -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 diff --git a/gcc/config/rx/rx.c b/gcc/config/rx/rx.c index b26490e1436..2889cebbc79 100644 --- a/gcc/config/rx/rx.c +++ b/gcc/config/rx/rx.c @@ -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"