+2020-04-09 Richard Sandiford <richard.sandiford@arm.com>
+
+ * config/aarch64/aarch64.c (aarch64_attribute_table): Add
+ "SVE sizeless type".
+ * config/aarch64/aarch64-sve-builtins.cc (make_type_sizeless)
+ (sizeless_type_p): New functions.
+ (register_builtin_types): Apply make_type_sizeless to the type.
+ (register_tuple_type): Likewise.
+ (verify_type_context): Use sizeless_type_p instead of builin_type_p.
+
2020-04-09 Matthew Malcomson <matthew.malcomson@arm.com>
* config/arm/arm_cde.h: Remove `extern "C"` when compiling for
return lookup_attribute ("SVE type", TYPE_ATTRIBUTES (type));
}
+/* Force TYPE to be a sizeless type. */
+static void
+make_type_sizeless (tree type)
+{
+ TYPE_ATTRIBUTES (type) = tree_cons (get_identifier ("SVE sizeless type"),
+ NULL_TREE, TYPE_ATTRIBUTES (type));
+}
+
+/* Return true if TYPE is a sizeless type. */
+static bool
+sizeless_type_p (const_tree type)
+{
+ if (type == error_mark_node)
+ return NULL_TREE;
+ return lookup_attribute ("SVE sizeless type", TYPE_ATTRIBUTES (type));
+}
+
/* If TYPE is a valid SVE element type, return the corresponding type
suffix, otherwise return NUM_TYPE_SUFFIXES. */
static type_suffix_index
TYPE_INDIVISIBLE_P (vectype) = 1;
add_sve_type_attribute (vectype, num_zr, num_pr,
vector_types[i].mangled_name);
+ make_type_sizeless (vectype);
abi_vector_types[i] = vectype;
lang_hooks.types.register_builtin_type (vectype,
vector_types[i].abi_name);
DECL_FIELD_CONTEXT (field) = tuple_type;
TYPE_FIELDS (tuple_type) = field;
add_sve_type_attribute (tuple_type, num_vectors, 0, NULL);
+ make_type_sizeless (tuple_type);
layout_type (tuple_type);
gcc_assert (VECTOR_MODE_P (TYPE_MODE (tuple_type))
&& TYPE_MODE_RAW (tuple_type) == TYPE_MODE (tuple_type)
verify_type_context (location_t loc, type_context_kind context,
const_tree type, bool silent_p)
{
- if (!builtin_type_p (type))
+ if (!sizeless_type_p (type))
return true;
switch (context)
{ "aarch64_vector_pcs", 0, 0, false, true, true, true,
handle_aarch64_vector_pcs_attribute, NULL },
{ "SVE type", 3, 3, false, true, false, true, NULL, NULL },
+ { "SVE sizeless type", 0, 0, false, true, false, true, NULL, NULL },
{ NULL, 0, 0, false, false, false, false, NULL, NULL }
};