+/* Return true if TYPE is of type __ev64_opaque__. */
+
+static int
+is_ev64_opaque_type (type)
+ tree type;
+{
+ return (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;
+}
+