]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* config/spu/spu-builtins.h: Delete file.
authoruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Apr 2009 22:48:47 +0000 (22:48 +0000)
committeruweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Apr 2009 22:48:47 +0000 (22:48 +0000)
* config/spu/spu.h (enum spu_builtin_type): Move here from
spu-builtins.h.
(struct spu_builtin_description): Likewise.  Add GTY marker.
Do not use enum spu_function_code or enum insn_code.
(spu_builtins): Add extern declaration.

* config/spu/spu.c: Do not include "spu-builtins.h".
(enum spu_function_code, enum spu_builtin_type_index,
V16QI_type_node, V8HI_type_node, V4SI_type_node, V2DI_type_node,
V4SF_type_node, V2DF_type_node, unsigned_V16QI_type_node,
unsigned_V8HI_type_node, unsigned_V4SI_type_node,
unsigned_V2DI_type_node): Move here from spu-builtins.h.
(spu_builtin_types): Make static.  Add GTY marker.
(spu_builtins): Add extern declaration with GTY marker.
Include "gt-spu.h".

* config/spu/spu-c.c: Do not include "spu-builtins.h".
(spu_resolve_overloaded_builtin): Do not use spu_function_code.
Check programmatically whether all parameters are scalar.

* config/spu/t-spu-elf (spu.o, spu-c.o): Update dependencies.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146660 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/spu/spu-builtins.h [deleted file]
gcc/config/spu/spu-c.c
gcc/config/spu/spu.c
gcc/config/spu/spu.h
gcc/config/spu/t-spu-elf

index e18c15c944d3fb91d7c9a493aeb6f009c3189084..abf2b2eab80dee6566cd6d0e21d941de8e0011a2 100644 (file)
@@ -1,3 +1,29 @@
+2009-04-23  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/spu/spu-builtins.h: Delete file.
+
+       * config/spu/spu.h (enum spu_builtin_type): Move here from
+       spu-builtins.h.
+       (struct spu_builtin_description): Likewise.  Add GTY marker.
+       Do not use enum spu_function_code or enum insn_code.
+       (spu_builtins): Add extern declaration.
+
+       * config/spu/spu.c: Do not include "spu-builtins.h".
+       (enum spu_function_code, enum spu_builtin_type_index,
+       V16QI_type_node, V8HI_type_node, V4SI_type_node, V2DI_type_node,
+       V4SF_type_node, V2DF_type_node, unsigned_V16QI_type_node,
+       unsigned_V8HI_type_node, unsigned_V4SI_type_node,
+       unsigned_V2DI_type_node): Move here from spu-builtins.h.
+       (spu_builtin_types): Make static.  Add GTY marker.
+       (spu_builtins): Add extern declaration with GTY marker.
+       Include "gt-spu.h".
+
+       * config/spu/spu-c.c: Do not include "spu-builtins.h".
+       (spu_resolve_overloaded_builtin): Do not use spu_function_code.
+       Check programmatically whether all parameters are scalar.
+
+       * config/spu/t-spu-elf (spu.o, spu-c.o): Update dependencies.
+
 2009-04-23  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gimplify.c (gimplify_modify_expr_rhs) <VAR_DECL>: Do not do a direct
