(rx_builtins): New arrays - holds builtin functions.
authorDJ Delorie <dj@redhat.com>
Thu, 12 May 2011 10:33:57 +0000 (06:33 -0400)
committerNick Clifton <nickc@gcc.gnu.org>
Thu, 12 May 2011 10:33:57 +0000 (10:33 +0000)
(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

gcc/ChangeLog
gcc/config/rx/rx.c

index 5b6a1b79d2b37448327110e062653456e0b5585c..8dcd8b95fd8691787f130add9503f89d7d6f603b 100644 (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>
 
        (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>
 
index b26490e14361d9b55c35f91bf606e93a3bb90c77..2889cebbc79732c303a849178356ad7cb4da5e4a 100644 (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"