diff options
author | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-23 22:48:47 +0000 |
---|---|---|
committer | uweigand <uweigand@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-23 22:48:47 +0000 |
commit | c2233b462b3e437fd4e57a844092dd251f3c7cf5 (patch) | |
tree | 5d2532db5c7f8ebb76683b0584c57697a9254274 /gcc/config/spu/spu-c.c | |
parent | 7fd3f504416286edc2584ec8099490432443ceb6 (diff) | |
download | gcc-c2233b462b3e437fd4e57a844092dd251f3c7cf5.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146660 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/spu/spu-c.c')
-rw-r--r-- | gcc/config/spu/spu-c.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/gcc/config/spu/spu-c.c b/gcc/config/spu/spu-c.c index 6e37fc532ea..e1352b14a8a 100644 --- a/gcc/config/spu/spu-c.c +++ b/gcc/config/spu/spu-c.c @@ -31,7 +31,6 @@ #include "insn-codes.h" #include "recog.h" #include "optabs.h" -#include "spu-builtins.h" /* 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; |