diff --git a/gcc/config/spu/spu-builtins.h b/gcc/config/spu/spu-builtins.h
deleted file mode 100644 (file)
index 9acdbf1..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* Copyright (C) 2006, 2007 Free Software Foundation, Inc.
-
-   This file is free software; you can redistribute it and/or modify it under
-   the terms of the GNU General Public License as published by the Free
-   Software Foundation; either version 3 of the License, or (at your option) 
-   any later version.
-
-   This file is distributed in the hope that it will be useful, but WITHOUT
-   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-   for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with GCC; see the file COPYING3.  If not see
-   <http://www.gnu.org/licenses/>.  */
-\f
-/* built-ins */
-
-enum spu_builtin_type_index
-{
-  SPU_BTI_END_OF_PARAMS,
-
-  /* We create new type nodes for these. */
-  SPU_BTI_V16QI,
-  SPU_BTI_V8HI,
-  SPU_BTI_V4SI,
-  SPU_BTI_V2DI,
-  SPU_BTI_V4SF,
-  SPU_BTI_V2DF,
-  SPU_BTI_UV16QI,
-  SPU_BTI_UV8HI,
-  SPU_BTI_UV4SI,
-  SPU_BTI_UV2DI,
-
-  /* A 16-byte type. (Implemented with V16QI_type_node) */
-  SPU_BTI_QUADWORD,
-
-  /* These all correspond to intSI_type_node */
-  SPU_BTI_7,
-  SPU_BTI_S7,
-  SPU_BTI_U7,
-  SPU_BTI_S10,
-  SPU_BTI_S10_4,
-  SPU_BTI_U14,
-  SPU_BTI_16,
-  SPU_BTI_S16,
-  SPU_BTI_S16_2,
-  SPU_BTI_U16,
-  SPU_BTI_U16_2,
-  SPU_BTI_U18,
-
-  /* These correspond to the standard types */
-  SPU_BTI_INTQI, 
-  SPU_BTI_INTHI, 
-  SPU_BTI_INTSI, 
-  SPU_BTI_INTDI, 
-
-  SPU_BTI_UINTQI,
-  SPU_BTI_UINTHI,
-  SPU_BTI_UINTSI,
-  SPU_BTI_UINTDI,
-
-  SPU_BTI_FLOAT, 
-  SPU_BTI_DOUBLE,
-
-  SPU_BTI_VOID,   
-  SPU_BTI_PTR,   
-
-  SPU_BTI_MAX
-};
-
-#define V16QI_type_node               (spu_builtin_types[SPU_BTI_V16QI])
-#define V8HI_type_node                (spu_builtin_types[SPU_BTI_V8HI])
-#define V4SI_type_node                (spu_builtin_types[SPU_BTI_V4SI])
-#define V2DI_type_node                (spu_builtin_types[SPU_BTI_V2DI])
-#define V4SF_type_node                (spu_builtin_types[SPU_BTI_V4SF])
-#define V2DF_type_node                (spu_builtin_types[SPU_BTI_V2DF])
-#define unsigned_V16QI_type_node      (spu_builtin_types[SPU_BTI_UV16QI])
-#define unsigned_V8HI_type_node       (spu_builtin_types[SPU_BTI_UV8HI])
-#define unsigned_V4SI_type_node       (spu_builtin_types[SPU_BTI_UV4SI])
-#define unsigned_V2DI_type_node       (spu_builtin_types[SPU_BTI_UV2DI])
-
-extern GTY(()) tree spu_builtin_types[SPU_BTI_MAX];
-
-/* Some builtins require special handling.  This enum differentiates. */
-enum spu_builtin_type {
-    B_INSN,
-    B_JUMP,
-    B_BISLED,
-    B_CALL,
-    B_HINT,
-    B_OVERLOAD, 
-    B_INTERNAL
-};
-
-typedef enum {
-#define DEF_BUILTIN(fcode, icode, name, type, params) fcode,
-#include "spu-builtins.def"
-#undef DEF_BUILTIN
-   NUM_SPU_BUILTINS
-} spu_function_code;
-
-struct spu_builtin_description {
-    spu_function_code fcode;
-    enum insn_code icode;
-    const char *name;
-    enum spu_builtin_type type;
-
-    /* The first element of parm is always the return type.  The rest
-     * are a zero terminated list of parameters. */
-    int parm[5];
-
-    tree fndecl;
-};
-
-extern GTY(()) struct spu_builtin_description spu_builtins[];
-
-
-
index 6e37fc532ea3429e838a542aa7cf27f667e83219..e1352b14a8a661d4a8fa80042c680c960e170839 100644 (file)
@@ -31,7 +31,6 @@
 #include "insn-codes.h"
 #include "recog.h"
 #include "optabs.h"
-#include "spu-builtins.h"
 \f
 
 /* Keep the vector keywords handy for fast comparisons.  */
@@ -102,8 +101,7 @@ spu_resolve_overloaded_builtin (tree fndecl, void *passed_args)
                          || POINTER_TYPE_P (t))
   VEC(tree,gc) *fnargs = (VEC(tree,gc) *) passed_args;
   unsigned int nargs = VEC_length (tree, fnargs);
