poly_uint64 / TYPE_VECTOR_SUBPARTS question

Steve Ellcey sellcey@cavium.com
Fri Feb 9 18:05:00 GMT 2018

On Fri, 2018-02-09 at 17:58 +0000, Richard Sandiford wrote:
> OK, so is this in aarch64_builtin_vectorized_function?  to_constant
> isn't valid there because the code isn't specific to Advanced SIMD.
> The way to check for V2xx is:
>   known_eq (TYPE_VECTOR_SUBPARTS (...), 2U)
> Thanks,
> Richard

It is in aarch64_builtin_vectorized (actually in a new function called
from there).  What I am using right now to limit myself to V2DF is:

/* We only handle single argument V2DF functions for now.  */

  el_mode = TYPE_MODE (TREE_TYPE (type_out));
  in_mode = TYPE_MODE (TREE_TYPE (type_in));
  if (el_mode != in_mode || el_mode != DFmode)
    return NULL_TREE;

  if (!TYPE_VECTOR_SUBPARTS (type_out).is_constant (&n)
      || !TYPE_VECTOR_SUBPARTS (type_in).is_constant (&in_n))
    return NULL_TREE;

  if (n != in_n || n != 2)
    return NULL_TREE;

Steve Ellcey

More information about the Gcc mailing list