namespace arm_mve {
+/* Return a representation of "const T *". */
+static tree
+build_const_pointer (tree t)
+{
+ return build_pointer_type (build_qualified_type (t, TYPE_QUAL_CONST));
+}
+
/* If INSTANCE has a predicate, add it to the list of argument types
in ARGUMENT_TYPES. RETURN_TYPE is the type returned by the
function. */
/* Read and return a type from FORMAT for function INSTANCE. Advance
FORMAT beyond the type string. The format is:
+ _ - void
+ al - array pointer for loads
+ as - array pointer for stores
p - predicates with type mve_pred16_t
s<elt> - a scalar type with the given element suffix
t<elt> - a vector or tuple type with given element suffix [*1]
{
int ch = *format++;
+
+ if (ch == '_')
+ return void_type_node;
+
+ if (ch == 'a')
+ {
+ ch = *format++;
+ if (ch == 'l')
+ return build_const_pointer (instance.memory_scalar_type ());
+ if (ch == 's') {
+ return build_pointer_type (instance.memory_scalar_type ());
+ }
+ gcc_unreachable ();
+ }
+
if (ch == 'p')
return get_mve_pred16_t ();
bool could_trap_p () const;
unsigned int vectors_per_tuple () const;
+ tree memory_scalar_type () const;
const mode_suffix_info &mode_suffix () const;
of vectors in the tuples, otherwise return 1. */
virtual unsigned int vectors_per_tuple () const { return 1; }
+ /* If the function addresses memory, return the type of a single
+ scalar memory element. */
+ virtual tree
+ memory_scalar_type (const function_instance &) const
+ {
+ gcc_unreachable ();
+ }
+
/* Try to fold the given gimple call. Return the new gimple statement
on success, otherwise return null. */
virtual gimple *fold (gimple_folder &) const { return NULL; }
return base->vectors_per_tuple ();
}
+/* If the function addresses memory, return the type of a single
+ scalar memory element. */
+inline tree
+function_instance::memory_scalar_type () const
+{
+ return base->memory_scalar_type (*this);
+}
+
/* Return information about the function's mode suffix. */
inline const mode_suffix_info &
function_instance::mode_suffix () const