-  spu_function_code new_fcode, fcode =
-    DECL_FUNCTION_CODE (fndecl) - END_BUILTINS;
+  int new_fcode, fcode = DECL_FUNCTION_CODE (fndecl) - END_BUILTINS;
   struct spu_builtin_description *desc;
   tree match = NULL_TREE;
 
@@ -123,8 +121,15 @@ spu_resolve_overloaded_builtin (tree fndecl, void *passed_args)
       tree decl = spu_builtins[new_fcode].fndecl;
       tree params = TYPE_ARG_TYPES (TREE_TYPE (decl));
       tree param;
+      bool all_scalar;
       unsigned int p;
 
+      /* Check whether all parameters are scalar.  */
+      all_scalar = true;
+      for (param = params; param != void_list_node; param = TREE_CHAIN (param))
+      if (!SCALAR_TYPE_P (TREE_VALUE (param)))
+       all_scalar = false;
+
       for (param = params, p = 0;
           param != void_list_node;
           param = TREE_CHAIN (param), p++)
@@ -156,10 +161,7 @@ spu_resolve_overloaded_builtin (tree fndecl, void *passed_args)
             parameter. */
          if ((!SCALAR_TYPE_P (param_type)
               || !SCALAR_TYPE_P (arg_type)
-              || ((fcode == SPU_SPLATS || fcode == SPU_PROMOTE
-                   || fcode == SPU_HCMPEQ || fcode == SPU_HCMPGT
-                   || fcode == SPU_MASKB || fcode == SPU_MASKH
-                   || fcode == SPU_MASKW) && p == 0))
+              || (all_scalar && p == 0))
              && !comptypes (TYPE_MAIN_VARIANT (param_type),
                             TYPE_MAIN_VARIANT (arg_type)))
            break;
index b0ba7ceebd2a8ed9b03ea4187f306a571776e4d3..a51170bad21b38141ec680b83d277cc4619ec0e4 100644 (file)
 #include "machmode.h"
 #include "gimple.h"
 #include "tm-constrs.h"
-#include "spu-builtins.h"
 #include "ddg.h"
 #include "sbitmap.h"
 #include "timevar.h"
 #include "df.h"
 
 /* Builtin types, data and prototypes. */
+
+enum spu_builtin_type_index
+{
+  SPU_BTI_END_OF_PARAMS,
+
+  /* We create new type nodes for these. */
+  SPU_BTI_V16QI,
+  SPU_BTI_V8HI,
+  SPU_BTI_V4SI,
+  SPU_BTI_V2DI,
+  SPU_BTI_V4SF,
+  SPU_BTI_V2DF,
+  SPU_BTI_UV16QI,
+  SPU_BTI_UV8HI,
+  SPU_BTI_UV4SI,
+  SPU_BTI_UV2DI,
+
+  /* A 16-byte type. (Implemented with V16QI_type_node) */
+  SPU_BTI_QUADWORD,
+
+  /* These all correspond to intSI_type_node */
+  SPU_BTI_7,
+  SPU_BTI_S7,
+  SPU_BTI_U7,
+  SPU_BTI_S10,
+  SPU_BTI_S10_4,
+  SPU_BTI_U14,
+  SPU_BTI_16,
+  SPU_BTI_S16,
+  SPU_BTI_S16_2,
+  SPU_BTI_U16,
+  SPU_BTI_U16_2,
+  SPU_BTI_U18,
+
+  /* These correspond to the standard types */
+  SPU_BTI_INTQI, 
+  SPU_BTI_INTHI, 
+  SPU_BTI_INTSI, 
+  SPU_BTI_INTDI, 
+
+  SPU_BTI_UINTQI,
+  SPU_BTI_UINTHI,
+  SPU_BTI_UINTSI,
+  SPU_BTI_UINTDI,
+
+  SPU_BTI_FLOAT, 
+  SPU_BTI_DOUBLE,
+
+  SPU_BTI_VOID,   
+  SPU_BTI_PTR,   
+
+  SPU_BTI_MAX
+};
+
+#define V16QI_type_node               (spu_builtin_types[SPU_BTI_V16QI])
+#define V8HI_type_node                (spu_builtin_types[SPU_BTI_V8HI])
+#define V4SI_type_node                (spu_builtin_types[SPU_BTI_V4SI])
+#define V2DI_type_node                (spu_builtin_types[SPU_BTI_V2DI])
+#define V4SF_type_node                (spu_builtin_types[SPU_BTI_V4SF])
+#define V2DF_type_node                (spu_builtin_types[SPU_BTI_V2DF])
+#define unsigned_V16QI_type_node      (spu_builtin_types[SPU_BTI_UV16QI])
+#define unsigned_V8HI_type_node       (spu_builtin_types[SPU_BTI_UV8HI])
+#define unsigned_V4SI_type_node       (spu_builtin_types[SPU_BTI_UV4SI])
+#define unsigned_V2DI_type_node       (spu_builtin_types[SPU_BTI_UV2DI])
+
+static GTY(()) tree spu_builtin_types[SPU_BTI_MAX];
+
 struct spu_builtin_range
 {
   int low, high;
@@ -202,8 +268,6 @@ spu_libgcc_cmp_return_mode (void);
 static enum machine_mode
 spu_libgcc_shift_count_mode (void);
 
-/* Built in types.  */
-tree spu_builtin_types[SPU_BTI_MAX];
 \f
 /*  TARGET overrides.  */
 
@@ -5059,6 +5123,16 @@ spu_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)
 \f
 /* Create the built-in types and functions */
 
