aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/rs6000/rs6000.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2003-02-25 17:06:41 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2003-02-25 17:06:41 +0000
commitc8e4f0e96e4039c7ea360edb11ab376afdf8bb8d (patch)
tree5cf30d09267a9dff332f16da7d0bc48a305e7975 /gcc/config/rs6000/rs6000.c
parent7d9f2df2637ee19e5c9a33f1a83c84364209b02a (diff)
downloadgcc-c8e4f0e96e4039c7ea360edb11ab376afdf8bb8d.zip
gcc-c8e4f0e96e4039c7ea360edb11ab376afdf8bb8d.tar.gz
gcc-c8e4f0e96e4039c7ea360edb11ab376afdf8bb8d.tar.bz2
003-02-20 Aldy Hernandez <aldyh@redhat.com>
* doc/tm.texi: Document Rename TARGET_VECTOR_TYPES_COMPATIBLE to TARGET_VECTOR_OPAQUE_P. Document accordingly. * testsuite/gcc.dg/20030218-1.c: Check that initialization of opaque types fail. * c-typeck.c (comptypes): Change call to vector_types_compatible to vector_opaque_p. (convert_for_assignment): Call vector_opaque_p instead of vector_types_compatible. (really_start_incremental_init): Disallow initialization of opaque types. * target-def.h: Remove TARGET_VECTOR_TYPES_COMPATIBLE. Define TARGET_VECTOR_OPAQUE_P. (TARGET_INITIALIZER): Same. * target.h (struct gcc_target): Remove vector_types_compatible. Add vector_opaque_p. * config/rs6000/rs6000.c (rs6000_spe_vector_types_compatible): Remove. (is_ev64_opaque_type): Check for TARGET_SPE and make sure type is a vector type. Change return type to bool. (TARGET_VECTOR_TYPES_COMPATIBLE): Remove. (TARGET_VECTOR_OPAQUE_P): Define. * cp/parser.c (cp_parser_init_declarator): Call vector_opaque_p target hook. Include target.h. (cp_parser_init_declarator): Fix typo in function comments. From-SVN: r63411
Diffstat (limited to 'gcc/config/rs6000/rs6000.c')
-rw-r--r--gcc/config/rs6000/rs6000.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 500af59..c26c446 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -268,8 +268,7 @@ static void is_altivec_return_reg PARAMS ((rtx, void *));
static rtx generate_set_vrsave PARAMS ((rtx, rs6000_stack_t *, int));
static void altivec_frame_fixup PARAMS ((rtx, rtx, HOST_WIDE_INT));
static int easy_vector_constant PARAMS ((rtx));
-static int is_ev64_opaque_type PARAMS ((tree));
-static bool rs6000_spe_vector_types_compatible PARAMS ((tree, tree));
+static bool is_ev64_opaque_type PARAMS ((tree));
/* Hash table stuff for keeping track of TOC entries. */
@@ -422,8 +421,8 @@ static const char alt_reg_names[][8] =
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_0
-#undef TARGET_VECTOR_TYPES_COMPATIBLE
-#define TARGET_VECTOR_TYPES_COMPATIBLE rs6000_spe_vector_types_compatible
+#undef TARGET_VECTOR_OPAQUE_P
+#define TARGET_VECTOR_OPAQUE_P is_ev64_opaque_type
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -13599,35 +13598,17 @@ rs6000_memory_move_cost (mode, class, in)
/* Return true if TYPE is of type __ev64_opaque__. */
-static int
+static bool
is_ev64_opaque_type (type)
tree type;
{
- return (TYPE_NAME (type)
+ return (TARGET_SPE
+ && TREE_CODE (type) == VECTOR_TYPE
+ && TYPE_NAME (type)
&& TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_NAME (TYPE_NAME (type))
&& strcmp (IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))),
"__ev64_opaque__") == 0);
}
-/* Return true if vector type1 can be converted into vector type2. */
-
-static bool
-rs6000_spe_vector_types_compatible (t1, t2)
- tree t1;
- tree t2;
-{
- if (!TARGET_SPE
- || TREE_CODE (t1) != VECTOR_TYPE || TREE_CODE (t2) != VECTOR_TYPE)
- return 0;
-
- if (TYPE_NAME (t1) || TYPE_NAME (t2))
- return is_ev64_opaque_type (t1) || is_ev64_opaque_type (t2);
-
- /* FIXME: We assume V2SI is the opaque type, so we accidentally
- allow inter conversion to and from V2SI modes. We could use
- V1D1, and rewrite <spe.h> accordingly. */
- return t1 == V2SI_type_node || t2 == V2SI_type_node;
-}
-
#include "gt-rs6000.h"