+2000-06-24 Bernd Schmidt <bernds@cygnus.co.uk>
+
+ * tree.h (enum tree_index): Add vector type nodes.
+ Add accessor macros for them.
+ (TYPE_REPRESENATION_TYPE): New macro.
+ * tree.c (build_common_tree_nodes_2): Build these nodes.
+ (finish_vector_type): New function.
+ * c-common.c (type_for_mode): Handle vector modes.
+ * tm.texi (VECTOR_MODE_SUPPORTED_P): Document.
+
+ * dbxout.c (dbxout_type): Handle VECTOR_TYPEs.
+ * dwarf.h (enum dwarf_fundamental_type): Add 128 bit integers.
+ * dwarf2out.c (lookup_type_die): Handle VECTOR_TYPEs.
+ (gen_type_die): Likewise.
+ * dwarfout.c (dwarf_fund_type_name): Handle 128 bit integers.
+ (fundamental_type_code): Likewise.
+ (type_is_fundamental): VECTOR_TYPEs aren't.
+ (output_type): Handle VECTOR_TYPEs.
+
2000-06-25 Kazu Hirata <kazu@hxi.com>
* config/arm.c: Fix a comment typo.
if (mode == TYPE_MODE (build_pointer_type (integer_type_node)))
return build_pointer_type (integer_type_node);
+#ifdef VECTOR_MODE_SUPPORTED_P
+ if (mode == TYPE_MODE (V4SF_type_node) && VECTOR_MODE_SUPPORTED_P (mode))
+ return V4SF_type_node;
+ if (mode == TYPE_MODE (V4SI_type_node) && VECTOR_MODE_SUPPORTED_P (mode))
+ return V4SI_type_node;
+ if (mode == TYPE_MODE (V2SI_type_node) && VECTOR_MODE_SUPPORTED_P (mode))
+ return V2SI_type_node;
+ if (mode == TYPE_MODE (V4HI_type_node) && VECTOR_MODE_SUPPORTED_P (mode))
+ return V4HI_type_node;
+ if (mode == TYPE_MODE (V8QI_type_node) && VECTOR_MODE_SUPPORTED_P (mode))
+ return V8QI_type_node;
+#endif
+
return 0;
}
register tree tem;
static int anonymous_type_number = 0;
+ if (TREE_CODE (type) == VECTOR_TYPE)
+ type = TYPE_DEBUG_REPRESENTATION_TYPE (type);
+
/* If there was an input error and we don't really have a type,
avoid crashing and write something that is at least valid
by assuming `int'. */
FT_int64 = 0x9908,
FT_signed_int64 = 0x9a08,
FT_unsigned_int64 = 0x9b08,
+ FT_int128 = 0x9c10,
+ FT_signed_int128 = 0x9d10,
+ FT_unsigned_int128 = 0x9e10,
FT_real32 = 0xa004,
FT_real64 = 0xa108,
lookup_type_die (type)
register tree type;
{
+ if (TREE_CODE (type) == VECTOR_TYPE)
+ type = TYPE_DEBUG_REPRESENTATION_TYPE (type);
return (dw_die_ref) TYPE_SYMTAB_POINTER (type);
}
gen_array_type_die (type, context_die);
break;
+ case VECTOR_TYPE:
+ gen_type_die (TYPE_DEBUG_REPRESENTATION_TYPE (type), context_die);
+ break;
+
case ENUMERAL_TYPE:
case RECORD_TYPE:
case UNION_TYPE:
case FT_int64: return "FT_int64";
case FT_signed_int64: return "FT_signed_int64";
case FT_unsigned_int64: return "FT_unsigned_int64";
+ case FT_int128: return "FT_int128";
+ case FT_signed_int128: return "FT_signed_int128";
+ case FT_unsigned_int128: return "FT_unsigned_int128";
case FT_real32: return "FT_real32";
case FT_real64: return "FT_real64";
if (TYPE_PRECISION (type) == CHAR_TYPE_SIZE)
return (TREE_UNSIGNED (type) ? FT_unsigned_char : FT_char);
+ if (TYPE_MODE (type) == TImode)
+ return (TREE_UNSIGNED (type) ? FT_unsigned_int128 : FT_int128);
+
/* In C++, __java_boolean is an INTEGER_TYPE with precision == 1 */
if (TYPE_PRECISION (type) == 1)
return FT_boolean;
case FILE_TYPE:
case OFFSET_TYPE:
case LANG_TYPE:
+ case VECTOR_TYPE:
return 0;
default:
case ERROR_MARK:
break;
+ case VECTOR_TYPE:
+ output_type (TYPE_DEBUG_REPRESENTATION_TYPE (type), containing_scope);
+ break;
+
case POINTER_TYPE:
case REFERENCE_TYPE:
/* Prevent infinite recursion in cases where this is a recursive
appropriate sizes. If this macro is undefined, @code{GET_MODE_BITSIZE
(DImode)} is assumed.
+@findex VECTOR_MODE_SUPPORTED_P
+@item VECTOR_MODE_SUPPORTED_P(@var{mode})
+Define this macro to be nonzero if the port is prepared to handle insns
+involving vector mode @var{mode}. At the very least, it must have move
+patterns for this mode.
+
@findex STACK_SAVEAREA_MODE
@item STACK_SAVEAREA_MODE (@var{save_level})
If defined, an expression of type @code{enum machine_mode} that
#endif /* ENABLE_TREE_CHECKING */
\f
+/* For a new vector type node T, build the information necessary for
+ debuggint output. */
+static void
+finish_vector_type (t)
+ tree t;
+{
+ layout_type (t);
+
+ {
+ tree index = build_int_2 (TYPE_VECTOR_SUBPARTS (t) - 1, 0);
+ tree array = build_array_type (TREE_TYPE (t),
+ build_index_type (index));
+ tree rt = make_node (RECORD_TYPE);
+
+ TYPE_FIELDS (rt) = build_decl (FIELD_DECL, get_identifier ("f"), array);
+ DECL_CONTEXT (TYPE_FIELDS (rt)) = rt;
+ layout_type (rt);
+ TYPE_DEBUG_REPRESENTATION_TYPE (t) = rt;
+ /* In dwarfout.c, type lookup uses TYPE_UID numbers. We want to output
+ the representation type, and we want to find that die when looking up
+ the vector type. This is most easily achieved by making the TYPE_UID
+ numbers equal. */
+ TYPE_UID (rt) = TYPE_UID (t);
+ }
+}
+
#ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif
#else
va_list_type_node = ptr_type_node;
#endif
+
+ V4SF_type_node = make_node (VECTOR_TYPE);
+ TREE_TYPE (V4SF_type_node) = float_type_node;
+ TYPE_MODE (V4SF_type_node) = V4SFmode;
+ finish_vector_type (V4SF_type_node);
+
+ V4SI_type_node = make_node (VECTOR_TYPE);
+ TREE_TYPE (V4SI_type_node) = intSI_type_node;
+ TYPE_MODE (V4SI_type_node) = V4SImode;
+ finish_vector_type (V4SI_type_node);
+
+ V2SI_type_node = make_node (VECTOR_TYPE);
+ TREE_TYPE (V2SI_type_node) = intSI_type_node;
+ TYPE_MODE (V2SI_type_node) = V2SImode;
+ finish_vector_type (V2SI_type_node);
+
+ V4HI_type_node = make_node (VECTOR_TYPE);
+ TREE_TYPE (V4HI_type_node) = intHI_type_node;
+ TYPE_MODE (V4HI_type_node) = V4HImode;
+ finish_vector_type (V4HI_type_node);
+
+ V8QI_type_node = make_node (VECTOR_TYPE);
+ TREE_TYPE (V8QI_type_node) = intQI_type_node;
+ TYPE_MODE (V8QI_type_node) = V8QImode;
+ finish_vector_type (V8QI_type_node);
}
#define TYPE_OBSTACK(NODE) (TYPE_CHECK (NODE)->type.obstack)
#define TYPE_LANG_SPECIFIC(NODE) (TYPE_CHECK (NODE)->type.lang_specific)
+/* For a VECTOR_TYPE node, this describes a different type which is emitted
+ in the debugging output. We use this to describe a vector as a
+ structure containing an array. */
+#define TYPE_DEBUG_REPRESENTATION_TYPE(NODE) (TYPE_CHECK (NODE)->type.values)
+
/* Indirect types present difficulties because they may be represented
as either POINTER_TYPE/REFERENCE_TYPE nodes (unbounded) or as
RECORD_TYPE nodes (bounded). Bounded and unbounded pointers might
TI_PTRDIFF_TYPE,
TI_VA_LIST_TYPE,
+ TI_V4SF_TYPE,
+ TI_V4SI_TYPE,
+ TI_V8QI_TYPE,
+ TI_V4HI_TYPE,
+ TI_V2SI_TYPE,
+
TI_MAX
};
#define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
#define va_list_type_node global_trees[TI_VA_LIST_TYPE]
+#define V4SF_type_node global_trees[TI_V4SF_TYPE]
+#define V4SI_type_node global_trees[TI_V4SI_TYPE]
+#define V8QI_type_node global_trees[TI_V8QI_TYPE]
+#define V4HI_type_node global_trees[TI_V4HI_TYPE]
+#define V2SI_type_node global_trees[TI_V2SI_TYPE]
+
/* An enumeration of the standard C integer types. These must be
ordered so that shorter types appear before longer ones. */
enum integer_type_kind