+enum spu_function_code
+{
+#define DEF_BUILTIN(fcode, icode, name, type, params) fcode,
+#include "spu-builtins.def"
+#undef DEF_BUILTIN
+   NUM_SPU_BUILTINS
+};
+
+extern GTY(()) struct spu_builtin_description spu_builtins[NUM_SPU_BUILTINS];
+
 struct spu_builtin_description spu_builtins[] = {
 #define DEF_BUILTIN(fcode, icode, name, type, params) \
   {fcode, icode, name, type, params, NULL_TREE},
@@ -6289,3 +6363,5 @@ spu_section_type_flags (tree decl, const char *name, int reloc)
     return SECTION_BSS;
   return default_section_type_flags (decl, name, reloc);
 }
+
+#include "gt-spu.h"
index ae84aac2775206b9ad0cca157c510d6a485276ef..8780d1b90020ebeb285c0f9276e307d629a030d9 100644 (file)
@@ -622,3 +622,33 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin;       \
 extern GTY(()) rtx spu_compare_op0;
 extern GTY(()) rtx spu_compare_op1;
 
+
+/* Builtins.  */
+
+enum spu_builtin_type
+{
+  B_INSN,
+  B_JUMP,
+  B_BISLED,
+  B_CALL,
+  B_HINT,
+  B_OVERLOAD,
+  B_INTERNAL
+};
+
+struct GTY(()) spu_builtin_description
+{
+  int fcode;
+  int icode;
+  const char *name;
+  enum spu_builtin_type type;
+
+  /* The first element of parm is always the return type.  The rest
+     are a zero terminated list of parameters.  */
+  int parm[5];
+
+  tree fndecl;
+};
+
+extern struct spu_builtin_description spu_builtins[];
+
index 97341327501b86448f2431c2f9ea79707a0d50f3..0a36e959c5bab6fd21c75284278ea38ab7da507b 100644 (file)
@@ -85,13 +85,10 @@ spu.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   output.h $(BASIC_BLOCK_H) $(INTEGRATE_H) toplev.h $(GGC_H) $(HASHTAB_H) \
   $(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h cfglayout.h \
   $(srcdir)/config/spu/spu-protos.h \
-  $(srcdir)/config/spu/spu-builtins.h \
   $(srcdir)/config/spu/spu-builtins.def 
 
 spu-c.o: $(srcdir)/config/spu/spu-c.c \
     $(srcdir)/config/spu/spu-protos.h \
-    $(srcdir)/config/spu/spu-builtins.h \
-    $(srcdir)/config/spu/spu-builtins.def \
     $(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \
     $(TM_P_H) c-pragma.h coretypes.h $(TM_H) insn-codes.h
        $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/spu/spu-c.c